/**
 * 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 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){if(!r(e))throw new n("degrees is required.");return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){if(!r(e))throw new n("radians is required.");return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){if(!r(e))throw new n("angle is required.");var t=i.TWO_PI,a=e-Math.floor(e/t)*t;return a<-Math.PI?a+t:a>=Math.PI?a-t:a},i.clampToLatitudeRange=function(e){if(!r(e))throw new n("angle is required.");return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){if(!r(e))throw new n("angle is required.");return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){if(!r(e))throw new n("angle is required.");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){if(!r(e))throw new n("m is required.");if(!r(t))throw new n("n is required.");return(e%t+t)%t},i.equalsEpsilon=function(e,i,a,o){if(!r(e))throw new n("left is required.");if(!r(i))throw new n("right is required.");if(!r(a))throw new n("relativeEpsilon is required.");o=t(o,a);var u=Math.abs(e-i);return u<=o||u<=a*Math.max(Math.abs(e),Math.abs(i))};var a=[1];i.factorial=function(e){if("number"!=typeof e||e<0)throw new n("A number greater than or equal to 0 is required.");var t=a.length;if(e>=t)for(var r=a[t-1],i=t;i<=e;i++)a.push(r*i);return a[e]},i.incrementWrap=function(e,i,a){if(a=t(a,0),!r(e))throw new n("n is required.");if(i<=a)throw new n("maximumValue must be greater than minimumValue.");return++e,e>i&&(e=a),e},i.isPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new n("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new n("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,i){if(!r(e))throw new n("value is required");if(!r(t))throw new n("min is required.");if(!r(i))throw new n("max is required.");return e<t?t:e>i?i:e};var o=new e;return i.setRandomNumberSeed=function(t){if(!r(t))throw new n("seed is required.");o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){if(!r(e))throw new n("value is required.");return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){if(!r(e))throw new n("value is required.");return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){if(!r(e))throw new n("angle is required.");if(!r(t))throw new n("radius is required.");return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){if(!r(e))throw new n("number is required.");if(!r(t))throw new n("base is required.");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/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(r,n,i){return e.typeOf.object("value",r),e.defined("array",n),i=t(i,0),n[i++]=r.x,n[i]=r.y,n},o.unpack=function(n,i,a){return e.defined("array",n),i=t(i,0),r(a)||(a=new o),a.x=n[i++],a.y=n[i],a},o.packArray=function(t,n){e.defined("array",t);var i=t.length;r(n)?n.length=2*i:n=new Array(2*i);for(var a=0;a<i;++a)o.pack(t[a],n,2*a);return n},o.unpackArray=function(t,n){e.defined("array",t);var i=t.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=a/2;n[u]=o.unpack(t,a,n[u])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){if(!r(e)||!r(t))throw new n("left and right are required.");return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){if(!r(e)||!r(t))throw new n("left and right are required.");return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=o.magnitude(t);if(r.x=t.x/i,r.y=t.y/i,isNaN(r.x)||isNaN(r.y))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n},o.divideComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x/r.x,n.y=t.y/r.y,n},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r};var s=new o;o.lerp=function(t,r,n,i){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",i),o.multiplyByScalar(r,n,s),i=o.multiplyByScalar(t,1-n,i),o.add(s,i,i)};var c=new o,l=new o;o.angleBetween=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.normalize(t,c),o.normalize(r,l),a.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,f);return o.abs(n,n),r=n.x<=n.y?o.clone(o.UNIT_X,r):o.clone(o.UNIT_Y,r)},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/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(n,i){e.typeOf.object("spherical",n),r(i)||(i=new o);var a=n.clock,u=n.cone,s=t(n.magnitude,1),c=s*Math.sin(u);return i.x=c*Math.cos(a),i.y=c*Math.sin(a),i.z=s*Math.cos(u),i},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(r,n,i){return e.typeOf.object("value",r),e.defined("array",n),i=t(i,0),n[i++]=r.x,n[i++]=r.y,n[i]=r.z,n},o.unpack=function(n,i,a){return e.defined("array",n),i=t(i,0),r(a)||(a=new o),a.x=n[i++],a.y=n[i++],a.z=n[i],a},o.packArray=function(t,n){e.defined("array",t);var i=t.length;r(n)?n.length=3*i:n=new Array(3*i);for(var a=0;a<i;++a)o.pack(t[a],n,3*a);return n},o.unpackArray=function(t,i){if(e.defined("array",t),e.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new n("array length must be a multiple of 3.");var a=t.length;r(i)?i.length=a/3:i=new Array(a/3);for(var u=0;u<a;u+=3){var s=u/3;i[s]=o.unpack(t,u,i[s])}return i},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n.z=Math.min(t.z,r.z),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n.z=Math.max(t.z,r.z),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitude(u)},o.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=o.magnitude(t);if(r.x=t.x/i,r.y=t.y/i,r.z=t.z/i,isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y+t.z*r.z},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n.z=t.z*r.z,n},o.divideComponents=function(e,t,i){if(!r(e))throw new n("left is required");if(!r(t))throw new n("right is required");if(!r(i))throw new n("result is required");return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n.z=t.z+r.z,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n.z=t.z-r.z,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n.z=t.z*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n.z=t.z/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r.z=-t.z,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r};var s=new o;o.lerp=function(t,r,n,i){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",i),o.multiplyByScalar(r,n,s),i=o.multiplyByScalar(t,1-n,i),o.add(s,i,i)};var c=new o,l=new o;o.angleBetween=function(t,r){e.typeOf.object("left",t),e.typeOf.object("right",r),o.normalize(t,c),o.normalize(r,l);var n=o.dot(c,l),i=o.magnitude(o.cross(c,l,c));return Math.atan2(i,n)};var f=new o;o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,f);return o.abs(n,n),r=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,r):o.clone(o.UNIT_Z,r):n.y<=n.z?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_Z,r)},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(t,r,n){e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=r.x,s=r.y,c=r.z,l=a*c-o*s,f=o*u-i*c,h=i*s-a*u;return n.x=l,n.y=f,n.z=h,n},o.fromDegrees=function(t,r,n,i,u){return e.typeOf.number("longitude",t),e.typeOf.number("latitude",r),t=a.toRadians(t),r=a.toRadians(r),o.fromRadians(t,r,n,i,u)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(n,i,a,u,s){e.typeOf.number("longitude",n),e.typeOf.number("latitude",i),a=t(a,0);var c=r(u)?u.radiiSquared:p,l=Math.cos(i);h.x=l*Math.cos(n),h.y=l*Math.sin(n),h.z=Math.sin(i),h=o.normalize(h,h),o.multiplyComponents(c,h,d);var f=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,f,d),h=o.multiplyByScalar(h,a,h),r(s)||(s=new o),o.add(d,h,s)},o.fromDegreesArray=function(t,i,a){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new n("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;r(a)?a.length=u/2:a=new Array(u/2);for(var s=0;s<u;s+=2){var c=t[s],l=t[s+1],f=s/2;a[f]=o.fromDegrees(c,l,0,i,a[f])}return a},o.fromRadiansArray=function(t,i,a){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new n("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;r(a)?a.length=u/2:a=new Array(u/2);for(var s=0;s<u;s+=2){var c=t[s],l=t[s+1],f=s/2;a[f]=o.fromRadians(c,l,0,i,a[f])}return a},o.fromDegreesArrayHeights=function(t,i,a){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new n("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;r(a)?a.length=u/3:a=new Array(u/3);for(var s=0;s<u;s+=3){var c=t[s],l=t[s+1],f=t[s+2],h=s/3;a[h]=o.fromDegrees(c,l,f,i,a[h])}return a},o.fromRadiansArrayHeights=function(t,i,a){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new n("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;r(a)?a.length=u/3:a=new Array(u/3);for(var s=0;s<u;s+=3){var c=t[s],l=t[s+1],f=t[s+2],h=s/3;a[h]=o.fromRadians(c,l,f,i,a[h])}return a},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/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncodeInRange=function(e,a,o){if(!r(e))throw new n("vector is required.");if(!r(o))throw new n("result is required.");var u=t.magnitudeSquared(e);if(Math.abs(u-1)>i.EPSILON6)throw new n("vector must be normalized.");if(o.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),o.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var s=o.x,c=o.y;o.x=(1-Math.abs(c))*i.signNotZero(s),o.y=(1-Math.abs(s))*i.signNotZero(c)}return o.x=i.toSNorm(o.x,a),o.y=i.toSNorm(o.y,a),o},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,a,o,u){if(!r(u))throw new n("result is required.");if(e<0||e>o||a<0||a>o)throw new n("x and y must be a signed normalized integer between 0 and "+o);if(u.x=i.fromSNorm(e,o),u.y=i.fromSNorm(a,o),u.z=1-(Math.abs(u.x)+Math.abs(u.y)),u.z<0){var s=u.x;u.x=(1-Math.abs(u.y))*i.signNotZero(s),u.y=(1-Math.abs(s))*i.signNotZero(u.y)}return t.normalize(u,u)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){if(!r(e))throw new n("encoded is required.");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){if(!r(e))throw new n("value is required.");var i=e/256,o=Math.floor(i),u=256*(i-o);return a.octDecode(o,u,t)},a.octPack=function(e,t,i,u){if(!r(e))throw new n("v1 is required.");if(!r(t))throw new n("v2 is required.");if(!r(i))throw new n("v3 is required.");if(!r(u))throw new n("result is required.");var s=a.octEncodeFloat(e),c=a.octEncodeFloat(t),l=a.octEncode(i,o);return u.x=65536*l.x+s,u.y=65536*l.y+c,u},a.octUnpack=function(e,t,i,o){if(!r(e))throw new n("packed is required.");if(!r(t))throw new n("v1 is required.");if(!r(i))throw new n("v2 is required.");if(!r(o))throw new n("v3 is required.");var u=e.x/65536,s=Math.floor(u),c=65536*(u-s);u=e.y/65536;var l=Math.floor(u),f=65536*(u-l);a.octDecodeFloat(c,t),a.octDecodeFloat(f,i),a.octDecode(s,l,o)},a.compressTextureCoordinates=function(e){if(!r(e))throw new n("textureCoordinates is required.");var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},a.decompressTextureCoordinates=function(e,t){if(!r(e))throw new n("compressed is required.");if(!r(t))throw new n("result is required.");var i=e/4096,a=Math.floor(i);return t.x=a/4095,t.y=(e-4096*a)/4095,t},a}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(i,u,s,c,l){if(!t(i))throw new r("cartesian is required.");if(!t(u))throw new r("oneOverRadii is required.");if(!t(s))throw new r("oneOverRadiiSquared is required.");if(!t(c))throw new r("centerToleranceSquared is required.");var f=i.x,h=i.y,d=i.z,p=u.x,m=u.y,y=u.z,E=f*f*p*p,w=h*h*m*m,O=d*d*y*y,_=E+w+O,T=Math.sqrt(1/_),R=e.multiplyByScalar(i,T,a);if(_<c)return isFinite(T)?e.clone(R,l):void 0;var g=s.x,A=s.y,S=s.z,N=o;N.x=R.x*g*2,N.y=R.y*A*2,N.z=R.z*S*2;var b,v,M,I,x,C,P,U,D,q,F,L=(1-T)*e.magnitude(i)/(.5*e.magnitude(N)),B=0;do{L-=B,M=1/(1+L*g),I=1/(1+L*A),x=1/(1+L*S),C=M*M,P=I*I,U=x*x,D=C*M,q=P*I,F=U*x,b=E*C+w*P+O*U-1,v=E*D*g+w*q*A+O*F*S;var z=-2*v;B=b/z}while(Math.abs(b)>n.EPSILON12);return t(l)?(l.x=f*M,l.y=h*I,l.z=d*x,l):new e(f*M,h*I,d*x)}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,i,a,o){if(!r(e))throw new n("longitude is required.");if(!r(i))throw new n("latitude is required.");return a=t(a,0),r(o)?(o.longitude=e,o.latitude=i,o.height=a,o):new u(e,i,a)},u.fromDegrees=function(e,t,i,o){if(!r(e))throw new n("longitude is required.");if(!r(t))throw new n("latitude is required.");return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,i,o)};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,m=r(n)?n.oneOverRadiiSquared:h,y=r(n)?n._centerToleranceSquared:d,E=o(t,p,m,y,c);if(r(E)){var w=e.multiplyComponents(E,m,s);w=e.normalize(w,w);var O=e.subtract(t,E,l),_=Math.atan2(w.y,w.x),T=Math.asin(w.z),R=a.sign(e.dot(O,t))*e.magnitude(O);return r(i)?(i.longitude=_,i.latitude=T,i.height=R,i):new u(_,T,R)}},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,i){if("number"!=typeof i)throw new n("epsilon is required and must be a number.");return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},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,o){if(n=r(n,0),i=r(i,0),o=r(o,0),n<0||i<0||o<0)throw new a("All radii components must be greater than or equal to zero.");t._radii=new e(n,i,o),t._radiiSquared=new e(n*n,i*i,o*o),t._radiiToTheFourth=new e(n*n*n*n,i*i*i*i,o*o*o*o),t._oneOverRadii=new e(0===n?0:1/n,0===i?0:1/i,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===i?0:1/(i*i),0===o?0:1/(o*o)),t._minimumRadius=Math.min(n,i,o),t._maximumRadius=Math.max(n,i,o),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,i,o){if(!n(t))throw new a("value is required");if(!n(i))throw new a("array is required");return o=r(o,0),e.pack(t._radii,i,o),i},l.unpack=function(t,i,o){if(!n(t))throw new a("array is required");i=r(i,0);var u=e.unpack(t,i);return l.fromCartesian3(u,o)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){if(!n(t))throw new a("cartographic is required.");var i=t.longitude,o=t.latitude,u=Math.cos(o),s=u*Math.cos(i),c=u*Math.sin(i),l=Math.sin(o);return n(r)||(r=new e),r.x=s,r.y=c,r.z=l,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){if(!n(e))throw new a("cartographics is required.");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,m=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,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(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){if(!n(e))throw new a("cartesians is required.");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){if(!n(t))throw new a("cartesian is required.");n(r)||(r=new e);var i=t.x,o=t.y,u=t.z,s=this._oneOverRadiiSquared,c=1/Math.sqrt(i*i*s.x+o*o*s.y+u*u*s.z);return e.multiplyByScalar(t,c,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,o){if(!n(t))throw new a("position is required.");if(!u.equalsEpsilon(this._radii.x,this._radii.y,u.EPSILON15))throw new a("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");if(0===this._radii.z)throw new a("Ellipsoid.radii.z must be greater than 0");i=r(i,0);var s=this._sqauredXOverSquaredZ;if(n(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-s),!(Math.abs(o.z)>=this._radii.z-i))return o},l}),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){if(!n(e))throw new a("cartesian is required");var i=this._oneOverSemimajorAxis,o=e.x*i,u=e.y*i,s=e.z;return n(r)?(r.longitude=o,r.latitude=u,r.height=s,r):new t(o,u,s)},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(m[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(m[a],p[a])]);
o>n&&(i=a,n=o)}var c=1,l=0,f=p[i],h=m[i];if(Math.abs(e[s.getElementIndex(h,f)])>r){var d,y=e[s.getElementIndex(h,h)],E=e[s.getElementIndex(f,f)],w=e[s.getElementIndex(h,f)],O=(y-E)/2/w;d=O<0?-1/(-O+Math.sqrt(1+O*O)):1/(O+Math.sqrt(1+O*O)),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,n,i){return t.typeOf.object("value",e),t.defined("array",n),i=r(i,0),n[i++]=e[0],n[i++]=e[1],n[i++]=e[2],n[i++]=e[3],n[i++]=e[4],n[i++]=e[5],n[i++]=e[6],n[i++]=e[7],n[i++]=e[8],n},s.unpack=function(e,i,a){return t.defined("array",e),i=r(i,0),n(a)||(a=new s),a[0]=e[i++],a[1]=e[i++],a[2]=e[i++],a[3]=e[i++],a[4]=e[i++],a[5]=e[i++],a[6]=e[i++],a[7]=e[i++],a[8]=e[i++],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,i,a){return t.defined("array",e),i=r(i,0),n(a)||(a=new s),a[0]=e[i],a[1]=e[i+1],a[2]=e[i+2],a[3]=e[i+3],a[4]=e[i+4],a[5]=e[i+5],a[6]=e[i+6],a[7]=e[i+7],a[8]=e[i+8],a},s.fromColumnMajorArray=function(e,r){return t.defined("values",e),s.clone(e,r)},s.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,r){t.typeOf.object("quaternion",e);var i=e.x*e.x,a=e.x*e.y,o=e.x*e.z,u=e.x*e.w,c=e.y*e.y,l=e.y*e.z,f=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=i-c-h+p,y=2*(a-d),E=2*(o+f),w=2*(a+d),O=-i+c-h+p,_=2*(l-u),T=2*(o-f),R=2*(l+u),g=-i-c+h+p;return n(r)?(r[0]=m,r[1]=w,r[2]=T,r[3]=y,r[4]=O,r[5]=R,r[6]=E,r[7]=_,r[8]=g,r):new s(m,y,E,w,O,_,T,R,g)},s.fromHeadingPitchRoll=function(e,r){t.typeOf.object("headingPitchRoll",e);var i=Math.cos(-e.pitch),a=Math.cos(-e.heading),o=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),l=Math.sin(e.roll),f=i*a,h=-o*c+l*u*a,d=l*c+o*u*a,p=i*c,m=o*a+l*u*c,y=-u*o+o*u*c,E=-u,w=l*i,O=o*i;return n(r)?(r[0]=f,r[1]=p,r[2]=E,r[3]=h,r[4]=m,r[5]=w,r[6]=d,r[7]=y,r[8]=O,r):new s(f,h,d,p,m,y,E,w,O)},s.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,r){return t.typeOf.object("vector",e),n(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),a=Math.sin(e);return n(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=i,r[5]=a,r[6]=0,r[7]=-a,r[8]=i,r):new s(1,0,0,0,i,-a,0,a,i)},s.fromRotationY=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),a=Math.sin(e);return n(r)?(r[0]=i,r[1]=0,r[2]=-a,r[3]=0,r[4]=1,r[5]=0,r[6]=a,r[7]=0,r[8]=i,r):new s(i,0,a,0,1,0,-a,0,i)},s.fromRotationZ=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),a=Math.sin(e);return n(r)?(r[0]=i,r[1]=a,r[2]=0,r[3]=-a,r[4]=i,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new s(i,-a,0,a,i,0,0,0,1)},s.toArray=function(e,r){return t.typeOf.object("matrix",e),n(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,r){return t.typeOf.number.greaterThanOrEquals("row",r,0),t.typeOf.number.lessThanOrEquals("row",r,2),t.typeOf.number.greaterThanOrEquals("column",e,0),t.typeOf.number.lessThanOrEquals("column",e,2),3*e+r},s.getColumn=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("result",n);var i=3*r,a=e[i],o=e[i+1],u=e[i+2];return n.x=a,n.y=o,n.z=u,n},s.setColumn=function(e,r,n,i){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=s.clone(e,i);var a=3*r;return i[a]=n.x,i[a+1]=n.y,i[a+2]=n.z,i},s.getRow=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("result",n);var i=e[r],a=e[r+3],o=e[r+6];return n.x=i,n.y=a,n.z=o,n},s.setRow=function(e,r,n,i){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=s.clone(e,i),i[r]=n.x,i[r+3]=n.y,i[r+6]=n.z,i};var h=new e;s.getScale=function(r,n){return t.typeOf.object("matrix",r),t.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(r[0],r[1],r[2],h)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],h)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var i=e[0]*r[0]+e[3]*r[1]+e[6]*r[2],a=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],o=e[2]*r[0]+e[5]*r[1]+e[8]*r[2],u=e[0]*r[3]+e[3]*r[4]+e[6]*r[5],s=e[1]*r[3]+e[4]*r[4]+e[7]*r[5],c=e[2]*r[3]+e[5]*r[4]+e[8]*r[5],l=e[0]*r[6]+e[3]*r[7]+e[6]*r[8],f=e[1]*r[6]+e[4]*r[7]+e[7]*r[8],h=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=i,n[1]=a,n[2]=o,n[3]=u,n[4]=s,n[5]=c,n[6]=l,n[7]=f,n[8]=h,n},s.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n[4]=e[4]+r[4],n[5]=e[5]+r[5],n[6]=e[6]+r[6],n[7]=e[7]+r[7],n[8]=e[8]+r[8],n},s.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n[4]=e[4]-r[4],n[5]=e[5]-r[5],n[6]=e[6]-r[6],n[7]=e[7]-r[7],n[8]=e[8]-r[8],n},s.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var i=r.x,a=r.y,o=r.z,u=e[0]*i+e[3]*a+e[6]*o,s=e[1]*i+e[4]*a+e[7]*o,c=e[2]*i+e[5]*a+e[8]*o;return n.x=u,n.y=s,n.z=c,n},s.multiplyByScalar=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n},s.multiplyByScale=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.object("scale",r),t.typeOf.object("result",n),n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.x,n[3]=e[3]*r.y,n[4]=e[4]*r.y,n[5]=e[5]*r.y,n[6]=e[6]*r.z,n[7]=e[7]*r.z,n[8]=e[8]*r.z,n},s.negate=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=-e[7],r[8]=-e[8],r},s.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[3],a=e[6],o=e[1],u=e[4],s=e[7],c=e[2],l=e[5],f=e[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};var p=[1,0,0],m=[2,2,1],y=new s,E=new s;return s.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var i=u.EPSILON20,a=10,o=0,h=0;n(r)||(r={});for(var d=r.unitary=s.clone(s.IDENTITY,r.unitary),p=r.diagonal=s.clone(e,r.diagonal),m=i*c(p);h<a&&l(p)>m;)f(p,y),s.transpose(y,E),s.multiply(p,y,p),s.multiply(E,p,p),s.multiply(d,y,d),++o>2&&(++h,o=0);return r},s.abs=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r},s.determinant=function(e){t.typeOf.object("matrix",e);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 r*(o*l-c*u)+a*(c*i-n*l)+s*(n*u-o*i)},s.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[1],o=e[2],c=e[3],l=e[4],f=e[5],h=e[6],d=e[7],p=e[8],m=s.determinant(e);if(Math.abs(m)<=u.EPSILON15)throw new a("matrix is not invertible");r[0]=l*p-d*f,r[1]=d*o-i*p,r[2]=i*f-l*o,r[3]=h*f-c*p,r[4]=n*p-h*o,r[5]=c*o-n*f,r[6]=c*d-h*l,r[7]=h*i-n*d,r[8]=n*l-c*i;var y=1/m;return s.multiplyByScalar(r,y,r)},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,r,i){return t.typeOf.number("epsilon",i),e===r||n(e)&&n(r)&&Math.abs(e[0]-r[0])<=i&&Math.abs(e[1]-r[1])<=i&&Math.abs(e[2]-r[2])<=i&&Math.abs(e[3]-r[3])<=i&&Math.abs(e[4]-r[4])<=i&&Math.abs(e[5]-r[5])<=i&&Math.abs(e[6]-r[6])<=i&&Math.abs(e[7]-r[7])<=i&&Math.abs(e[8]-r[8])<=i},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(t,n){return e.typeOf.object("color",t),r(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new o(t.red,t.green,t.blue,t.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(r,n,i){return e.typeOf.object("value",r),e.defined("array",n),i=t(i,0),n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=r.w,n},o.unpack=function(n,i,a){return e.defined("array",n),i=t(i,0),r(a)||(a=new o),a.x=n[i++],a.y=n[i++],a.z=n[i++],a.w=n[i],a},o.packArray=function(t,n){e.defined("array",t);var i=t.length;r(n)?n.length=4*i:n=new Array(4*i);for(var a=0;a<i;++a)o.pack(t[a],n,4*a);return n},o.unpackArray=function(t,n){e.defined("array",t);var i=t.length;r(n)?n.length=i/4:n=new Array(i/4);for(var a=0;a<i;a+=4){var u=a/4;n[u]=o.unpack(t,a,n[u])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n.z=Math.min(t.z,r.z),n.w=Math.min(t.w,r.w),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n.z=Math.max(t.z,r.z),n.w=Math.max(t.w,r.w),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitude(u)},o.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=o.magnitude(t);if(r.x=t.x/i,r.y=t.y/i,r.z=t.z/i,r.w=t.w/i,isNaN(r.x)||isNaN(r.y)||isNaN(r.z)||isNaN(r.w))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y+t.z*r.z+t.w*r.w},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n.z=t.z*r.z,n.w=t.w*r.w,n},o.divideComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x/r.x,n.y=t.y/r.y,n.z=t.z/r.z,n.w=t.w/r.w,n},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n.z=t.z+r.z,n.w=t.w+r.w,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n.z=t.z-r.z,n.w=t.w-r.w,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n.z=t.z*r,n.w=t.w*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n.z=t.z/r,n.w=t.w/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r.z=-t.z,r.w=-t.w,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r.w=Math.abs(t.w),r};var s=new o;o.lerp=function(t,r,n,i){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",i),o.multiplyByScalar(r,n,s),i=o.multiplyByScalar(t,1-n,i),o.add(s,i,i)};var c=new o;return o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,c);return o.abs(n,n),r=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,r):o.clone(o.UNIT_W,r):n.z<=n.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_W,r):n.z<=n.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r)},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,m,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(m,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,i){return r.typeOf.object("value",e),r.defined("array",t),i=n(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},l.unpack=function(e,t,a){return r.defined("array",e),t=n(t,0),i(a)||(a=new l),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[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},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 r.defined("values",e),l.clone(e,t)},l.fromRowMajorArray=function(e,t){return r.defined("values",e),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,a,o){return r.typeOf.object("rotation",t),a=n(a,e.ZERO),i(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]=a.x,o[13]=a.y,o[14]=a.z,o[15]=1,o):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r.typeOf.object("translation",e),r.typeOf.object("rotation",t),r.typeOf.object("scale",n),i(a)||(a=new l);var o=n.x,u=n.y,s=n.z,c=t.x*t.x,f=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,y=t.y*t.w,E=t.z*t.z,w=t.z*t.w,O=t.w*t.w,_=c-p-E+O,T=2*(f-w),R=2*(h+y),g=2*(f+w),A=-c+p-E+O,S=2*(m-d),N=2*(h-y),b=2*(m+d),v=-c-p+E+O;return a[0]=_*o,a[1]=g*o,a[2]=N*o,a[3]=0,a[4]=T*u,a[5]=A*u,a[6]=b*u,a[7]=0,a[8]=R*s,a[9]=S*s,a[10]=v*s,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return r.typeOf.object("translationRotationScale",e),l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return r.typeOf.object("translation",e),l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return r.typeOf.object("scale",e),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 r.typeOf.number("scale",e),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,n){r.typeOf.object("camera",t);var a=t.position,o=t.direction,u=t.up;r.typeOf.object("camera.position",a),r.typeOf.object("camera.direction",o),r.typeOf.object("camera.up",u),e.normalize(o,f),e.normalize(e.cross(f,u,h),h),e.normalize(e.cross(h,f,d),d);var s=h.x,c=h.y,p=h.z,m=f.x,y=f.y,E=f.z,w=d.x,O=d.y,_=d.z,T=a.x,R=a.y,g=a.z,A=s*-T+c*-R+p*-g,S=w*-T+O*-R+_*-g,N=m*T+y*R+E*g;return i(n)?(n[0]=s,n[1]=w,n[2]=-m,n[3]=0,n[4]=c,n[5]=O,n[6]=-y,n[7]=0,n[8]=p,n[9]=_,n[10]=-E,n[11]=0,n[12]=A,n[13]=S,n[14]=N,n[15]=1,n):new l(s,c,p,A,w,O,_,S,-m,-y,-E,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,i,a){r.typeOf.number.greaterThan("fovY",e,0),r.typeOf.number.lessThan("fovY",e,Math.PI),r.typeOf.number.greaterThan("near",n,0),r.typeOf.number.greaterThan("far",i,0),r.typeOf.object("result",a);var o=Math.tan(.5*e),u=1/o,s=u/t,c=(i+n)/(n-i),l=2*i*n/(n-i);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=-1,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,i,a,o,u){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",i),r.typeOf.number("near",a),r.typeOf.number("far",o),r.typeOf.object("result",u);var s=1/(t-e),c=1/(i-n),l=1/(o-a),f=-(t+e)*s,h=-(i+n)*c,d=-(o+a)*l;return s*=2,c*=2,l*=-2,u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=l,u[11]=0,u[12]=f,u[13]=h,u[14]=d,u[15]=1,u},l.computePerspectiveOffCenter=function(e,t,n,i,a,o,u){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",i),r.typeOf.number("near",a),r.typeOf.number("far",o),r.typeOf.object("result",u);var s=2*a/(t-e),c=2*a/(i-n),l=(t+e)/(t-e),f=(i+n)/(i-n),h=-(o+a)/(o-a),d=-1,p=-2*o*a/(o-a);return u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=l,u[9]=f,u[10]=h,u[11]=d,u[12]=0,u[13]=0,u[14]=p,u[15]=0,u},l.computeInfinitePerspectiveOffCenter=function(e,t,n,i,a,o){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",i),r.typeOf.number("near",a),r.typeOf.object("result",o);var u=2*a/(t-e),s=2*a/(i-n),c=(t+e)/(t-e),l=(i+n)/(i-n),f=-1,h=-1,d=-2*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.computeViewportTransformation=function(e,t,i,a){r.typeOf.object("result",a),e=n(e,n.EMPTY_OBJECT);var o=n(e.x,0),u=n(e.y,0),s=n(e.width,0),c=n(e.height,0);t=n(t,0),i=n(i,1);var l=.5*s,f=.5*c,h=.5*(i-t),d=l,p=f,m=h,y=o+l,E=u+f,w=t+h,O=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=p,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=m,a[11]=0,a[12]=y,a[13]=E,a[14]=w,a[15]=O,a},l.computeView=function(t,n,i,a,o){return r.typeOf.object("position",t),r.typeOf.object("direction",n),r.typeOf.object("up",i),r.typeOf.object("right",a),r.typeOf.object("result",o),o[0]=a.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=a.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=a.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-e.dot(a,t),o[13]=-e.dot(i,t),o[14]=e.dot(n,t),o[15]=1,o},l.toArray=function(e,t){return r.typeOf.object("matrix",e),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 r.typeOf.number.greaterThanOrEquals("row",t,0),r.typeOf.number.lessThanOrEquals("row",t,3),r.typeOf.number.greaterThanOrEquals("column",e,0),r.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},l.getColumn=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("result",n);var i=4*t,a=e[i],o=e[i+1],u=e[i+2],s=e[i+3];return n.x=a,n.y=o,n.z=u,n.w=s,n},l.setColumn=function(e,t,n,i){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("cartesian",n),r.typeOf.object("result",i),i=l.clone(e,i);var a=4*t;return i[a]=n.x,i[a+1]=n.y,i[a+2]=n.z,i[a+3]=n.w,i},l.setTranslation=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.object("translation",t),r.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("result",n);var i=e[t],a=e[t+4],o=e[t+8],u=e[t+12];return n.x=i,n.y=a,n.z=o,n.w=u,n},l.setRow=function(e,t,n,i){return r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("cartesian",n),r.typeOf.object("result",i),i=l.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};var p=new e;l.getScale=function(t,n){return r.typeOf.object("matrix",t),r.typeOf.object("result",n),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 m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[3],s=e[4],c=e[5],l=e[6],f=e[7],h=e[8],d=e[9],p=e[10],m=e[11],y=e[12],E=e[13],w=e[14],O=e[15],_=t[0],T=t[1],R=t[2],g=t[3],A=t[4],S=t[5],N=t[6],b=t[7],v=t[8],M=t[9],I=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],q=i*_+s*T+h*R+y*g,F=a*_+c*T+d*R+E*g,L=o*_+l*T+p*R+w*g,B=u*_+f*T+m*R+O*g,z=i*A+s*S+h*N+y*b,j=a*A+c*S+d*N+E*b,G=o*A+l*S+p*N+w*b,W=u*A+f*S+m*N+O*b,X=i*v+s*M+h*I+y*x,V=a*v+c*M+d*I+E*x,H=o*v+l*M+p*I+w*x,Y=u*v+f*M+m*I+O*x,k=i*C+s*P+h*U+y*D,Z=a*C+c*P+d*U+E*D,K=o*C+l*P+p*U+w*D,J=u*C+f*P+m*U+O*D;return n[0]=q,n[1]=F,n[2]=L,n[3]=B,n[4]=z,n[5]=j,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]=K,n[15]=J,n},l.add=function(e,t,n){return r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),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 r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),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){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],h=e[10],d=e[12],p=e[13],m=e[14],y=t[0],E=t[1],w=t[2],O=t[4],_=t[5],T=t[6],R=t[8],g=t[9],A=t[10],S=t[12],N=t[13],b=t[14],v=i*y+u*E+l*w,M=a*y+s*E+f*w,I=o*y+c*E+h*w,x=i*O+u*_+l*T,C=a*O+s*_+f*T,P=o*O+c*_+h*T,U=i*R+u*g+l*A,D=a*R+s*g+f*A,q=o*R+c*g+h*A,F=i*S+u*N+l*b+d,L=a*S+s*N+f*b+p,B=o*S+c*N+h*b+m;return n[0]=v,n[1]=M,n[2]=I,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=q,n[11]=0,n[12]=F,n[13]=L,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("rotation",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],h=e[10],d=t[0],p=t[1],m=t[2],y=t[3],E=t[4],w=t[5],O=t[6],_=t[7],T=t[8],R=i*d+u*p+l*m,g=a*d+s*p+f*m,A=o*d+c*p+h*m,S=i*y+u*E+l*w,N=a*y+s*E+f*w,b=o*y+c*E+h*w,v=i*O+u*_+l*T,M=a*O+s*_+f*T,I=o*O+c*_+h*T;return n[0]=R,n[1]=g,n[2]=A,n[3]=0,n[4]=S,n[5]=N,n[6]=b,n[7]=0,n[8]=v,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){r.typeOf.object("matrix",e),r.typeOf.object("translation",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=i*e[0]+a*e[4]+o*e[8]+e[12],s=i*e[1]+a*e[5]+o*e[9]+e[13],c=i*e[2]+a*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=u,n[13]=s,n[14]=c,n[15]=e[15],n};var y=new e;l.multiplyByUniformScale=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scale",t),r.typeOf.object("result",n),y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,n)},l.multiplyByScale=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("scale",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z;return 1===i&&1===a&&1===o?l.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*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]=o*e[8],n[9]=o*e[9],n[10]=o*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){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=t.w,s=e[0]*i+e[4]*a+e[8]*o+e[12]*u,c=e[1]*i+e[5]*a+e[9]*o+e[13]*u,l=e[2]*i+e[6]*a+e[10]*o+e[14]*u,f=e[3]*i+e[7]*a+e[11]*o+e[15]*u;return n.x=s,n.y=c,n.z=l,n.w=f,n},l.multiplyByPointAsVector=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=e[0]*i+e[4]*a+e[8]*o,s=e[1]*i+e[5]*a+e[9]*o,c=e[2]*i+e[6]*a+e[10]*o;return n.x=u,n.y=s,n.z=c,n},l.multiplyByPoint=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=e[0]*i+e[4]*a+e[8]*o+e[12],s=e[1]*i+e[5]*a+e[9]*o+e[13],c=e[2]*i+e[6]*a+e[10]*o+e[14];return n.x=u,n.y=s,n.z=c,n},l.multiplyByScalar=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scalar",t),r.typeOf.object("result",n),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 r.typeOf.object("matrix",e),r.typeOf.object("result",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},l.transpose=function(e,t){r.typeOf.object("matrix",e),r.typeOf.object("result",t);var n=e[1],i=e[2],a=e[3],o=e[6],u=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=u,t[14]=s,t[15]=e[15],t},l.abs=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),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,n){return r.typeOf.number("epsilon",n),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},l.getTranslation=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),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 E=new s,w=new s,O=new t,_=new t(0,0,0,1);return l.inverse=function(e,n){if(r.typeOf.object("matrix",e),r.typeOf.object("result",n),s.equalsEpsilon(l.getRotation(e,E),w,u.EPSILON7)&&t.equals(l.getRow(e,3,O),_))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 i=e[0],a=e[4],o=e[8],f=e[12],h=e[1],d=e[5],p=e[9],m=e[13],y=e[2],T=e[6],R=e[10],g=e[14],A=e[3],S=e[7],N=e[11],b=e[15],v=R*b,M=g*N,I=T*b,x=g*S,C=T*N,P=R*S,U=y*b,D=g*A,q=y*N,F=R*A,L=y*S,B=T*A,z=v*d+x*p+C*m-(M*d+I*p+P*m),j=M*h+U*p+F*m-(v*h+D*p+q*m),G=I*h+D*d+L*m-(x*h+U*d+B*m),W=P*h+q*d+B*p-(C*h+F*d+L*p),X=M*a+I*o+P*f-(v*a+x*o+C*f),V=v*i+D*o+q*f-(M*i+U*o+F*f),H=x*i+U*a+B*f-(I*i+D*a+L*f),Y=C*i+F*a+L*o-(P*i+q*a+B*o);v=o*m,M=f*p,I=a*m,x=f*d,C=a*p,P=o*d,U=i*m,D=f*h,q=i*p,F=o*h,L=i*d,B=a*h;var k=v*S+x*N+C*b-(M*S+I*N+P*b),Z=M*A+U*N+F*b-(v*A+D*N+q*b),K=I*A+D*S+L*b-(x*A+U*S+B*b),J=P*A+q*S+B*N-(C*A+F*S+L*N),Q=I*R+P*g+M*T-(C*g+v*T+x*R),$=q*g+v*y+D*R-(U*R+F*g+M*y),ee=U*T+B*g+x*y-(L*g+I*y+D*T),te=L*R+C*y+F*T-(q*T+B*R+P*y),re=i*z+a*j+o*G+f*W;
if(Math.abs(re)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return re=1/re,n[0]=z*re,n[1]=j*re,n[2]=G*re,n[3]=W*re,n[4]=X*re,n[5]=V*re,n[6]=H*re,n[7]=Y*re,n[8]=k*re,n[9]=Z*re,n[10]=K*re,n[11]=J*re,n[12]=Q*re,n[13]=$*re,n[14]=ee*re,n[15]=te*re,n},l.inverseTransformation=function(e,t){r.typeOf.object("matrix",e),r.typeOf.object("result",t);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],m=-n*h-i*d-a*p,y=-o*h-u*d-s*p,E=-c*h-l*d-f*p;return t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=u,t[6]=l,t[7]=0,t[8]=a,t[9]=s,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=E,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,n,i){return t.typeOf.object("value",e),t.defined("array",n),i=r(i,0),n[i++]=e.west,n[i++]=e.south,n[i++]=e.east,n[i]=e.north,n},s.unpack=function(e,i,a){return t.defined("array",e),i=r(i,0),n(a)||(a=new s),a.west=e[i++],a.south=e[i++],a.east=e[i++],a.north=e[i],a},s.computeWidth=function(e){t.typeOf.object("rectangle",e);var r=e.east,n=e.west;return r<n&&(r+=u.TWO_PI),r-n},s.computeHeight=function(e){return t.typeOf.object("rectangle",e),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,r){t.defined("cartographics",e);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=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 m=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}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.fromCartesianArray=function(e,r,i){t.defined("cartesians",e);for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0,p=e.length;d<p;d++){var m=r.cartesianToCartographic(e[d]);a=Math.min(a,m.longitude),o=Math.max(o,m.longitude),f=Math.min(f,m.latitude),h=Math.max(h,m.latitude);var y=m.longitude>=0?m.longitude:m.longitude+u.TWO_PI;c=Math.min(c,y),l=Math.max(l,y)}return o-a>l-c&&(a=c,o=l,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(i)?(i.west=a,i.south=f,i.east=o,i.north=h,i):new s(a,f,o,h)},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,r){return t.typeOf.number("epsilon",r),n(e)&&Math.abs(this.west-e.west)<=r&&Math.abs(this.south-e.south)<=r&&Math.abs(this.east-e.east)<=r&&Math.abs(this.north-e.north)<=r},s.validate=function(e){t.typeOf.object("rectangle",e);var r=e.north;t.typeOf.number.greaterThanOrEquals("north",r,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("north",r,u.PI_OVER_TWO);var n=e.south;t.typeOf.number.greaterThanOrEquals("south",n,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("south",n,u.PI_OVER_TWO);var i=e.west;t.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),t.typeOf.number.lessThanOrEquals("west",i,Math.PI);var a=e.east;t.typeOf.number.greaterThanOrEquals("east",a,-Math.PI),t.typeOf.number.lessThanOrEquals("east",a,Math.PI)},s.southwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.south,i.height=0,i):new e(r.west,r.south)},s.northwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.north,i.height=0,i):new e(r.west,r.north)},s.northeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.north,i.height=0,i):new e(r.east,r.north)},s.southeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.south,i.height=0,i):new e(r.east,r.south)},s.center=function(r,i){t.typeOf.object("rectangle",r);var a=r.east,o=r.west;a<o&&(a+=u.TWO_PI);var s=u.negativePiToPi(.5*(o+a)),c=.5*(r.south+r.north);return n(i)?(i.longitude=s,i.latitude=c,i.height=0,i):new e(s,c)},s.intersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var a=e.east,o=e.west,c=r.east,l=r.west;a<o&&c>0?a+=u.TWO_PI:c<l&&a>0&&(c+=u.TWO_PI),a<o&&l<0?l+=u.TWO_PI:c<l&&o<0&&(o+=u.TWO_PI);var f=u.negativePiToPi(Math.max(o,l)),h=u.negativePiToPi(Math.min(a,c));if(!((e.west<e.east||r.west<r.east)&&h<=f)){var d=Math.max(e.south,r.south),p=Math.min(e.north,r.north);if(!(d>=p))return n(i)?(i.west=f,i.south=d,i.east=h,i.north=p,i):new s(f,d,h,p)}},s.simpleIntersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var a=Math.max(e.west,r.west),o=Math.max(e.south,r.south),u=Math.min(e.east,r.east),c=Math.min(e.north,r.north);if(!(o>=c||a>=u))return n(i)?(i.west=a,i.south=o,i.east=u,i.north=c,i):new s(a,o,u,c)},s.union=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(i)||(i=new s);var a=e.east,o=e.west,c=r.east,l=r.west;a<o&&c>0?a+=u.TWO_PI:c<l&&a>0&&(c+=u.TWO_PI),a<o&&l<0?l+=u.TWO_PI:c<l&&o<0&&(o+=u.TWO_PI);var f=u.convertLongitudeRange(Math.min(o,l)),h=u.convertLongitudeRange(Math.max(a,c));return i.west=f,i.south=Math.min(e.south,r.south),i.east=h,i.north=Math.max(e.north,r.north),i},s.expand=function(e,r,i){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r),n(i)||(i=new s),i.west=Math.min(e.west,r.longitude),i.south=Math.min(e.south,r.latitude),i.east=Math.max(e.east,r.longitude),i.north=Math.max(e.north,r.latitude),i},s.contains=function(e,r){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r);var n=r.longitude,i=r.latitude,a=e.west,o=e.east;return o<a&&(o+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<o||u.equalsEpsilon(n,o,u.EPSILON14))&&i>=e.south&&i<=e.north};var c=new e;return s.subsample=function(e,i,o,l){t.typeOf.object("rectangle",e),i=r(i,a.WGS84),o=r(o,0),n(l)||(l=[]);var f=0,h=e.north,d=e.south,p=e.east,m=e.west,y=c;y.height=o,y.longitude=m,y.latitude=h,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.longitude=p,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.latitude=d,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.longitude=m,l[f]=i.cartographicToCartesian(y,l[f]),f++,h<0?y.latitude=h:d>0?y.latitude=d:y.latitude=0;for(var E=1;E<8;++E)y.longitude=-Math.PI+E*u.PI_OVER_TWO,s.contains(e,y)&&(l[f]=i.cartographicToCartesian(y,l[f]),f++);return 0===y.latitude&&(y.longitude=m,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.longitude=p,l[f]=i.cartographicToCartesian(y,l[f]),f++),l.length=f,l},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,m=new e,y=new e,E=new e,w=new e,O=new e,_=new e,T=new e,R=new e,g=new e,A=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],O),a=e.clone(n,d),o=e.clone(n,p),u=e.clone(n,m),s=e.clone(n,y),c=e.clone(n,E),l=e.clone(n,w),f=t.length,S=1;S<f;S++){e.clone(t[S],n);var N=n.x,b=n.y,v=n.z;N<a.x&&e.clone(n,a),N>s.x&&e.clone(n,s),b<o.y&&e.clone(n,o),b>c.y&&e.clone(n,c),v<u.z&&e.clone(n,u),v>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,a,_)),I=e.magnitudeSquared(e.subtract(c,o,_)),x=e.magnitudeSquared(e.subtract(l,u,_)),C=a,P=s,U=M;I>U&&(U=I,C=o,P=c),x>U&&(U=x,C=u,P=l);var D=T;D.x=.5*(C.x+P.x),D.y=.5*(C.y+P.y),D.z=.5*(C.z+P.z);var q=e.magnitudeSquared(e.subtract(P,D,_)),F=Math.sqrt(q),L=R;L.x=a.x,L.y=o.y,L.z=u.z;var B=g;B.x=s.x,B.y=c.y,B.z=l.z;var z=e.multiplyByScalar(e.add(L,B,_),.5,A),j=0;for(S=0;S<f;S++){e.clone(t[S],n);var G=e.magnitude(e.subtract(n,z,_));G>j&&(j=G);var W=e.magnitudeSquared(e.subtract(n,D,_));if(W>q){var X=Math.sqrt(W);F=.5*(F+X),q=F*F;var V=X-F;D.x=(F*D.x+V*n.x)/X,D.y=(F*D.y+V*n.y)/X,D.z=(F*D.z+V*n.z)/X}}return F<j?(e.clone(D,r.center),r.radius=F):(e.clone(z,r.center),r.radius=j),r};var S=new o,N=new e,b=new e,v=new t,M=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,S),f.southwest(t,v),v.height=a,f.northeast(t,M),M.height=o;var s=r.project(v,N),c=r.project(M,b),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 m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*p,u};var I=[];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,I)),h.fromPoints(u,o)},h.fromVertices=function(t,a,o,u){if(i(u)||(u=new h),!i(t)||0===t.length)return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,e.ZERO),o=n(o,3),r.typeOf.number.greaterThanOrEquals("stride",o,3);var s=O;s.x=t[0]+a.x,s.y=t[1]+a.y,s.z=t[2]+a.z;for(var c=e.clone(s,d),l=e.clone(s,p),f=e.clone(s,m),S=e.clone(s,y),N=e.clone(s,E),b=e.clone(s,w),v=t.length,M=0;M<v;M+=o){var I=t[M]+a.x,x=t[M+1]+a.y,C=t[M+2]+a.z;s.x=I,s.y=x,s.z=C,I<c.x&&e.clone(s,c),I>S.x&&e.clone(s,S),x<l.y&&e.clone(s,l),x>N.y&&e.clone(s,N),C<f.z&&e.clone(s,f),C>b.z&&e.clone(s,b)}var P=e.magnitudeSquared(e.subtract(S,c,_)),U=e.magnitudeSquared(e.subtract(N,l,_)),D=e.magnitudeSquared(e.subtract(b,f,_)),q=c,F=S,L=P;U>L&&(L=U,q=l,F=N),D>L&&(L=D,q=f,F=b);var B=T;B.x=.5*(q.x+F.x),B.y=.5*(q.y+F.y),B.z=.5*(q.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,_)),j=Math.sqrt(z),G=R;G.x=c.x,G.y=l.y,G.z=f.z;var W=g;W.x=S.x,W.y=N.y,W.z=b.z;var X=e.multiplyByScalar(e.add(G,W,_),.5,A),V=0;for(M=0;M<v;M+=o){s.x=t[M]+a.x,s.y=t[M+1]+a.y,s.z=t[M+2]+a.z;var H=e.magnitude(e.subtract(s,X,_));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(s,B,_));if(Y>z){var k=Math.sqrt(Y);j=.5*(j+k),z=j*j;var Z=k-j;B.x=(j*B.x+Z*s.x)/k,B.y=(j*B.y+Z*s.y)/k,B.z=(j*B.z+Z*s.z)/k}}return j<V?(e.clone(B,u.center),u.radius=j):(e.clone(X,u.center),u.radius=V),u},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=O;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,m),c=e.clone(a,y),l=e.clone(a,E),f=e.clone(a,w),S=t.length,N=0;N<S;N+=3){var b=t[N]+r[N],v=t[N+1]+r[N+1],M=t[N+2]+r[N+2];a.x=b,a.y=v,a.z=M,b<o.x&&e.clone(a,o),b>c.x&&e.clone(a,c),v<u.y&&e.clone(a,u),v>l.y&&e.clone(a,l),M<s.z&&e.clone(a,s),M>f.z&&e.clone(a,f)}var I=e.magnitudeSquared(e.subtract(c,o,_)),x=e.magnitudeSquared(e.subtract(l,u,_)),C=e.magnitudeSquared(e.subtract(f,s,_)),P=o,U=c,D=I;x>D&&(D=x,P=u,U=l),C>D&&(D=C,P=s,U=f);var q=T;q.x=.5*(P.x+U.x),q.y=.5*(P.y+U.y),q.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,q,_)),L=Math.sqrt(F),B=R;B.x=o.x,B.y=u.y,B.z=s.z;var z=g;z.x=c.x,z.y=l.y,z.z=f.z;var j=e.multiplyByScalar(e.add(B,z,_),.5,A),G=0;for(N=0;N<S;N+=3){a.x=t[N]+r[N],a.y=t[N+1]+r[N+1],a.z=t[N+2]+r[N+2];var W=e.magnitude(e.subtract(a,j,_));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(a,q,_));if(X>F){var V=Math.sqrt(X);L=.5*(L+V),F=L*L;var H=V-L;q.x=(L*q.x+H*a.x)/V,q.y=(L*q.y+H*a.y)/V,q.z=(L*q.z+H*a.z)/V}}return L<G?(e.clone(q,n.center),n.radius=L):(e.clone(j,n.center),n.radius=G),n},h.fromCornerPoints=function(t,n,a){r.typeOf.object("corner",t),r.typeOf.object("oppositeCorner",n),i(a)||(a=new h);var o=a.center;return e.add(t,n,o),e.multiplyByScalar(o,.5,o),a.radius=e.distance(o,n),a},h.fromEllipsoid=function(t,n){return r.typeOf.object("ellipsoid",t),i(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var x=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,x)+c.radius)}return r.radius=s,r};var C=new e,P=new e,U=new e;h.fromOrientedBoundingBox=function(t,r){i(r)||(r=new h);var n=t.halfAxes,a=c.getColumn(n,0,C),o=c.getColumn(n,1,P),u=c.getColumn(n,2,U),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,i){r.typeOf.object("value",e),r.defined("array",t),i=n(i,0);var a=e.center;return t[i++]=a.x,t[i++]=a.y,t[i++]=a.z,t[i]=e.radius,t},h.unpack=function(e,t,a){r.defined("array",e),t=n(t,0),i(a)||(a=new h);var o=a.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],a.radius=e[t],a};var D=new e,q=new e;h.union=function(t,n,a){r.typeOf.object("left",t),r.typeOf.object("right",n),i(a)||(a=new h);var o=t.center,u=t.radius,s=n.center,c=n.radius,l=e.subtract(s,o,D),f=e.magnitude(l);if(u>=f+c)return t.clone(a),a;if(c>=f+u)return n.clone(a),a;var d=.5*(u+f+c),p=e.multiplyByScalar(l,(-u+d)/f,q);return e.add(p,o,p),e.clone(p,a.center),a.radius=d,a};var F=new e;h.expand=function(t,n,i){r.typeOf.object("sphere",t),r.typeOf.object("point",n),i=h.clone(t,i);var a=e.magnitude(e.subtract(n,i.center,F));return a>i.radius&&(i.radius=a),i},h.intersectPlane=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("plane",n);var i=t.center,a=t.radius,o=n.normal,s=e.dot(o,i)+n.distance;return s<-a?u.OUTSIDE:s<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),i(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var L=new e;h.distanceSquaredTo=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("cartesian",n);var i=e.subtract(t.center,n,L);return e.magnitudeSquared(i)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),i(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,a,o){r.typeOf.object("sphere",t),r.typeOf.object("position",n),r.typeOf.object("direction",a),i(o)||(o=new s);var u=e.subtract(t.center,n,B),c=e.dot(a,u);return o.start=c-t.radius,o.stop=c+t.radius,o};for(var z=new e,j=new e,G=new e,W=new e,X=new e,V=new t,H=new Array(8),Y=0;Y<8;++Y)H[Y]=new e;var k=new o;return h.projectTo2D=function(t,i,a){r.typeOf.object("sphere",t),i=n(i,k);var o=i.ellipsoid,u=t.center,s=t.radius,c=o.geodeticSurfaceNormal(u,z),l=e.cross(e.UNIT_Z,c,j);e.normalize(l,l);var f=e.cross(c,l,G);e.normalize(f,f),e.multiplyByScalar(c,s,c),e.multiplyByScalar(f,s,f),e.multiplyByScalar(l,s,l);var d=e.negate(f,X),p=e.negate(l,W),m=H,y=m[0];e.add(c,f,y),e.add(y,l,y),y=m[1],e.add(c,f,y),e.add(y,p,y),y=m[2],e.add(c,d,y),e.add(y,p,y),y=m[3],e.add(c,d,y),e.add(y,l,y),e.negate(c,c),y=m[4],e.add(c,f,y),e.add(y,l,y),y=m[5],e.add(c,f,y),e.add(y,p,y),y=m[6],e.add(c,d,y),e.add(y,p,y),y=m[7],e.add(c,d,y),e.add(y,l,y);for(var E=m.length,w=0;w<E;++w){var O=m[w];e.add(u,O,O);var _=o.cartesianToCartographic(O,V);i.project(_,O)}a=h.fromPoints(m,a),u=a.center;var T=u.x,R=u.y,g=u.z;return u.x=g,u.y=T,u.z=R,a},h.isOccluded=function(e,t){return r.typeOf.object("sphere",e),r.typeOf.object("occluder",t),!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/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,n,i,a,o){"use strict";function u(e,r){if(!n(e))throw new a("ellipsoid is required.");this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,n(r)&&(this.cameraPosition=r)}function s(e,r,n){var i=e.transformPositionToScaledSpace(r,p),a=t.magnitudeSquared(i),o=Math.sqrt(a),u=t.divideByScalar(i,o,m);a=Math.max(1,a),o=Math.max(1,o);var s=t.dot(u,n),c=t.magnitude(t.cross(u,n,u)),l=1/o,f=Math.sqrt(a-1)*l;return 1/(s*l-c*f)}function c(e,r,n){if(!(r<=0||r===1/0||r!==r))return t.multiplyByScalar(e,r,n)}function l(e,r){return t.equals(r,t.ZERO)?r:(e.transformPositionToScaledSpace(r,y),t.normalize(y,y))}i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,n=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=t.magnitudeSquared(n)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(r)},u.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared,i=t.subtract(e,r,f),a=-t.dot(i,r),o=n<0?a>0:a>n&&a*a/t.magnitudeSquared(i)>n;return!o},u.prototype.computeHorizonCullingPoint=function(e,r,i){if(!n(e))throw new a("directionToPoint is required");if(!n(r))throw new a("positions is required");n(i)||(i=new t);for(var o=this._ellipsoid,u=l(o,e),f=0,h=0,d=r.length;h<d;++h){var p=r[h],m=s(o,p,u);f=Math.max(f,m)}return c(u,f,i)};var h=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,i,o,u,f){if(!n(e))throw new a("directionToPoint is required");if(!n(i))throw new a("vertices is required");if(!n(o))throw new a("stride is required");n(f)||(f=new t),u=r(u,t.ZERO);for(var d=this._ellipsoid,p=l(d,e),m=0,y=0,E=i.length;y<E;y+=o){h.x=i[y]+u.x,h.y=i[y+1]+u.y,h.z=i[y+2]+u.z;var w=s(d,h,p);m=Math.max(m,w)}return c(p,m,f)};var d=[];u.prototype.computeHorizonCullingPointFromRectangle=function(r,i,u){if(!n(r))throw new a("rectangle is required.");var s=o.subsample(r,i,0,d),c=e.fromPoints(s);if(!(t.magnitude(c.center)<.1*i.minimumRadius))return this.computeHorizonCullingPoint(c.center,s,u)};var p=new t,m=new t,y=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,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}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(r,i){if(!e(r))throw new t("numberOfVertices is required.");return r>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(i):new Uint16Array(i)},a.createTypedArrayFromArrayBuffer=function(r,i,a,o){if(!e(r))throw new t("numberOfVertices is required.");if(!e(i))throw new t("sourceArray is required.");if(!e(a))throw new t("byteOffset is required.");return r>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(i,a,o):new Uint16Array(i,a,o)},r(a)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.clipTriangleAtAxisAlignedThreshold=function(e,n,i,a,o,u){if(!t(e))throw new r("threshold is required.");if(!t(n))throw new r("keepAbove is required.");if(!t(i))throw new r("u0 is required.");if(!t(a))throw new r("u1 is required.");if(!t(o))throw new r("u2 is required.");t(u)?u.length=0:u=[];var s,c,l;n?(s=i<e,c=a<e,l=o<e):(s=i>e,c=a>e,l=o>e);var f,h,d,p,m,y,E=s+c+l;return 1===E?s?(f=(e-i)/(a-i),h=(e-i)/(o-i),u.push(1),u.push(2),1!==h&&(u.push(-1),u.push(0),u.push(2),u.push(h)),1!==f&&(u.push(-1),u.push(0),u.push(1),u.push(f))):c?(d=(e-a)/(o-a),p=(e-a)/(i-a),u.push(2),u.push(0),1!==p&&(u.push(-1),u.push(1),u.push(0),u.push(p)),1!==d&&(u.push(-1),u.push(1),u.push(2),u.push(d))):l&&(m=(e-o)/(i-o),y=(e-o)/(a-o),u.push(0),u.push(1),1!==y&&(u.push(-1),u.push(2),u.push(1),u.push(y)),1!==m&&(u.push(-1),u.push(2),u.push(0),u.push(m))):2===E?s||i===e?c||a===e?l||o===e||(h=(e-i)/(o-i),d=(e-a)/(o-a),u.push(2),u.push(-1),u.push(0),u.push(2),u.push(h),u.push(-1),u.push(1),u.push(2),u.push(d)):(y=(e-o)/(a-o),f=(e-i)/(a-i),u.push(1),u.push(-1),u.push(2),u.push(1),u.push(y),u.push(-1),u.push(0),u.push(1),u.push(f)):(p=(e-a)/(i-a),m=(e-o)/(i-o),u.push(0),u.push(-1),u.push(1),u.push(0),u.push(p),u.push(-1),u.push(2),u.push(0),u.push(m)):3!==E&&(u.push(0),u.push(1),u.push(2)),u},n.computeBarycentricCoordinates=function(n,i,a,o,u,s,c,l,f){if(!t(n))throw new r("x is required.");if(!t(i))throw new r("y is required.");if(!t(a))throw new r("x1 is required.");if(!t(o))throw new r("y1 is required.");if(!t(u))throw new r("x2 is required.");if(!t(s))throw new r("y2 is required.");if(!t(c))throw new r("x3 is required.");if(!t(l))throw new r("y3 is required.");var h=a-c,d=c-u,p=s-l,m=o-l,y=1/(p*h+d*m),E=i-l,w=n-c,O=(p*w+d*E)*y,_=(-m*w+h*E)*y,T=1-O-_;return t(f)?(f.x=O,f.y=_,f.z=T,f):new e(O,_,T)},n}),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,m=d.y,y=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(y,u),l=Math.max(y,l)}var E=n.minimum;E.x=i,E.y=o,E.z=u;var w=n.maximum;w.x=s,w.y=c,w.z=l;var O=e.add(E,w,n.center);return e.multiplyByScalar(O,.5,O),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,a){if(!r(t))throw new n("box is required.");if(!r(a))throw new n("plane is required.");o=e.subtract(t.maximum,t.minimum,o);var u=e.multiplyByScalar(o,.5,o),s=a.normal,c=u.x*Math.abs(s.x)+u.y*Math.abs(s.y)+u.z*Math.abs(s.z),l=e.dot(t.center,s)+a.distance;return l-c>0?i.INSIDE:l+c<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/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(t,r,n){if("number"!=typeof t)throw new e("a is a required number.");if("number"!=typeof r)throw new e("b is a required number.");if("number"!=typeof n)throw new e("c is a required number.");var i=r*r-4*t*n;return i},n.computeRealRoots=function(n,i,a){if("number"!=typeof n)throw new e("a is a required number.");if("number"!=typeof i)throw new e("b is a required number.");if("number"!=typeof a)throw new e("c is a required number.");var o;if(0===n)return 0===i?[]:[-a/i];if(0===i){if(0===a)return[0,0];var u=Math.abs(a),s=Math.abs(n);if(u<s&&u/s<t.EPSILON14)return[0,0];if(u>s&&s/u<t.EPSILON14)return[];if(o=-a/n,o<0)return[];var c=Math.sqrt(o);return[-c,c]}if(0===a)return o=-i/n,o<0?[o,0]:[0,o];var l=i*i,f=4*n*a,h=r(l,-f,t.EPSILON14);if(h<0)return[];var d=-.5*r(i,t.sign(i)*Math.sqrt(h),t.EPSILON14);return i>0?[d/n,a/d]:[a/d,d/n]},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,m=o*c-u*s,y=u*c-d,E=4*p*y-m*m;if(E<0){var w,O,_;h*f>=l*d?(w=o,O=p,_=-2*u*p+o*m):(w=c,O=y,_=-c*m+2*s*y);var T=_<0?-1:1,R=-T*Math.abs(w)*Math.sqrt(-E);a=-_+R;var g=a/2,A=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),S=a===R?-A:-O/A;return i=O<=0?A+S:-_/(A*A+S*S+O),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var N=p,b=-2*u*p+o*m,v=y,M=-c*m+2*s*y,I=Math.sqrt(E),x=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*I,-b)/3);i=2*Math.sqrt(-N);var P=Math.cos(C);a=i*P;var U=i*(-P/2-x*Math.sin(C)),D=a+U>2*u?a-u:U-u,q=o,F=D/q;C=Math.abs(Math.atan2(c*I,-M)/3),i=2*Math.sqrt(-v),P=Math.cos(C),a=i*P,U=i*(-P/2-x*Math.sin(C));var L=-c,B=a+U<2*s?a+s:U+s,z=L/B,j=q*B,G=-D*B-q*L,W=D*L,X=(s*G-u*W)/(-u*G+s*j);return F<=X?F<=z?X<=z?[F,X,z]:[F,z,X]:[z,F,X]:F<=z?[X,F,z]:X<=z?[X,z,F]:[z,X,F]}var n={};return n.computeDiscriminant=function(t,r,n,i){if("number"!=typeof t)throw new e("a is a required number.");if("number"!=typeof r)throw new e("b is a required number.");if("number"!=typeof n)throw new e("c is a required number.");if("number"!=typeof i)throw new e("d is a required number.");var a=t*t,o=r*r,u=n*n,s=i*i,c=18*t*r*n*i+o*u-27*a*s-4*(t*u*n+o*r*i);return c},n.computeRealRoots=function(n,i,a,o){if("number"!=typeof n)throw new e("a is a required number.");if("number"!=typeof i)throw new e("b is a required number.");if("number"!=typeof a)throw new e("c is a required number.");if("number"!=typeof o)throw new e("d is a required number.");var u,s;if(0===n)return t.computeRealRoots(i,a,o);if(0===i){if(0===a){if(0===o)return[0,0,0];s=-o/n;var c=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[c,c,c]}return 0===o?(u=t.computeRealRoots(n,0,a),0===u.Length?[0]:[u[0],0,u[1]]):r(n,0,a,o)}return 0===a?0===o?(s=-i/n,s<0?[s,0,0]:[0,0,s]):r(n,i,0,o):0===o?(u=t.computeRealRoots(n,i,a),0===u.length?[0]:u[1]<=0?[u[0],u[1],0]:u[0]>=0?[0,u[0],u[1]]:[u[0],0,u[1]]):r(n,i,a,o)},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 m,y=p[0],E=p[1];if(y>=0&&E>=0){var w=Math.sqrt(y),O=Math.sqrt(E);return[h-O,h-w,h+w,h+O]}if(y>=0&&E<0)return m=Math.sqrt(y),[h-m,h+m];if(y<0&&E>=0)return m=Math.sqrt(E),[h-m,h+m]}return[]}if(d>0){var _=Math.sqrt(d),T=(s+d-c/_)/2,R=(s+d+c/_)/2,g=n.computeRealRoots(1,_,T),A=n.computeRealRoots(1,-_,R);return 0!==g.length?(g[0]+=h,g[1]+=h,0!==A.length?(A[0]+=h,A[1]+=h,g[1]<=A[0]?[g[0],g[1],A[0],A[1]]:A[1]<=g[0]?[A[0],A[1],g[0],g[1]]:g[0]>=A[0]&&g[1]<=A[1]?[A[0],g[0],g[1],A[1]]:A[0]>=g[0]&&A[1]<=g[1]?[g[0],A[0],A[1],g[1]]:g[0]>A[0]&&g[0]<A[1]?[A[0],g[0],A[1],g[1]]:[g[0],A[0],g[1],A[1]]):g):0!==A.length?(A[0]+=h,A[1]+=h,A):[]}}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,m,y=d[0],E=i-y,w=E*E,O=t/2,_=E/2,T=w-4*o,R=w+4*Math.abs(o),g=c-4*y,A=c+4*Math.abs(y);if(y<0||T*A<g*R){var S=Math.sqrt(g);p=S/2,m=0===S?0:(t*_-a)/S}else{var N=Math.sqrt(T);p=0===N?0:(t*_-a)/N,m=N/2}var b,v;0===O&&0===p?(b=0,v=0):r.sign(O)===r.sign(p)?(b=O+p,v=y/b):(v=O-p,b=y/v);var M,I;0===_&&0===m?(M=0,I=0):r.sign(_)===r.sign(m)?(M=_+m,I=o/M):(I=_-m,M=o/I);var x=n.computeRealRoots(1,b,M),C=n.computeRealRoots(1,v,I);if(0!==x.length)return 0!==C.length?x[1]<=C[0]?[x[0],x[1],C[0],C[1]]:C[1]<=x[0]?[C[0],C[1],x[0],x[1]]:x[0]>=C[0]&&x[1]<=C[1]?[C[0],x[0],x[1],C[1]]:C[0]>=x[0]&&C[1]<=x[1]?[x[0],C[0],C[1],x[1]]:x[0]>C[0]&&x[0]<C[1]?[C[0],x[0],C[1],x[1]]:[x[0],C[0],x[1],C[1]]:x;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,r,n,i,a){if("number"!=typeof e)throw new t("a is a required number.");if("number"!=typeof r)throw new t("b is a required number.");if("number"!=typeof n)throw new t("c is a required number.");if("number"!=typeof i)throw new t("d is a required number.");if("number"!=typeof a)throw new t("e is a required number.");var o=e*e,u=o*e,s=r*r,c=s*r,l=n*n,f=l*n,h=i*i,d=h*i,p=a*a,m=p*a,y=s*l*h-4*c*d-4*e*f*h+18*e*r*n*d-27*o*h*h+256*u*m+a*(18*c*n*i-4*s*f+16*e*l*l-80*e*r*l*i-6*e*s*h+144*o*n*h)+p*(144*e*s*n-27*s*s-128*o*l-192*o*r*i);return y},o.computeRealRoots=function(n,o,u,s,c){if("number"!=typeof n)throw new t("a is a required number.");if("number"!=typeof o)throw new t("b is a required number.");if("number"!=typeof u)throw new t("c is a required number.");if("number"!=typeof s)throw new t("d is a required number.");if("number"!=typeof c)throw new t("e is a required number.");if(Math.abs(n)<r.EPSILON15)return e.computeRealRoots(o,u,s,c);var l=o/n,f=u/n,h=s/n,d=c/n,p=l<0?1:0;switch(p+=f<0?p+1:p,p+=h<0?p+1:p,p+=d<0?p+1:p){case 0:return i(l,f,h,d);case 1:return a(l,f,h,d);case 2:return a(l,f,h,d);case 3:return i(l,f,h,d);case 4:return i(l,f,h,d);case 5:return a(l,f,h,d);case 6:return i(l,f,h,d);case 7:return i(l,f,h,d);case 8:return a(l,f,h,d);case 9:return i(l,f,h,d);case 10:return i(l,f,h,d);case 11:return a(l,f,h,d);case 12:return i(l,f,h,d);case 13:return i(l,f,h,d);case 14:return i(l,f,h,d);case 15:return i(l,f,h,d);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,i,a){if(!r(t))throw new n("ray is requred");if("number"!=typeof i)throw new n("t is a required number");return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,i,a),e.add(t.origin,a,a)},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,w),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,m=f(h,d,p,R);if(n(m))return i.start=m.root0,i.stop=m.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,m=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,E=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),w=a*(i*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),O=[];if(0===w&&0===E){if(l=s.computeRealRoots(p,m,y),0===l.length)return O;var _=l[0],T=Math.sqrt(Math.max(1-_*_,0));if(O.push(new e(i,a*_,a*-T)),O.push(new e(i,a*_,a*T)),2===l.length){var R=l[1],g=Math.sqrt(Math.max(1-R*R,0));O.push(new e(i,a*R,a*-g)),O.push(new e(i,a*R,a*g))}return O}var A=w*w,S=E*E,N=p*p,b=w*E,v=N+S,M=2*(m*p+b),I=2*y*p+m*m-S+A,x=2*(y*m-b),C=y*y-A;if(0===v&&0===M&&0===I&&0===x)return O;l=c.computeRealRoots(v,M,I,x,C);var P=l.length;if(0===P)return O;for(var U=0;U<P;++U){var D,q=l[U],F=q*q,L=Math.max(1-F,0),B=Math.sqrt(L);D=o.sign(p)===o.sign(y)?d(p*F+y,m*q,o.EPSILON12):o.sign(y)===o.sign(m*q)?d(p*F,m*q+y,o.EPSILON12):d(p*F+m*q,y,o.EPSILON12);var z=d(E*q,w,o.EPSILON15),j=D*z;j<0?O.push(new e(i,a*q,a*B)):j>0?O.push(new e(i,a*q,a*-B)):0!==B?(O.push(new e(i,a*q,a*-B)),O.push(new e(i,a*q,a*B)),++U):O.push(new e(i,a*q,a*B))}return O}var m={};m.rayPlane=function(t,r,a){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("plane is required.");n(a)||(a=new e);var u=t.origin,s=t.direction,c=r.normal,l=e.dot(c,s);if(!(Math.abs(l)<o.EPSILON15)){var f=(-r.distance-e.dot(c,u))/l;if(!(f<0))return a=e.multiplyByScalar(s,f,a),e.add(u,a,a)}};var y=new e,E=new e,w=new e,O=new e,_=new e;m.rayTriangleParametric=function(t,a,u,s,c){if(!n(t))throw new i("ray is required.");if(!n(a))throw new i("p0 is required.");if(!n(u))throw new i("p1 is required.");if(!n(s))throw new i("p2 is required.");c=r(c,!1);var l,f,h,d,p,m=t.origin,T=t.direction,R=e.subtract(u,a,y),g=e.subtract(s,a,E),A=e.cross(T,g,w),S=e.dot(R,A);if(c){if(S<o.EPSILON6)return;if(l=e.subtract(m,a,O),h=e.dot(l,A),h<0||h>S)return;if(f=e.cross(l,R,_),d=e.dot(T,f),d<0||h+d>S)return;p=e.dot(g,f)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(l=e.subtract(m,a,O),h=e.dot(l,A)*N,h<0||h>1)return;if(f=e.cross(l,R,_),d=e.dot(T,f)*N,d<0||h+d>1)return;p=e.dot(g,f)*N}return p},m.rayTriangle=function(t,r,i,a,o,u){var s=m.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 T=new l;m.lineSegmentTriangle=function(t,r,a,o,u,s,c){if(!n(t))throw new i("v0 is required.");if(!n(r))throw new i("v1 is required.");if(!n(a))throw new i("p0 is required.");if(!n(o))throw new i("p1 is required.");if(!n(u))throw new i("p2 is required.");var l=T;e.clone(t,l.origin),e.subtract(r,t,l.direction),e.normalize(l.direction,l.direction);var f=m.rayTriangleParametric(l,a,o,u,s);if(!(!n(f)||f<0||f>e.distance(t,r)))return n(c)||(c=new e),e.multiplyByScalar(l.direction,f,c),e.add(l.origin,c,c)};var R={root0:0,root1:0};m.raySphere=function(e,t,r){if(!n(e))throw new i("ray is required.");if(!n(t))throw new i("sphere is required.");if(r=h(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var g=new l;m.lineSegmentSphere=function(t,r,a,o){if(!n(t))throw new i("p0 is required.");if(!n(r))throw new i("p1 is required.");if(!n(a))throw new i("sphere is required.");var u=g;e.clone(t,u.origin);var s=e.subtract(r,t,u.direction),c=e.magnitude(s);if(e.normalize(s,s),o=h(u,a,o),!(!n(o)||o.stop<0||o.start>c))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,c),o};var A=new e,S=new e;m.rayEllipsoid=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var o,u,s,c,l,f=r.oneOverRadii,h=e.multiplyComponents(f,t.origin,A),d=e.multiplyComponents(f,t.direction,S),p=e.magnitudeSquared(h),m=e.dot(h,d);if(p>1){if(m>=0)return;var y=m*m;if(o=p-1,u=e.magnitudeSquared(d),s=u*o,y<s)return;if(y>s){c=m*m-s,l=-m+Math.sqrt(c);var E=l/u,w=o/l;return E<w?new a(E,w):{start:w,stop:E}}var O=Math.sqrt(o/u);return new a(O,O)}return p<1?(o=p-1,u=e.magnitudeSquared(d),s=u*o,c=m*m-s,l=-m+Math.sqrt(c),new a(0,l/u)):m<0?(u=e.magnitudeSquared(d),new a(0,-m/u)):void 0};var N=new e,b=new e,v=new e,M=new e,I=new e,x=new u,C=new u,P=new u,U=new u,D=new u,q=new u,F=new u,L=new e,B=new e,z=new t;m.grazingAltitudeLocation=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var a=t.origin,s=t.direction;if(!e.equals(a,e.ZERO)){var c=r.geodeticSurfaceNormal(a,N);if(e.dot(s,c)>=0)return a}var l=n(this.rayEllipsoid(t,r)),f=r.transformPositionToScaledSpace(s,N),h=e.normalize(f,f),d=e.mostOrthogonalAxis(f,M),m=e.normalize(e.cross(d,h,b),b),y=e.normalize(e.cross(h,m,v),v),E=x;E[0]=h.x,E[1]=h.y,E[2]=h.z,E[3]=m.x,E[4]=m.y,E[5]=m.z,E[6]=y.x,E[7]=y.y,E[8]=y.z;var w=u.transpose(E,C),O=u.fromScale(r.radii,P),_=u.fromScale(r.oneOverRadii,U),T=D;T[0]=0,T[1]=-s.z,T[2]=s.y,T[3]=s.z,T[4]=0,T[5]=-s.x,T[6]=-s.y,T[7]=s.x,T[8]=0;var R,g,A=u.multiply(u.multiply(w,_,q),T,q),S=u.multiply(u.multiply(A,O,F),E,F),j=u.multiplyByVector(A,a,I),G=p(S,e.negate(j,N),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){R=u.multiplyByVector(O,u.multiplyByVector(E,G[H],L),L);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,s);k>V&&(V=k,X=e.clone(R,X))}var Z=r.cartesianToCartographic(X,z);return V=o.clamp(V,0,1),g=e.magnitude(e.subtract(X,a,M))*Math.sqrt(1-V*V),g=l?-g:g,Z.height=g,r.cartographicToCartesian(Z,new e)}};var j=new e;return m.lineSegmentPlane=function(t,r,a,u){if(!n(t))throw new i("endPoint0 is required.");if(!n(r))throw new i("endPoint1 is required.");if(!n(a))throw new i("plane is required.");n(u)||(u=new e);var s=e.subtract(r,t,j),c=a.normal,l=e.dot(c,s);if(!(Math.abs(l)<o.EPSILON6)){var f=e.dot(c,t),h=-(a.distance+f)/l;if(!(h<0||h>1))return e.multiplyByScalar(s,h,u),e.add(t,u,u),u}},m.trianglePlaneIntersection=function(t,r,a,o){if(!(n(t)&&n(r)&&n(a)&&n(o)))throw new i("p0, p1, p2, and plane are required.");var u=o.normal,s=o.distance,c=e.dot(u,t)+s<0,l=e.dot(u,r)+s<0,f=e.dot(u,a)+s<0,h=0;h+=c?1:0,h+=l?1:0,h+=f?1:0;var d,p;if(1!==h&&2!==h||(d=new e,p=new e),1===h){if(c)return m.lineSegmentPlane(t,r,o,d),m.lineSegmentPlane(t,a,o,p),{positions:[t,r,a,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,a,o,d),m.lineSegmentPlane(r,t,o,p),{positions:[t,r,a,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(f)return m.lineSegmentPlane(a,t,o,d),m.lineSegmentPlane(a,r,o,p),{positions:[t,r,a,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!c)return m.lineSegmentPlane(r,t,o,d),m.lineSegmentPlane(a,t,o,p),{positions:[t,r,a,d,p],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(a,r,o,d),m.lineSegmentPlane(t,r,o,p),{positions:[t,r,a,d,p],indices:[2,0,4,2,4,3,1,3,4]};if(!f)return m.lineSegmentPlane(t,a,o,d),m.lineSegmentPlane(r,a,o,p),{positions:[t,r,a,d,p],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 i(n,i){if(!t(n))throw new r("normal is required.");if(!t(i))throw new r("distance is required.");this.normal=e.clone(n),this.distance=i}i.fromPointNormal=function(n,a,o){if(!t(n))throw new r("point is required.");if(!t(a))throw new r("normal is required.");var u=-e.dot(a,n);return t(o)?(e.clone(a,o.normal),o.distance=u,o):new i(a,u)};var a=new e;return i.fromCartesian4=function(n,o){if(!t(n))throw new r("coefficients is required.");var u=e.fromCartesian4(n,a),s=n.w;return t(o)?(e.clone(u,o.normal),o.distance=s,o):new i(u,s)},i.getPointDistance=function(n,i){if(!t(n))throw new r("plane is required.");if(!t(i))throw new r("point is required.");return e.dot(n.normal,i)+n.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 m(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=E,m(l,e),f=l=T,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){m(e)}function s(e){p(e)}var c,l,f,h,d,p,m,y,w,O;if(w=t.length>>>0,c=Math.max(0,Math.min(r,w)),f=[],l=w-c+1,h=[],d=o(),c)for(y=d.progress,m=function(e){h.push(e),--l||(p=m=E,d.reject(h))},p=function(e){f.push(e),--c||(p=m=E,d.resolve(f))},O=0;O<w;++O)O in t&&e(t[O],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,w).then(t,r,n)}function f(){return h(arguments,w)}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=_.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)})})},O.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 m(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 E(){}function w(e){return e}var O,_,T;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(T,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(T,t)})})}},_=[].slice,O=[].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(n,a){if(!t(n))throw new r("identifier is required.");t(i[n])||(i[n]=!0,console.warn(e(a,n)))}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(n,i){if(!e(n)||!e(i))throw new t("identifier and message are required.");r(n,i)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(r,n,i){if(!e(r))throw new t("array is required.");if(!e(n))throw new t("itemToFind is required.");if(!e(i))throw new t("comparator is required.");for(var a,o,u=0,s=r.length-1;u<=s;)if(a=~~((u+s)/2),o=i(r[a],n),o<0)u=a+1;else{if(!(o>0))return a;s=a-1}return~(s+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,m,y,E;if("%%"==e)return"%";for(var w=!1,O="",_=!1,T=!1,R=" ",g=s.length,A=0;s&&A<g;A++)switch(s.charAt(A)){case" ":O=" ";break;case"+":O="+";break;case"-":w=!0;break;case"'":R=s.charAt(A+1);break;case"0":_=!0;break;case"#":T=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,w=!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,E=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(E),w,c,f,_,R);case"c":return u(String.fromCharCode(+E),w,c,f,_);case"b":return o(E,2,T,w,c,f,_);case"o":return o(E,8,T,w,c,f,_);case"x":return o(E,16,T,w,c,f,_);case"X":return o(E,16,T,w,c,f,_).toUpperCase();case"u":return o(E,10,T,w,c,f,_);case"i":case"d":return d=+E||0,d=Math.round(d-d%1),p=d<0?"-":O,E=p+i(String(Math.abs(d)),f,"0",!1),a(E,p,w,c,_);case"e":case"E":case"f":case"F":case"g":case"G":return d=+E,p=d<0?"-":O,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],E=p+Math.abs(d)[m](f),a(E,p,w,c,_)[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(t){if(null===t||isNaN(t))throw new e("year is required and must be a number.");return t%4===0&&t%100!==0||t%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 m.compare(e.julianDate,t.julianDate)}function f(e){O.julianDate=e;var r=m.leapSeconds,n=t(r,O,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=m.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}m.addSeconds(e,i,e)}function h(e,r){O.julianDate=e;var n=m.leapSeconds,i=t(n,O,l);if(i<0&&(i=~i),0===i)return m.addSeconds(e,-n[0].offset,r);if(i>=n.length)return m.addSeconds(e,-n[i-1].offset,r);var a=m.secondsDifference(n[i].julianDate,e);return 0===a?m.addSeconds(e,-n[i].offset,r):a<=1?void 0:m.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 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 i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),n===c.UTC&&f(this)}var y=new a,E=[31,28,31,30,31,30,31,31,30,31,30,31],w=29,O=new u,_=/^(\d{4})$/,T=/^(\d{4})-(\d{2})$/,R=/^(\d{4})-?(\d{3})$/,g=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,A=/^(\d{4})-?(\d{2})-?(\d{2})$/,S=/([Z+\-])?(\d{2})?:?(\d{2})?$/,N=/^(\d{2})(\.\d+)?/.source+S.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+S.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+S.source,M="Invalid ISO 8601 date.";m.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new i("date must be a valid JavaScript Date.");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 m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){if("string"!=typeof e)throw new i(M);e=e.replace(",",".");var r,a,u,s=e.split("T"),l=1,h=1,y=0,O=0,S=0,I=0,x=s[0],C=s[1];if(!n(x))throw new i(M);var P;if(s=x.match(A),null!==s){if(P=x.split("-").length-1,P>0&&2!==P)throw new i(M);r=+s[1],l=+s[2],h=+s[3]}else if(s=x.match(T),null!==s)r=+s[1],l=+s[2];else if(s=x.match(_),null!==s)r=+s[1];else{var U;if(s=x.match(R),null!==s){if(r=+s[1],U=+s[2],u=o(r),U<1||u&&U>366||!u&&U>365)throw new i(M);
}else{if(s=x.match(g),null===s)throw new i(M);r=+s[1];var D=+s[2],q=+s[3]||0;if(P=x.split("-").length-1,P>0&&(!n(s[3])&&1!==P||n(s[3])&&2!==P))throw new i(M);var F=new Date(Date.UTC(r,0,4));U=7*D+q-F.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(U),l=a.getUTCMonth()+1,h=a.getUTCDate()}if(u=o(r),l<1||l>12||h<1||(2!==l||!u)&&h>E[l-1]||u&&2===l&&h>w)throw new i(M);var L;if(n(C)){if(s=C.match(v),null!==s){if(P=C.split(":").length-1,P>0&&2!==P&&3!==P)throw new i(M);y=+s[1],O=+s[2],S=+s[3],I=1e3*+(s[4]||0),L=5}else if(s=C.match(b),null!==s){if(P=C.split(":").length-1,P>2)throw new i(M);y=+s[1],O=+s[2],S=60*+(s[3]||0),L=4}else{if(s=C.match(N),null===s)throw new i(M);y=+s[1],O=60*+(s[2]||0),L=3}if(O>=60||S>=61||y>24||24===y&&(O>0||S>0||I>0))throw new i(M);var B=s[L],z=+s[L+1],j=+(s[L+2]||0);switch(B){case"+":y-=z,O-=j;break;case"-":y+=z,O+=j;break;case"Z":break;default:O+=new Date(Date.UTC(r,l-1,h,y,O)).getTimezoneOffset()}}else O+=new Date(r,l-1,h).getTimezoneOffset();var G=60===S;for(G&&S--;O>=60;)O-=60,y++;for(;y>=24;)y-=24,h++;for(a=u&&2===l?w:E[l-1];h>a;)h-=a,l++,l>12&&(l-=12,r++),a=u&&2===l?w:E[l-1];for(;O<0;)O+=60,y--;for(;y<0;)y+=24,h--;for(;h<1;)l--,l<1&&(l+=12,r--),a=u&&2===l?w:E[l-1],h+=a;var W=p(r,l,h,y,O,S,I);return n(t)?(d(W[0],W[1],t),f(t)):t=new m(W[0],W[1],c.UTC),G&&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){if(!n(e))throw new i("julianDate is required.");var r=!1,o=h(e,I);n(o)||(m.addSeconds(e,-1,I),o=h(I,I),r=!0);var u=o.dayNumber,c=o.secondsOfDay;c>=43200&&(u+=1);var l=u+68569|0,f=4*l/146097|0;l=l-((146097*f+3)/4|0)|0;var d=4e3*(l+1)/1461001|0;l=l-(1461*d/4|0)+31|0;var p=80*l/2447|0,y=l-(2447*p/80|0)|0;l=p/11|0;var E=p+2-12*l|0,w=100*(f-49)+d+l|0,O=c/s.SECONDS_PER_HOUR|0,_=c-O*s.SECONDS_PER_HOUR,T=_/s.SECONDS_PER_MINUTE|0;_-=T*s.SECONDS_PER_MINUTE;var R=0|_,g=(_-R)/s.SECONDS_PER_MILLISECOND;return O+=12,O>23&&(O-=24),r&&(R+=1),n(t)?(t.year=w,t.month=E,t.day=y,t.hour=O,t.minute=T,t.second=R,t.millisecond=g,t.isLeapSecond=r,t):new a(w,E,y,O,T,R,g,r)},m.toDate=function(e){if(!n(e))throw new i("julianDate is required.");var t=m.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))},m.toIso8601=function(t,r){if(!n(t))throw new i("julianDate is required.");var a,o=m.toGregorianDate(t,o);return n(r)||0===o.millisecond?n(r)&&0!==r?(a=(.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,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(a=(.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,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){if(!n(e))throw new i("left is required.");if(!n(t))throw new i("right is required.");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){if(!n(r))throw new i("epsilon is required.");return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){if(!n(e))throw new i("julianDate is required.");return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){if(!n(e))throw new i("left is required.");if(!n(t))throw new i("right is required.");var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){if(!n(e))throw new i("left is required.");if(!n(t))throw new i("right is required.");var r=e.dayNumber-t.dayNumber,a=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+a},m.computeTaiMinusUtc=function(e){O.julianDate=e;var r=m.leapSeconds,n=t(r,O,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){if(!n(e))throw new i("julianDate is required.");if(!n(t))throw new i("seconds is required.");if(!n(r))throw new i("result is required.");return d(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){if(!n(e))throw new i("julianDate is required.");if(!n(t))throw new i("minutes is required.");if(!n(r))throw new i("result is required.");var a=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,a,r)},m.addHours=function(e,t,r){if(!n(e))throw new i("julianDate is required.");if(!n(t))throw new i("hours is required.");if(!n(r))throw new i("result is required.");var a=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,a,r)},m.addDays=function(e,t,r){if(!n(e))throw new i("julianDate is required.");if(!n(t))throw new i("days is required.");if(!n(r))throw new i("result is required.");var a=e.dayNumber+t;return d(a,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 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,n){if(!t(e))throw new r("host is required.");if(!t(n)||n<=0)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(a[i])||(a[i]=!0)},i.remove=function(e,n){if(!t(e))throw new r("host is required.");if(!t(n)||n<=0)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(a[i])&&delete a[i]},i.contains=function(e){if(!t(e))throw new r("url is required.");var i=n(e);return!(!t(i)||!t(a[i]))},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(i){if(i=t(i,t.EMPTY_OBJECT),!r(i.url))throw new n("options.url is required.");var a=i.responseType,o=t(i.method,"GET"),s=i.data,c=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var r=e.defer();return u.load(t,a,o,s,c,r,l),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 i=e[1],a=!!e[2],o=e[3];switch(r){case"":case"text":return s(a,o);case"arraybuffer":return c(a,o);case"blob":var u=c(a,o);return new Blob([u],{type:i});case"document":var l=new DOMParser;return l.parseFromString(s(a,o),i);case"json":return JSON.parse(s(a,o));default:throw new n("Unhandled responseType: "+r)}}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 m in s)s.hasOwnProperty(m)&&p.setRequestHeader(m,s[m]);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(i,o){if(!t(i))throw new r("url is required.");return t(o)?t(o.Accept)||(o=e(o),o.Accept=a.Accept):o=a,n(i,o).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"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<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 y=e._samples=r.samples,E=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var w,O=e._addNewLeapSeconds,_=0,T=y.length;_<T;_+=e._columnCount){var R=y[_+i],g=y[_+m],A=R+l.MODIFIED_JULIAN_DATE_DIFFERENCE,S=new o(A,g,f.TAI);if(E.push(S),O){if(g!==w&&n(w)){var N=o.leapSeconds,b=t(N,S,d);if(b<0){var v=new u(S,g);N.splice(~b,0,v)}}w=g}}}function m(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 E(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 m(e,r,i,s,u),u;if(n.equals(l))return m(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],E=r[d+e._ut1MinusUtcSecondsColumn],w=E-p;if(w>.5||w<-.5){var O=r[h+e._taiMinusUtcSecondsColumn],_=r[d+e._taiMinusUtcSecondsColumn];O!==_&&(l.equals(n)?p=E:E-=_-O)}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,E),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),m=p||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!p&&h.equals(e)&&++s,l=s+1,E(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,E(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(i,a){if(!r(i))throw new n("relative uri is required.");a=t(a,document.location.href);var o=new e(a),u=new e(i);return u.resolve(o).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(i,a,o){if(!r(i))throw new n("first is required");if(!r(a))throw new n("second is required");o=t(o,!0),i instanceof e||(i=new e(i)),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=i.scheme);var u=i;a.isAbsolute()&&(u=a);var s="";r(u.scheme)&&(s+=u.scheme+":"),r(u.authority)&&(s+="//"+u.authority,""!==u.path&&"/"!==u.path&&(s=s.replace(/\/?$/,"/"),u.path=u.path.replace(/^\/?/g,""))),s+=u===i?o?i.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):i.path+a.path:a.path;var c=r(i.query),l=r(a.query);c&&l?s+="?"+i.query+"&"+a.query:c&&!l?s+="?"+i.query:!c&&l&&(s+="?"+a.query);var f=r(a.fragment);return r(i.fragment)&&!f?s+="#"+i.fragment:f&&(s+="#"+a.fragment),s}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 i;if(i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),!t(i))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return f=new e(n(i))}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,m,y=a-s*this._stepSizeDays,E=this._work,w=this._denominators,O=this._coef,_=this._xTable;for(p=0;p<=u;++p)E[p]=y-_[p];for(p=0;p<=u;++p){for(O[p]=1,m=0;m<=u;++m)m!==p&&(O[p]*=E[m]);O[p]*=w[p];var T=3*(s+p);r.x+=O[p]*d[T++],r.y+=O[p]*d[T++],r.s+=O[p]*d[T]}return r}}}},s}),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(T)&&(T=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(T=!0,R=n(e[1]))}return T}function a(){return i()&&R}function o(){if(!t(g)&&(g=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(g=!0,A=n(e[1]))}return g}function u(){return o()&&A}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(S=!0,N=n(e[1]),N.isNightly=!!e[2])}return S}function c(){return s()&&N}function l(){if(!t(b)){b=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(b=!0,v=n(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(b=!0,v=n(e[1])))}return b}function f(){return l()&&v}function h(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(M=!0,I=n(e[1]))}return M}function d(){return h()&&I}function p(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(x=!0,C=n(e[1]))}return x}function m(){return t(P)||(P=/Windows/i.test(_.appVersion)),P}function y(){return p()&&C}function E(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),U}function w(){if(!t(q)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;q=t(r)&&""!==r,q&&(D=r)}return q}function O(){return w()?D:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var T,R,g,A,S,N,b,v,M,I,x,C,P,U,D,q,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:m,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:E,supportsImageRenderingPixelated:w,imageRenderingValue:O};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),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,n){if(!t(e))throw new r("quaternion is required");t(n)||(n=new i);var a=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),u=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),c=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(c,s),n.roll=Math.atan2(u,o),n.pitch=-Math.asin(a),n},i.fromDegrees=function(e,a,o,u){if(!t(e))throw new r("heading is required");if(!t(a))throw new r("pitch is required");if(!t(o))throw new r("roll is required");return t(u)||(u=new i),u.heading=e*n.RADIANS_PER_DEGREE,u.pitch=a*n.RADIANS_PER_DEGREE,u.roll=o*n.RADIANS_PER_DEGREE,u},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(r,i,a){t.typeOf.object("axis",r),t.typeOf.number("angle",i);var o=i/2,u=Math.sin(o);f=e.normalize(r,f);var s=f.x*u,c=f.y*u,h=f.z*u,d=Math.cos(o);return n(a)?(a.x=s,a.y=c,a.z=h,a.w=d,a):new l(s,c,h,d)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,r){t.typeOf.object("matrix",e);var i,a,o,u,s,f=e[c.COLUMN0ROW0],p=e[c.COLUMN1ROW1],m=e[c.COLUMN2ROW2],y=f+p+m;if(y>0)i=Math.sqrt(y+1),s=.5*i,i=.5/i,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*i,o=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*i,u=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*i;else{var E=h,w=0;p>f&&(w=1),m>f&&m>p&&(w=2);var O=E[w],_=E[O];i=Math.sqrt(e[c.getElementIndex(w,w)]-e[c.getElementIndex(O,O)]-e[c.getElementIndex(_,_)]+1);var T=d;T[w]=.5*i,i=.5/i,s=(e[c.getElementIndex(_,O)]-e[c.getElementIndex(O,_)])*i,T[O]=(e[c.getElementIndex(O,w)]+e[c.getElementIndex(w,O)])*i,T[_]=(e[c.getElementIndex(_,w)]+e[c.getElementIndex(w,_)])*i,a=-T[0],o=-T[1],u=-T[2]}return n(r)?(r.x=a,r.y=o,r.z=u,r.w=s,r):new l(a,o,u,s)};var p=new l,m=new l,y=new l,E=new l;l.fromHeadingPitchRoll=function(r,n,a,o){r instanceof u?t.typeOf.object("headingPitchRoll",r):(t.typeOf.number(r,"heading"),t.typeOf.number(n,"pitch"),t.typeOf.number(a,"roll"));var s;return r instanceof u?(s=r,o=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"),s=new u(r,n,a)),E=l.fromAxisAngle(e.UNIT_X,s.roll,p),y=l.fromAxisAngle(e.UNIT_Y,-s.pitch,o),o=l.multiply(y,E,y),m=l.fromAxisAngle(e.UNIT_Z,-s.heading,p),l.multiply(m,o,o)};var w=new e,O=new e,_=new l,T=new l,R=new l;l.packedLength=4,l.pack=function(e,n,i){return t.typeOf.object("value",e),t.defined("array",n),i=r(i,0),n[i++]=e.x,n[i++]=e.y,n[i++]=e.z,n[i]=e.w,n},l.unpack=function(e,i,a){return t.defined("array",e),i=r(i,0),n(a)||(a=new l),a.x=e[i],a.y=e[i+1],a.z=e[i+2],a.w=e[i+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,R),l.conjugate(R,R);for(var i=0,a=r-t+1;i<a;i++){var o=3*i;l.unpack(e,4*(t+i),_),l.multiply(_,R,_),_.w<0&&l.negate(_,_),l.computeAxis(_,w);var u=l.computeAngle(_);n[o]=w.x*u,n[o+1]=w.y*u,n[o+2]=w.z*u}},l.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new l),e.fromArray(t,0,O);var u=e.magnitude(O);return l.unpack(r,4*a,T),0===u?l.clone(l.IDENTITY,_):l.fromAxisAngle(O,u,_),l.multiply(_,T,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,r){return t.typeOf.object("quaternion",e),
t.typeOf.object("result",r),r.x=-e.x,r.y=-e.y,r.z=-e.z,r.w=e.w,r},l.magnitudeSquared=function(e){return t.typeOf.object("quaternion",e),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,r){t.typeOf.object("result",r);var n=1/l.magnitude(e),i=e.x*n,a=e.y*n,o=e.z*n,u=e.w*n;return r.x=i,r.y=a,r.z=o,r.w=u,r},l.inverse=function(e,r){t.typeOf.object("result",r);var n=l.magnitudeSquared(e);return r=l.conjugate(e,r),l.multiplyByScalar(r,1/n,r)},l.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n.x=e.x+r.x,n.y=e.y+r.y,n.z=e.z+r.z,n.w=e.w+r.w,n},l.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n.x=e.x-r.x,n.y=e.y-r.y,n.z=e.z-r.z,n.w=e.w-r.w,n},l.negate=function(e,r){return t.typeOf.object("quaternion",e),t.typeOf.object("result",r),r.x=-e.x,r.y=-e.y,r.z=-e.z,r.w=-e.w,r},l.dot=function(e,r){return t.typeOf.object("left",e),t.typeOf.object("right",r),e.x*r.x+e.y*r.y+e.z*r.z+e.w*r.w},l.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var i=e.x,a=e.y,o=e.z,u=e.w,s=r.x,c=r.y,l=r.z,f=r.w,h=u*s+i*f+a*l-o*c,d=u*c-i*l+a*f+o*s,p=u*l+i*c-a*s+o*f,m=u*f-i*s-a*c-o*l;return n.x=h,n.y=d,n.z=p,n.w=m,n},l.multiplyByScalar=function(e,r,n){return t.typeOf.object("quaternion",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n.x=e.x*r,n.y=e.y*r,n.z=e.z*r,n.w=e.w*r,n},l.divideByScalar=function(e,r,n){return t.typeOf.object("quaternion",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,n.w=e.w/r,n},l.computeAxis=function(e,r){t.typeOf.object("quaternion",e),t.typeOf.object("result",r);var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return r.x=r.y=r.z=0,r;var i=1/Math.sqrt(1-n*n);return r.x=e.x*i,r.y=e.y*i,r.z=e.z*i,r},l.computeAngle=function(e){return t.typeOf.object("quaternion",e),Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var g=new l;l.lerp=function(e,r,n,i){return t.typeOf.object("start",e),t.typeOf.object("end",r),t.typeOf.number("t",n),t.typeOf.object("result",i),g=l.multiplyByScalar(r,n,g),i=l.multiplyByScalar(e,1-n,i),l.add(g,i,i)};var A=new l,S=new l,N=new l;l.slerp=function(e,r,n,i){t.typeOf.object("start",e),t.typeOf.object("end",r),t.typeOf.number("t",n),t.typeOf.object("result",i);var a=l.dot(e,r),o=r;if(a<0&&(a=-a,o=A=l.negate(r,A)),1-a<s.EPSILON6)return l.lerp(e,o,n,i);var u=Math.acos(a);return S=l.multiplyByScalar(e,Math.sin((1-n)*u),S),N=l.multiplyByScalar(o,Math.sin(n*u),N),i=l.add(S,N,i),l.multiplyByScalar(i,1/Math.sin(u),i)},l.log=function(r,n){t.typeOf.object("quaternion",r),t.typeOf.object("result",n);var i=s.acosClamped(r.w),a=0;return 0!==i&&(a=i/Math.sin(i)),e.multiplyByScalar(r,a,n)},l.exp=function(r,n){t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var i=e.magnitude(r),a=0;return 0!==i&&(a=Math.sin(i)/i),n.x=r.x*a,n.y=r.y*a,n.z=r.z*a,n.w=Math.cos(i),n};var b=new e,v=new e,M=new l,I=new l;l.computeInnerQuadrangle=function(r,n,i,a){t.typeOf.object("q0",r),t.typeOf.object("q1",n),t.typeOf.object("q2",i),t.typeOf.object("result",a);var o=l.conjugate(n,M);l.multiply(o,i,I);var u=l.log(I,b);l.multiply(o,r,I);var s=l.log(I,v);return e.add(u,s,u),e.multiplyByScalar(u,.25,u),e.negate(u,u),l.exp(u,M),l.multiply(n,M,a)},l.squad=function(e,r,n,i,a,o){t.typeOf.object("q0",e),t.typeOf.object("q1",r),t.typeOf.object("s0",n),t.typeOf.object("s1",i),t.typeOf.number("t",a),t.typeOf.object("result",o);var u=l.slerp(e,r,a,M),s=l.slerp(n,i,a,I);return l.slerp(u,s,2*a*(1-a),o)};for(var x=new l,C=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],U=a.supportsTypedArrays()?new Float32Array(8):[],D=a.supportsTypedArrays()?new Float32Array(8):[],q=a.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var L=F+1,B=2*L+1;P[F]=1/(L*B),U[F]=L/B}return P[7]=C/136,U[7]=8*C/17,l.fastSlerp=function(e,r,n,i){t.typeOf.object("start",e),t.typeOf.object("end",r),t.typeOf.number("t",n),t.typeOf.object("result",i);var a,o=l.dot(e,r);o>=0?a=1:(a=-1,o=-o);for(var u=o-1,s=1-n,c=n*n,f=s*s,h=7;h>=0;--h)D[h]=(P[h]*c-U[h])*u,q[h]=(P[h]*f-U[h])*u;var d=a*n*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),p=s*(1+q[0]*(1+q[1]*(1+q[2]*(1+q[3]*(1+q[4]*(1+q[5]*(1+q[6]*(1+q[7])))))))),m=l.multiplyByScalar(e,p,x);return l.multiplyByScalar(r,d,i),l.add(m,i,i)},l.fastSquad=function(e,r,n,i,a,o){t.typeOf.object("q0",e),t.typeOf.object("q1",r),t.typeOf.object("s0",n),t.typeOf.object("s1",i),t.typeOf.number("t",a),t.typeOf.object("result",o);var u=l.fastSlerp(e,r,a,M),s=l.fastSlerp(n,i,a,I);return l.fastSlerp(u,s,2*a*(1-a),o)},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,r,i){return t.typeOf.number("epsilon",i),e===r||n(e)&&n(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i&&Math.abs(e.w-r.w)<=i},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,m,y,E,w,O,_){"use strict";var T={},R={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"}},g={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},A={},S={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},N=new r,b=new r,v=new r;T.localFrameToFixedFrameGenerator=function(e,t){if(!R.hasOwnProperty(e)||!R[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,i=R[e][t],a=e+t;return u(A[a])?n=A[a]:(n=function(n,a,s){if(!u(n))throw new c("origin is required.");if(u(s)||(s=new w),y.equalsEpsilon(n.x,0,y.EPSILON14)&&y.equalsEpsilon(n.y,0,y.EPSILON14)){var l=y.sign(n.z);r.unpack(g[e],0,N),"east"!==e&&"west"!==e&&r.multiplyByScalar(N,l,N),r.unpack(g[t],0,b),"east"!==t&&"west"!==t&&r.multiplyByScalar(b,l,b),r.unpack(g[i],0,v),"east"!==i&&"west"!==i&&r.multiplyByScalar(v,l,v)}else{a=o(a,h.WGS84),a.geodeticSurfaceNormal(n,S.up);var f=S.up,d=S.east;d.x=-n.y,d.y=n.x,d.z=0,r.normalize(d,S.east),r.cross(f,d,S.north),r.multiplyByScalar(S.up,-1,S.down),r.multiplyByScalar(S.east,-1,S.west),r.multiplyByScalar(S.north,-1,S.south),N=S[e],b=S[t],v=S[i]}return s[0]=N.x,s[1]=N.y,s[2]=N.z,s[3]=0,s[4]=b.x,s[5]=b.y,s[6]=b.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},A[a]=n),n},T.eastNorthUpToFixedFrame=T.localFrameToFixedFrameGenerator("east","north"),T.northEastDownToFixedFrame=T.localFrameToFixedFrameGenerator("north","east"),T.northUpEastToFixedFrame=T.localFrameToFixedFrameGenerator("north","up"),T.northWestUpToFixedFrame=T.localFrameToFixedFrameGenerator("north","west");var M=new O,I=new r(1,1,1),x=new w;T.headingPitchRollToFixedFrame=function(e,t,n,i,u){a.typeOf.object("HeadingPitchRoll",t),i instanceof w&&(u=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,T.eastNorthUpToFixedFrame);var c=O.fromHeadingPitchRoll(t,M),l=w.fromTranslationQuaternionRotationScale(r.ZERO,c,I,x);return u=i(e,n,u),w.multiply(u,l,u)};var C=new w,P=new E;T.headingPitchRollQuaternion=function(e,t,r,n,i){a.typeOf.object("HeadingPitchRoll",t),n instanceof O&&(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 o=T.headingPitchRollToFixedFrame(e,t,r,n,C),u=w.getRotation(o,P);return O.fromRotationMatrix(u,i)};var U=24110.54841,D=8640184.812866,q=.093104,F=-62e-7,L=1.1772758384668e-19,B=72921158553e-15,z=y.TWO_PI/86400,j=new m;T.computeTemeToPseudoFixedMatrix=function(e,t){if(!u(e))throw new c("date is required.");j=m.addSeconds(e,-m.computeTaiMinusUtc(e),j);var r,n=j.dayNumber,i=j.secondsOfDay,a=n-2451545;r=i>=43200?(a+.5)/_.DAYS_PER_JULIAN_CENTURY:(a-.5)/_.DAYS_PER_JULIAN_CENTURY;var o=U+r*(D+r*(q+r*F)),s=o*z%y.TWO_PI,l=B+L*(n-2451545.5),f=(i+.5*_.SECONDS_PER_DAY)%_.SECONDS_PER_DAY,h=s+l*f,d=Math.cos(h),p=Math.sin(h);return u(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(d,p,0,-p,d,0,0,0,1)},T.iau2006XysData=new d,T.earthOrientationParameters=l.NONE;var G=32.184,W=2451545;T.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+G,i=t.stop.dayNumber,a=t.stop.secondsOfDay+G,o=T.iau2006XysData.preload(r,n,i,a),u=T.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},T.computeIcrfToFixedMatrix=function(e,t){if(!u(e))throw new c("date is required.");u(t)||(t=new E);var r=T.computeFixedToIcrfMatrix(e,t);if(u(r))return E.transpose(r,t)};var X=new p(0,0,0),V=new f(0,0,0,0,0,0),H=new E,Y=new E;T.computeFixedToIcrfMatrix=function(e,t){if(!u(e))throw new c("date is required.");u(t)||(t=new E);var r=T.earthOrientationParameters.compute(e,V);if(u(r)){var n=e.dayNumber,i=e.secondsOfDay+G,a=T.iau2006XysData.computeXysRadians(n,i,X);if(u(a)){var o=a.x+r.xPoleOffset,s=a.y+r.yPoleOffset,l=1/(1+Math.sqrt(1-o*o-s*s)),f=H;f[0]=1-l*o*o,f[3]=-l*o*s,f[6]=o,f[1]=-l*o*s,f[4]=1-l*s*s,f[7]=s,f[2]=-o,f[5]=-s,f[8]=1-l*(o*o+s*s);var h=E.fromRotationZ(-a.s,Y),d=E.multiply(f,h,H),p=e.dayNumber,w=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,O=p-2451545,R=w/_.SECONDS_PER_DAY,g=.779057273264+R+.00273781191135448*(O+R);g=g%1*y.TWO_PI;var A=E.fromRotationZ(g,Y),S=E.multiply(d,A,H),N=Math.cos(r.xPoleWander),b=Math.cos(r.yPoleWander),v=Math.sin(r.xPoleWander),M=Math.sin(r.yPoleWander),I=n-W+i/_.SECONDS_PER_DAY;I/=36525;var x=-47e-6*I*y.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=Y;return U[0]=N*C,U[1]=N*P,U[2]=v,U[3]=-b*P+M*v*C,U[4]=b*C+M*v*P,U[5]=-M*N,U[6]=-M*P-b*v*C,U[7]=M*C-b*v*P,U[8]=b*N,E.multiply(S,U,t)}}};var k=new n;T.pointToWindowCoordinates=function(e,t,r,n){return n=T.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},T.pointToGLWindowCoordinates=function(e,r,i,a){if(!u(e))throw new c("modelViewProjectionMatrix is required.");if(!u(r))throw new c("viewportTransformation is required.");if(!u(i))throw new c("point is required.");u(a)||(a=new t);var o=k;return w.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),w.multiplyByVector(r,o,o),t.fromCartesian4(o,a)};var Z=new r,K=new r,J=new r;T.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!u(e))throw new c("position is required.");if(!u(t))throw new c("velocity is required.");var a=o(n,h.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,a,K);r.equalsEpsilon(s,r.ZERO,y.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var l=r.cross(s,t,J);return r.cross(t,l,s),r.negate(s,s),u(i)||(i=new E),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]=l.x,i[7]=l.y,i[8]=l.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 w,ue=new w;T.basisTo2D=function(e,t,i){if(!u(e))throw new c("projection is required.");if(!u(t))throw new c("matrix is required.");if(!u(i))throw new c("result is required.");var a=e.ellipsoid,o=w.getColumn(t,3,te),s=a.cartesianToCartographic(o,Q),l=T.eastNorthUpToFixedFrame(o,a,oe),f=w.inverseTransformation(l,ue),h=e.project(s,$),d=re;d.x=h.z,d.y=h.x,d.z=h.y,d.w=1;var p=w.getColumn(t,0,ee),m=r.magnitude(p),y=w.multiplyByVector(f,p,ne);n.fromElements(y.z,y.x,y.y,0,y);var E=w.getColumn(t,1,ee),O=r.magnitude(E),_=w.multiplyByVector(f,E,ie);n.fromElements(_.z,_.x,_.y,0,_);var R=w.getColumn(t,2,ee),g=r.magnitude(R),A=ae;return r.cross(y,_,A),r.normalize(A,A),r.cross(_,A,y),r.normalize(y,y),r.cross(A,y,_),r.normalize(_,_),r.multiplyByScalar(y,m,y),r.multiplyByScalar(_,O,_),r.multiplyByScalar(A,g,A),w.setColumn(i,0,y,i),w.setColumn(i,1,_,i),w.setColumn(i,2,A,i),w.setColumn(i,3,d,i),i};var se=new w(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return T.wgs84To2DModelMatrix=function(e,t,r){if(!u(e))throw new c("projection is required.");if(!u(t))throw new c("center is required.");if(!u(r))throw new c("result is required.");var n=e.ellipsoid,i=T.eastNorthUpToFixedFrame(t,n,oe),a=w.inverseTransformation(i,ue),o=n.cartesianToCartographic(t,Q),s=e.project(o,$),l=re;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var f=w.fromTranslation(l,oe);return w.multiply(se,a,r),w.multiply(f,r,r),r},T}),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){if(!a(e))throw new u("origin is required.");if(t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e),!a(e))throw new u("origin must not be at the center of the ellipsoid.");var n=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,m));var o=r.fromCartesian4(l.getColumn(n,2,m));this._plane=f.fromPointNormal(e,o)}var m=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){if(!a(t))throw new u("cartesians is required.");var n=e.fromPoints(t,y);return new p(n.center,r)};var E=new h,w=new r;p.prototype.projectPointOntoPlane=function(e,n){if(!a(e))throw new u("cartesian is required.");var i=E;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,w);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,w)),a(o)){var s=r.subtract(o,this._origin,o),l=r.dot(this._xAxis,s),f=r.dot(this._yAxis,s);return a(n)?(n.x=l,n.y=f,n):new t(l,f)}},p.prototype.projectPointsOntoPlane=function(e,t){if(!a(e))throw new u("cartesians is required.");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){if(!a(e))throw new u("cartesian is required.");a(n)||(n=new t);var i=E;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,w);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,w));var s=r.subtract(o,this._origin,o),l=r.dot(this._xAxis,s),f=r.dot(this._yAxis,s);return n.x=l,n.y=f,n},p.prototype.projectPointsToNearestOnPlane=function(e,t){if(!a(e))throw new u("cartesians is required.");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 O=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){if(!a(e))throw new u("cartesians is required.");var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,s=this._xAxis,c=this._yAxis,l=O,f=0;f<n;++f){var h=e[f];r.multiplyByScalar(s,h.x,l),a(t[f])||(t[f]=new r);var d=r.add(o,l,t[f]);r.multiplyByScalar(c,h.y,l),r.add(d,l,d),i.scaleToGeocentricSurface(d,d)}return t},p}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p){"use strict";function m(e,t){this.center=r.clone(i(e,r.ZERO)),this.halfAxes=h.clone(i(t,h.ZERO))}function y(e,t,n,i,u,s,c,l){if(!(a(t)&&a(n)&&a(i)&&a(u)&&a(s)&&a(c)))throw new o("all extents (minimum/maximum X/Y/Z) are required.");a(l)||(l=new m);var f=l.halfAxes;h.setColumn(f,0,e.xAxis,f),h.setColumn(f,1,e.yAxis,f),h.setColumn(f,2,e.zAxis,f);var d=S;d.x=(t+n)/2,d.y=(i+u)/2,d.z=(s+c)/2;var p=N;p.x=(n-t)/2,p.y=(u-i)/2,p.z=(c-s)/2;var y=l.center;return d=h.multiplyByVector(f,d,d),r.add(e.origin,d,y),h.multiplyByScale(f,p,f),l}var E=new r,w=new r,O=new r,_=new r,T=new r,R=new r,g=new h,A={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(a(t)||(t=new m),!a(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=r.ZERO,t;var n,i=e.length,o=r.clone(e[0],E);for(n=1;n<i;n++)r.add(o,e[n],o);var u=1/i;r.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,d=0,p=0,y=0;for(n=0;n<i;n++)s=r.subtract(e[n],o,w),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,d+=s.y*s.y,p+=s.y*s.z,y+=s.z*s.z;c*=u,l*=u,f*=u,d*=u,p*=u,y*=u;var S=g;S[0]=c,S[1]=l,S[2]=f,S[3]=l,S[4]=d,S[5]=p,S[6]=f,S[7]=p,S[8]=y;var N=h.computeEigenDecomposition(S,A),b=h.clone(N.unitary,t.halfAxes),v=h.getColumn(b,0,_),M=h.getColumn(b,1,T),I=h.getColumn(b,2,R),x=-Number.MAX_VALUE,C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=Number.MAX_VALUE,D=Number.MAX_VALUE,q=Number.MAX_VALUE;for(n=0;n<i;n++)s=e[n],x=Math.max(r.dot(v,s),x),C=Math.max(r.dot(M,s),C),P=Math.max(r.dot(I,s),P),U=Math.min(r.dot(v,s),U),D=Math.min(r.dot(M,s),D),q=Math.min(r.dot(I,s),q);v=r.multiplyByScalar(v,.5*(U+x),v),M=r.multiplyByScalar(M,.5*(D+C),M),I=r.multiplyByScalar(I,.5*(q+P),I);var F=r.add(v,M,t.center);F=r.add(F,I,F);var L=O;return L.x=x-U,L.y=C-D,L.z=P-q,r.multiplyByScalar(L,.5,L),h.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var S=new r,N=new r,b=new n,v=new r,M=[new n,new n,new n,new n,new n,new n,new n,new n],I=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,r,n,c){if(!a(e))throw new o("rectangle is required");if(e.width<0||e.width>f.PI)throw new o("Rectangle width must be between 0 and pi");if(e.height<0||e.height>f.PI)throw new o("Rectangle height must be between 0 and pi");if(a(n)&&!f.equalsEpsilon(n.radii.x,n.radii.y,f.EPSILON15))throw new o("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=i(t,0),r=i(r,0),n=i(n,u.WGS84);var l=p.center(e,b),h=n.cartographicToCartesian(l,v),m=new s(h,n),E=m.plane,w=M[0],O=M[1],_=M[2],T=M[3],R=M[4],g=M[5],A=M[6],S=M[7],N=l.longitude,C=e.south<0&&e.north>0?0:l.latitude;A.latitude=g.latitude=R.latitude=e.south,S.latitude=T.latitude=C,w.latitude=O.latitude=_.latitude=e.north,A.longitude=S.longitude=w.longitude=e.west,g.longitude=O.longitude=N,R.longitude=T.longitude=_.longitude=e.east,_.height=O.height=w.height=S.height=A.height=g.height=R.height=T.height=r,n.cartographicArrayToCartesianArray(M,I),m.projectPointsToNearestOnPlane(I,x);var P=Math.min(x[6].x,x[7].x,x[0].x),U=Math.max(x[2].x,x[3].x,x[4].x),D=Math.min(x[4].y,x[5].y,x[6].y),q=Math.max(x[0].y,x[1].y,x[2].y);_.height=w.height=R.height=A.height=t,n.cartographicArrayToCartesianArray(M,I);var F=Math.min(d.getPointDistance(E,I[0]),d.getPointDistance(E,I[2]),d.getPointDistance(E,I[4]),d.getPointDistance(E,I[6])),L=r;return y(m,P,U,D,q,F,L,c)},m.clone=function(e,t){if(a(e))return a(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){if(!a(e))throw new o("box is required.");if(!a(t))throw new o("plane is required.");var n=e.center,i=t.normal,u=e.halfAxes,s=i.x,l=i.y,f=i.z,d=Math.abs(s*u[h.COLUMN0ROW0]+l*u[h.COLUMN0ROW1]+f*u[h.COLUMN0ROW2])+Math.abs(s*u[h.COLUMN1ROW0]+l*u[h.COLUMN1ROW1]+f*u[h.COLUMN1ROW2])+Math.abs(s*u[h.COLUMN2ROW0]+l*u[h.COLUMN2ROW1]+f*u[h.COLUMN2ROW2]),p=r.dot(i,n)+t.distance;return p<=-d?c.OUTSIDE:p>=d?c.INSIDE:c.INTERSECTING};var C=new r,P=new r,U=new r,D=new r;m.distanceSquaredTo=function(e,t){if(!a(e))throw new o("box is required.");if(!a(t))throw new o("cartesian is required.");var n=r.subtract(t,e.center,S),i=e.halfAxes,u=h.getColumn(i,0,C),s=h.getColumn(i,1,P),c=h.getColumn(i,2,U),l=r.magnitude(u),f=r.magnitude(s),d=r.magnitude(c);r.normalize(u,u),r.normalize(s,s),r.normalize(c,c);var p=D;p.x=r.dot(n,u),p.y=r.dot(n,s),p.z=r.dot(n,c);var m,y=0;return p.x<-l?(m=p.x+l,y+=m*m):p.x>l&&(m=p.x-l,y+=m*m),p.y<-f?(m=p.y+f,y+=m*m):p.y>f&&(m=p.y-f,y+=m*m),p.z<-d?(m=p.z+d,y+=m*m):p.z>d&&(m=p.z-d,y+=m*m),y};var q=new r,F=new r;m.computePlaneDistances=function(e,t,n,i){if(!a(e))throw new o("box is required.");if(!a(t))throw new o("position is required.");if(!a(n))throw new o("direction is required.");a(i)||(i=new l);var u=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=e.center,f=e.halfAxes,d=h.getColumn(f,0,C),p=h.getColumn(f,1,P),m=h.getColumn(f,2,U),y=r.add(d,p,q);r.add(y,m,y),r.add(y,c,y);var E=r.subtract(y,t,F),w=r.dot(n,E);return u=Math.min(w,u),s=Math.max(w,s),r.add(c,d,y),r.add(y,p,y),r.subtract(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.add(c,d,y),r.subtract(y,p,y),r.add(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.add(c,d,y),r.subtract(y,p,y),r.subtract(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.subtract(c,d,y),r.add(y,p,y),r.add(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.subtract(c,d,y),r.add(y,p,y),r.subtract(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.subtract(c,d,y),r.subtract(y,p,y),r.add(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),r.subtract(c,d,y),r.subtract(y,p,y),r.subtract(y,m,y),r.subtract(y,t,E),w=r.dot(n,E),u=Math.min(w,u),s=Math.max(w,s),i.start=u,i.stop=s,i};var L=new e;return m.isOccluded=function(t,r){if(!a(t))throw new o("box is required.");if(!a(r))throw new o("occluder is required.");var n=e.fromOrientedBoundingBox(t,L);return!r.isBoundingSphereVisible(n)},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||a(e)&&a(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/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){if(!t(e))throw new r("value is required.");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;default:throw new r("componentDatatype is not a valid value.")}},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,n){if(!t(e))throw new r("componentDatatype is required.");if(!t(n))throw new r("valuesOrLength is required.");switch(e){case o.BYTE:return new Int8Array(n);case o.UNSIGNED_BYTE:return new Uint8Array(n);case o.SHORT:return new Int16Array(n);case o.UNSIGNED_SHORT:return new Uint16Array(n);case o.INT:return new Int32Array(n);case o.UNSIGNED_INT:return new Uint32Array(n);case o.FLOAT:return new Float32Array(n);case o.DOUBLE:return new Float64Array(n);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(n,i,a,u){if(!t(n))throw new r("componentDatatype is required.");if(!t(i))throw new r("buffer is required.");switch(a=e(a,0),u=e(u,(i.byteLength-a)/o.getSizeInBytes(n)),n){case o.BYTE:return new Int8Array(i,a,u);case o.UNSIGNED_BYTE:return new Uint8Array(i,a,u);case o.SHORT:return new Int16Array(i,a,u);case o.UNSIGNED_SHORT:return new Uint16Array(i,a,u);case o.INT:return new Int32Array(i,a,u);case o.UNSIGNED_INT:return new Uint32Array(i,a,u);case o.FLOAT:return new Float32Array(i,a,u);case o.DOUBLE:return new Float64Array(i,a,u);default:throw new r("componentDatatype is not a valid value.")}},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;default:throw new r("name is not a valid value.")}},i(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,r,n,i,a,o,u,s){"use strict";function c(e,t,n,o,c,h){var y,E,w,O;if(a(e)&&a(t)&&a(n)&&a(o)){var _=e.minimum,T=e.maximum,R=r.subtract(T,_,f),g=n-t,A=Math.max(r.maximumComponent(R),g);y=A<m-1?s.BITS12:s.NONE,E=e.center,w=u.inverseTransformation(o,new u);var S=r.negate(_,l);u.multiply(u.fromTranslation(S,d),w,w);var N=l;N.x=1/R.x,N.y=1/R.y,N.z=1/R.z,u.multiply(u.fromScale(N,d),w,w),O=u.clone(o),u.setTranslation(O,r.ZERO,O),o=u.clone(o,new u);var b=u.fromTranslation(_,d),v=u.fromScale(R,p),M=u.multiply(b,v,d);u.multiply(o,M,o),u.multiply(O,M,O)}this.quantization=y,this.minimumHeight=t,this.maximumHeight=n,this.center=E,this.toScaledENU=w,this.fromScaledENU=o,this.matrix=O,this.hasVertexNormals=c,this.hasWebMercatorT=i(h,!1)}var l=new r,f=new r,h=new t,d=new u,p=new u,m=Math.pow(2,12);c.prototype.encode=function(n,i,a,c,f,d,p){var m=c.x,y=c.y;if(this.quantization===s.BITS12){a=u.multiplyByPoint(this.toScaledENU,a,l),a.x=o.clamp(a.x,0,1),a.y=o.clamp(a.y,0,1),a.z=o.clamp(a.z,0,1);var E=this.maximumHeight-this.minimumHeight,w=o.clamp((f-this.minimumHeight)/E,0,1);t.fromElements(a.x,a.y,h);var O=e.compressTextureCoordinates(h);t.fromElements(a.z,w,h);var _=e.compressTextureCoordinates(h);t.fromElements(m,y,h);var T=e.compressTextureCoordinates(h);if(n[i++]=O,n[i++]=_,n[i++]=T,this.hasWebMercatorT){t.fromElements(p,0,h);var R=e.compressTextureCoordinates(h);n[i++]=R}}else r.subtract(a,this.center,l),n[i++]=l.x,n[i++]=l.y,n[i++]=l.z,n[i++]=f,n[i++]=m,n[i++]=y,this.hasWebMercatorT&&(n[i++]=p);return this.hasVertexNormals&&(n[i++]=e.octPackFloat(d)),i},c.prototype.decodePosition=function(t,n,i){if(a(i)||(i=new r),n*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[n],h);i.x=o.x,i.y=o.y;var c=e.decompressTextureCoordinates(t[n+1],h);return i.z=c.x,u.multiplyByPoint(this.fromScaledENU,i,i)}return i.x=t[n],i.y=t[n+1],i.z=t[n+2],r.add(i,this.center,i)},c.prototype.decodeTextureCoordinates=function(r,n,i){return a(i)||(i=new t),n*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(r[n+2],i):t.fromElements(r[n+4],r[n+5],i)},c.prototype.decodeHeight=function(t,r){if(r*=this.getStride(),this.quantization===s.BITS12){var n=e.decompressTextureCoordinates(t[r+1],h);return n.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[r+3]},c.prototype.getOctEncodedNormal=function(e,r,n){var i=this.getStride();r=(r+1)*i-1;var a=e[r]/256,o=Math.floor(a),u=256*(a-o);return t.fromElements(o,u,n)},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 y={position3DAndHeight:0,textureCoordAndEncodedNormals:1},E={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,r=n.FLOAT,i=n.getSizeInBytes(r);if(this.quantization===s.NONE){var a=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(a+o)*i,[{index:y.position3DAndHeight,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:y.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:o,offsetInBytes:a*i,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*i,[{index:E.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:E.compressed1,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:c,offsetInBytes:u*i,strideInBytes:t}]):[{index:E.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?y:E},c.clone=function(e,t){return a(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=r.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 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(u){var s=u.data;a.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.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)),s.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}),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,r,n,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,r){var i=e.isEastChild,a=e.isNorthChild,d=i?O:0,p=i?w:O,y=a?O:0,D=a?w:O,q=S,F=N,L=b,B=M;q.length=0,F.length=0,L.length=0,B.length=0;var z=v;z.length=0;var j={},G=e.vertices,W=e.indices;W=W.subarray(0,e.skirtIndex);
var X,V,H,Y=h.clone(e.encoding),k=Y.hasVertexNormals,Z=e.exaggeration,K=0,J=e.vertexCountWithoutSkirts,Q=e.minimumHeight,$=e.maximumHeight,ee=new Array(J),te=new Array(J),re=new Array(J),ne=k?new Array(2*J):void 0,ie=20;for(V=0,H=0;V<J;++V,H+=2){var ae=Y.decodeTextureCoordinates(G,V,P);if(X=Y.decodeHeight(G,V)/Z,ee[V]=l.clamp(ae.x*w|0,0,w),te[V]=l.clamp(ae.y*w|0,0,w),re[V]=l.clamp((X-Q)/($-Q)*w|0,0,w),ee[V]<ie&&(ee[V]=0),te[V]<ie&&(te[V]=0),w-ee[V]<ie&&(ee[V]=w),w-te[V]<ie&&(te[V]=w),k){var oe=Y.getOctEncodedNormal(G,V,U);ne[H]=oe.x,ne[H+1]=oe.y}}var ue,se;for(V=0,H=0;V<J;++V,H+=2)ue=ee[V],se=te[V],(i&&ue>=O||!i&&ue<=O)&&(a&&se>=O||!a&&se<=O)&&(j[V]=K,q.push(ue),F.push(se),L.push(re[V]),k&&(B.push(ne[H]),B.push(ne[H+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 fe,he;for(V=0;V<W.length;V+=3){var de=W[V],pe=W[V+1],me=W[V+2],ye=ee[de],Ee=ee[pe],we=ee[me];ce[0].initializeIndexed(ee,te,re,ne,de),ce[1].initializeIndexed(ee,te,re,ne,pe),ce[2].initializeIndexed(ee,te,re,ne,me);var Oe=c.clipTriangleAtAxisAlignedThreshold(O,i,ye,Ee,we,_);fe=0,fe>=Oe.length||(fe=le[0].initializeFromClipResult(Oe,fe,ce),fe>=Oe.length||(fe=le[1].initializeFromClipResult(Oe,fe,ce),fe>=Oe.length||(fe=le[2].initializeFromClipResult(Oe,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(O,a,le[0].getV(),le[1].getV(),le[2].getV(),T),E(q,F,L,B,z,j,he,le,k),fe<Oe.length&&(le[2].clone(le[1]),le[2].initializeFromClipResult(Oe,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(O,a,le[0].getV(),le[1].getV(),le[2].getV(),T),E(q,F,L,B,z,j,he,le,k)))))}var _e=i?-w:0,Te=a?-w:0,Re=[],ge=[],Ae=[],Se=[],Ne=Number.MAX_VALUE,be=-Ne,ve=R;ve.length=0;var Me=o.clone(e.ellipsoid),Ie=e.childRectangle,xe=Ie.north,Ce=Ie.south,Pe=Ie.east,Ue=Ie.west;for(Pe<Ue&&(Pe+=l.TWO_PI),V=0;V<q.length;++V)ue=Math.round(q[V]),ue<=d?(Re.push(V),ue=0):ue>=p?(Ae.push(V),ue=w):ue=2*ue+_e,q[V]=ue,se=Math.round(F[V]),se<=y?(ge.push(V),se=0):se>=D?(Se.push(V),se=w):se=2*se+Te,F[V]=se,X=l.lerp(Q,$,L[V]/w),X<Ne&&(Ne=X),X>be&&(be=X),L[V]=X,g.longitude=l.lerp(Ue,Pe,ue/w),g.latitude=l.lerp(Ce,xe,se/w),g.height=X,Me.cartographicToCartesian(g,A),ve.push(A.x),ve.push(A.y),ve.push(A.z);var De=t.fromVertices(ve,n.ZERO,3,x),qe=f.fromRectangle(Ie,Ne,be,Me,C),Fe=new u(Me),Le=Fe.computeHorizonCullingPointFromVertices(De.center,ve,3,De.center,I),Be=be-Ne,ze=new Uint16Array(q.length+F.length+L.length);for(V=0;V<q.length;++V)ze[V]=q[V];var je=q.length;for(V=0;V<F.length;++V)ze[je+V]=F[V];for(je+=F.length,V=0;V<L.length;++V)ze[je+V]=w*(L[V]-Ne)/Be;var Ge,We=s.createTypedArray(q.length,z);if(k){var Xe=new Uint8Array(B);r.push(ze.buffer,We.buffer,Xe.buffer),Ge=Xe.buffer}else r.push(ze.buffer,We.buffer);return{vertices:ze.buffer,encodedNormals:Ge,indices:We.buffer,minimumHeight:Ne,maximumHeight:be,westIndices:Re,southIndices:ge,eastIndices:Ae,northIndices:Se,boundingSphere:De,orientedBoundingBox:qe,horizonOcclusionPoint:Le}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function y(t,r){++q;var i=F[q],a=L[q];return i=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),i),a=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),a),A=n.lerp(i,a,t.ratio,A),n.normalize(A,A),e.octEncode(A,r),--q,r}function E(e,t,r,n,i,o,u,s,c){if(0!==u.length){for(var l=0,f=0;f<u.length;)f=B[l++].initializeFromClipResult(u,f,s);for(var h=0;h<l;++h){var d=B[h];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=e,d.vBuffer=t,d.heightBuffer=r,c&&(d.normalBuffer=n);else{var p=d.getKey();if(a(o[p]))d.newIndex=o[p];else{var m=e.length;e.push(d.getU()),t.push(d.getV()),r.push(d.getH()),c&&(n.push(d.getNormalX()),n.push(d.getNormalY())),d.newIndex=m,o[p]=m}}}3===l?(i.push(B[0].newIndex),i.push(B[1].newIndex),i.push(B[2].newIndex)):4===l&&(i.push(B[0].newIndex),i.push(B[1].newIndex),i.push(B[2].newIndex),i.push(B[0].newIndex),i.push(B[2].newIndex),i.push(B[3].newIndex))}}var w=32767,O=w/2|0,_=[],T=[],R=[],g=new i,A=new n,S=[],N=[],b=[],v=[],M=[],I=new n,x=new t,C=new f,P=new r,U=new n;m.prototype.clone=function(e){return a(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,r,n,i){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=r,this.normalBuffer=n,this.index=i,this.first=void 0,this.second=void 0,this.ratio=void 0},m.prototype.initializeFromClipResult=function(e,t,r){var n=t+1;return e[t]!==-1?r[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=r[e[n]],++n,this.second=r[e[n]],++n,this.ratio=e[n],++n),n},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 a(this.index)},m.prototype.getH=function(){return a(this.index)?this.heightBuffer[this.index]:l.lerp(this.first.getH(),this.second.getH(),this.ratio)},m.prototype.getU=function(){return a(this.index)?this.uBuffer[this.index]:l.lerp(this.first.getU(),this.second.getU(),this.ratio)},m.prototype.getV=function(){return a(this.index)?this.vBuffer[this.index]:l.lerp(this.first.getV(),this.second.getV(),this.ratio)};var D=new r,q=-1,F=[new n,new n],L=[new n,new n];m.prototype.getNormalX=function(){return a(this.index)?this.normalBuffer[2*this.index]:(D=y(this,D),D.x)},m.prototype.getNormalY=function(){return a(this.index)?this.normalBuffer[2*this.index+1]:(D=y(this,D),D.y)};var B=[];return B.push(new m),B.push(new m),B.push(new m),B.push(new m),d(p)})}();