/** * 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(r){t=r.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),n>=r)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),n>r)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.typeOf.number.equals=function(e,r,n,o){if(i.typeOf.number(e,n),i.typeOf.number(r,o),n!==o)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+o)},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&&null!==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>>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>>1^t[1&e];for(;r>>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","./Check","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n,i){"use strict";var o={};o.Radious=6378137,o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13,o.EPSILON14=1e-14,o.EPSILON15=1e-15,o.EPSILON16=1e-16,o.EPSILON17=1e-17,o.EPSILON18=1e-18,o.EPSILON19=1e-19,o.EPSILON20=1e-20,o.EPSILON21=1e-21,o.GRAVITATIONALPARAMETER=3986004418e5,o.SOLAR_RADIUS=6955e5,o.LUNAR_RADIUS=1737400,o.SIXTY_FOUR_KILOBYTES=65536,o.sign=r(Math.sign,function(e){return e=+e,0===e||e!==e?e:e>0?1:-1}),o.signNotZero=function(e){return 0>e?-1:1},o.toSNorm=function(e,t){return t=r(t,255),Math.round((.5*o.clamp(e,-1,1)+.5)*t)},o.fromSNorm=function(e,t){return t=r(t,255),o.clamp(e,0,t)/t*2-1},o.sinh=r(Math.sinh,function(e){return(Math.exp(e)-Math.exp(-e))/2}),o.cosh=r(Math.cosh,function(e){return(Math.exp(e)+Math.exp(-e))/2}),o.lerp=function(e,t,r){return(1-r)*e+r*t},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=Math.PI/2,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI/2,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(e){if(!n(e))throw new i("degrees is required.");return e*o.RADIANS_PER_DEGREE},o.toDegrees=function(e){if(!n(e))throw new i("radians is required.");return e*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(e){if(!n(e))throw new i("angle is required.");var t=o.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},o.clampToLatitudeRange=function(e){if(!n(e))throw new i("angle is required.");return o.clamp(e,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(e){if(!n(e))throw new i("angle is required.");return o.zeroToTwoPi(e+o.PI)-o.PI},o.zeroToTwoPi=function(e){if(!n(e))throw new i("angle is required.");var t=o.mod(e,o.TWO_PI);return Math.abs(t)o.EPSILON14?o.TWO_PI:t},o.mod=function(e,t){if(!n(e))throw new i("m is required.");if(!n(t))throw new i("n is required.");return(e%t+t)%t},o.equalsEpsilon=function(e,t,o,a){if(!n(e))throw new i("left is required.");if(!n(t))throw new i("right is required.");if(!n(o))throw new i("relativeEpsilon is required.");a=r(a,o);var u=Math.abs(e-t);return a>=u||u<=o*Math.max(Math.abs(e),Math.abs(t))},o.lessThan=function(e,t,r){if(!n(e))throw new i("first is required.");if(!n(t))throw new i("second is required.");if(!n(r))throw new i("relativeEpsilon is required.");return-r>e-t},o.lessThanOrEquals=function(e,t,r){if(!n(e))throw new i("first is required.");if(!n(t))throw new i("second is required.");if(!n(r))throw new i("relativeEpsilon is required.");return r>e-t},o.greaterThan=function(e,t,r){if(!n(e))throw new i("first is required.");if(!n(t))throw new i("second is required.");if(!n(r))throw new i("relativeEpsilon is required.");return e-t>r},o.greaterThanOrEquals=function(e,t,r){if(!n(e))throw new i("first is required.");if(!n(t))throw new i("second is required.");if(!n(r))throw new i("relativeEpsilon is required.");return e-t>-r};var a=[1];o.factorial=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");var t=a.length;if(e>=t)for(var r=a[t-1],n=t;e>=n;n++)a.push(r*n);return a[e]},o.incrementWrap=function(e,t,o){if(o=r(o,0),!n(e))throw new i("n is required.");if(o>=t)throw new i("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=o),e},o.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},o.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("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},o.clamp=function(e,t,r){if(!n(e))throw new i("value is required");if(!n(t))throw new i("min is required.");if(!n(r))throw new i("max is required.");return t>e?t:e>r?r:e};var u=new e;return o.setRandomNumberSeed=function(t){if(!n(t))throw new i("seed is required.");u=new e(t)},o.nextRandomNumber=function(){return u.random()},o.randomBetween=function(e,t){return o.nextRandomNumber()*(t-e)+e},o.acosClamped=function(e){if(!n(e))throw new i("value is required.");return Math.acos(o.clamp(e,-1,1))},o.asinClamped=function(e){if(!n(e))throw new i("value is required.");return Math.asin(o.clamp(e,-1,1))},o.chordLength=function(e,t){if(!n(e))throw new i("angle is required.");if(!n(t))throw new i("radius is required.");return 2*t*Math.sin(.5*e)},o.logBase=function(e,t){if(!n(e))throw new i("number is required.");if(!n(t))throw new i("base is required.");return Math.log(e)/Math.log(t)},o.cbrt=r(Math.cbrt,function(e){var t=Math.pow(Math.abs(e),1/3);return 0>e?-t:t}),o.log2=r(Math.log2,function(e){return Math.log(e)*Math.LOG2E}),o.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},o.fastApproximateAtan=function(e){return t.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},o.fastApproximateAtan2=function(e,r){t.typeOf.number("x",e),t.typeOf.number("y",r);var n,a,u=Math.abs(e);n=Math.abs(r),a=Math.max(u,n),n=Math.min(u,n);var s=n/a;if(isNaN(s))throw new i("either x or y must be nonzero");return u=o.fastApproximateAtan(s),u=Math.abs(r)>Math.abs(e)?o.PI_OVER_TWO-u:u,u=0>e?o.PI-u:u,u=0>r?-u:u},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,o){"use strict";function a(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}a.fromSpherical=function(n,i){e.typeOf.object("spherical",n),r(i)||(i=new a);var o=n.clock,u=n.cone,s=t(n.magnitude,1),c=s*Math.sin(u);return i.x=c*Math.cos(o),i.y=c*Math.sin(o),i.z=s*Math.cos(u),i},a.fromElements=function(e,t,n,i){return r(i)?(i.x=e,i.y=t,i.z=n,i):new a(e,t,n)},a.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.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},a.unpack=function(n,i,o){return e.defined("array",n),i=t(i,0),r(o)||(o=new a),o.x=n[i++],o.y=n[i++],o.z=n[i],o},a.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 o=0;i>o;++o)a.pack(t[o],n,3*o);return n},a.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 o=t.length;r(i)?i.length=o/3:i=new Array(o/3);for(var u=0;o>u;u+=3){var s=u/3;i[s]=a.unpack(t,u,i[s])}return i},a.fromArray=a.unpack,a.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},a.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},a.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},a.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var u=new a;a.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitude(u)},a.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitudeSquared(u)},a.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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 a;a.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),a.multiplyByScalar(r,n,s),i=a.multiplyByScalar(t,1-n,i),a.add(s,i,i)};var c=new a,l=new a;a.angleBetween=function(t,r){e.typeOf.object("left",t),e.typeOf.object("right",r),a.normalize(t,c),a.normalize(r,l);var n=a.dot(c,l),i=a.magnitude(a.cross(c,l,c));return Math.atan2(i,n)};var f=new a;a.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=a.normalize(t,f);return a.abs(n,n),r=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,r):a.clone(a.UNIT_Z,r):n.y<=n.z?a.clone(a.UNIT_Y,r):a.clone(a.UNIT_Z,r)},a.projectVector=function(t,r,n){e.defined("a",t),e.defined("b",r),e.defined("result",n);var i=a.dot(t,r)/a.dot(r,r);return a.multiplyByScalar(r,i,n)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},a.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,n,i)&&o.equalsEpsilon(e.y,t.y,n,i)&&o.equalsEpsilon(e.z,t.z,n,i)},a.cross=function(t,r,n){e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n);var i=t.x,o=t.y,a=t.z,u=r.x,s=r.y,c=r.z,l=o*c-a*s,f=a*u-i*c,p=i*s-o*u;return n.x=l,n.y=f,n.z=p,n},a.midpoint=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=.5*(t.x+r.x),n.y=.5*(t.y+r.y),n.z=.5*(t.z+r.z),n},a.fromDegrees=function(t,r,n,i,u){return e.typeOf.number("longitude",t),e.typeOf.number("latitude",r),t=o.toRadians(t),r=o.toRadians(r),a.fromRadians(t,r,n,i,u)};var p=new a,d=new a,h=(new a(40680631590769,40680631590769,40408299984661.445),new a(40680631590769,40680631590769,40680631590769));return a.fromRadians=function(n,i,o,u,s){e.typeOf.number("longitude",n),e.typeOf.number("latitude",i),o=t(o,0);var c=r(u)?u.radiiSquared:h,l=Math.cos(i);p.x=l*Math.cos(n),p.y=l*Math.sin(n),p.z=Math.sin(i),p=a.normalize(p,p),a.multiplyComponents(c,p,d);var f=Math.sqrt(a.dot(p,d));return d=a.divideByScalar(d,f,d),p=a.multiplyByScalar(p,o,p),r(s)||(s=new a),a.add(d,p,s)},a.fromDegreesArray=function(t,i,o){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(o)?o.length=u/2:o=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],l=t[s+1],f=s/2;o[f]=a.fromDegrees(c,l,0,i,o[f])}return o},a.fromRadiansArray=function(t,i,o){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(o)?o.length=u/2:o=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],l=t[s+1],f=s/2;o[f]=a.fromRadians(c,l,0,i,o[f])}return o},a.fromDegreesArrayHeights=function(t,i,o){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(o)?o.length=u/3:o=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],l=t[s+1],f=t[s+2],p=s/3;o[p]=a.fromDegrees(c,l,f,i,o[p])}return o},a.fromRadiansArrayHeights=function(t,i,o){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(o)?o.length=u/3:o=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],l=t[s+1],f=t[s+2],p=s/3;o[p]=a.fromRadians(c,l,f,i,o[p])}return o},a.ZERO=i(new a(0,0,0)),a.UNIT_X=i(new a(1,0,0)),a.UNIT_Y=i(new a(0,1,0)),a.UNIT_Z=i(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/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/arrayFill",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function n(n,i,o,a){if(e.defined("array",n),e.defined("value",i),r(o)&&e.typeOf.number("start",o),r(a)&&e.typeOf.number("end",a),"function"==typeof n.fill)return n.fill(i,o,a);for(var u=n.length>>>0,s=t(o,0),c=0>s?Math.max(u+s,0):Math.min(s,u),l=t(a,u),f=0>l?Math.max(u+l,0):Math.min(l,u);f>c;)n[c]=i,c++;return n}return n}),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,p=i.y,d=i.z,h=u.x,y=u.y,m=u.z,E=f*f*h*h,O=p*p*y*y,v=d*d*m*m,_=E+O+v,w=Math.sqrt(1/_),T=e.multiplyByScalar(i,w,o);if(c>_)return isFinite(w)?e.clone(T,l):void 0;var b=s.x,A=s.y,g=s.z,R=a;R.x=T.x*b*2,R.y=T.y*A*2,R.z=T.z*g*2;var S,N,I,x,M,C,P,D,U,L,q,F=(1-w)*e.magnitude(i)/(.5*e.magnitude(R)),j=0;do{F-=j,I=1/(1+F*b),x=1/(1+F*A),M=1/(1+F*g),C=I*I,P=x*x,D=M*M,U=C*I,L=P*x,q=D*M,S=E*C+O*P+v*D-1,N=E*U*b+O*L*A+v*q*g;var B=-2*N;j=S/B}while(Math.abs(S)>n.EPSILON12);return t(l)?(l.x=f*I,l.y=p*x,l.z=d*M,l):new e(f*I,p*x,d*M)}var o=new e,a=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,o,a){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,i,o,a){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",i),o=r(o,0),n(a)?(a.longitude=e,a.latitude=i,a.height=o,a):new u(e,i,o)},u.fromDegrees=function(e,r,n,i){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",r),e=o.toRadians(e),r=o.toRadians(r),u.fromRadians(e,r,n,i)};var s=new e,c=new e,l=new e,f=(new e(1/6378137,1/6378137,1/6356752.314245179),new e(1/6378137,1/6378137,1/6378137)),p=(new e(1/40680631590769,1/40680631590769,1/40408299984661.445),new e(1/40680631590769,1/40680631590769,1/40680631590769)),d=o.EPSILON1;return u.fromCartesian=function(t,r,i){var h=n(r)?r.oneOverRadii:f,y=n(r)?r.oneOverRadiiSquared:p,m=n(r)?r._centerToleranceSquared:d,E=a(t,h,y,m,c);if(n(E)){var O=e.multiplyComponents(E,y,s);O=e.normalize(O,O);var v=e.subtract(t,E,l),_=Math.atan2(O.y,O.x),w=Math.asin(O.z),T=o.sign(e.dot(v,t))*e.magnitude(v);return n(i)?(i.longitude=_,i.latitude=w,i.height=T,i):new u(_,w,T)}},u.toCartesian=function(r,n,i){return t.defined("cartographic",r),e.fromRadians(r.longitude,r.latitude,r.height,n,i)},u.sphericalDistance=function(e,r,n,i){if(t.defined("longitudeA",e),t.defined("longitudeB",n),t.defined("latitudeA",r),t.defined("latitudeB",i),e===n&&r===i)return 0;var a=o.toRadians(r),u=o.toRadians(i),s=o.toRadians(e),c=o.toRadians(n),l=s*s+a*a,f=c*c+u*u,p=(s-c)*(s-c)+(a-u)*(a-u),d=(l+f-p)/(2*Math.sqrt(l)*Math.sqrt(f));return d=o.clamp(d,-1,1),Math.acos(d)*o.Radious},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,r,i){return t.typeOf.number("epsilon",i),e===r||n(e)&&n(r)&&Math.abs(e.longitude-r.longitude)<=i&&Math.abs(e.latitude-r.latitude)<=i&&Math.abs(e.height-r.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/Ellipsoid",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,o,a,u,s,c){"use strict";function l(t,i,o,a){i=n(i,0),o=n(o,0),a=n(a,0),s.equalsEpsilon(a,6378137,s.EPSILON10)&&(s.Radious=a),r.typeOf.number.greaterThanOrEquals("x",i,0),r.typeOf.number.greaterThanOrEquals("y",o,0),r.typeOf.number.greaterThanOrEquals("z",a,0),t._radii=new e(i,o,a),t._radiiSquared=new e(i*i,o*o,a*a),t._radiiToTheFourth=new e(i*i*i*i,o*o*o*o,a*a*a*a),t._oneOverRadii=new e(0===i?0:1/i,0===o?0:1/o,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===i?0:1/(i*i),0===o?0:1/(o*o),0===a?0:1/(a*a)),t._minimumRadius=Math.min(i,o,a),t._maximumRadius=Math.max(i,o,a),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function f(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._squaredXOverSquaredZ=void 0,l(this,e,t,r)}o(f.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}}}),f.clone=function(t,r){if(i(t)){var n=t._radii;return i(r)?(e.clone(n,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new f(n.x,n.y,n.z)}},f.fromCartesian3=function(e,t){return i(t)||(t=new f),i(e)?(l(t,e.x,e.y,e.z),t):t},f.WGS84=u(new f(6378137,6378137,s.Radious)),f.UNIT_SPHERE=u(new f(1,1,1)),f.MOON=u(new f(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),f.prototype.clone=function(e){return f.clone(this,e)},f.packedLength=e.packedLength,f.pack=function(t,i,o){return r.typeOf.object("value",t),r.defined("array",i),o=n(o,0),e.pack(t._radii,i,o),i},f.unpack=function(t,i,o){r.defined("array",t),i=n(i,0);var a=e.unpack(t,i);return f.fromCartesian3(a,o)},f.prototype.geocentricSurfaceNormal=e.normalize,f.prototype.geodeticSurfaceNormalCartographic=function(t,n){r.typeOf.object("cartographic",t);var o=t.longitude,a=t.latitude,u=Math.cos(a),s=u*Math.cos(o),c=u*Math.sin(o),l=Math.sin(a);return i(n)||(n=new e),n.x=s,n.y=c,n.z=l,e.normalize(n,n)},f.prototype.geodeticSurfaceNormal=function(t,r){return i(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var p=new e,d=new e;f.prototype.cartographicToCartesian=function(t,r){var n=p,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),i(r)||(r=new e),e.add(o,n,r)},f.prototype.cartographicArrayToCartesianArray=function(e,t){r.defined("cartographics",e);var n=e.length;i(t)?t.length=n:t=new Array(n);for(var o=0;n>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var h=new e,y=new e,m=new e;return f.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,y);if(i(o)){var a=this.geodeticSurfaceNormal(o,h),u=e.subtract(r,o,m),c=Math.atan2(a.y,a.x),l=Math.asin(a.z),f=s.sign(e.dot(u,r))*e.magnitude(u);return i(n)?(n.longitude=c,n.latitude=l,n.height=f,n):new t(c,l,f)}},f.prototype.cartesianArrayToCartographicArray=function(e,t){r.defined("cartesians",e);var n=e.length;i(t)?t.length=n:t=new Array(n);for(var o=0;n>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t},f.prototype.scaleToGeodeticSurface=function(e,t){return c(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},f.prototype.scaleToGeocentricSurface=function(t,n){r.typeOf.object("cartesian",t),i(n)||(n=new e);var o=t.x,a=t.y,u=t.z,s=this._oneOverRadiiSquared,c=1/Math.sqrt(o*o*s.x+a*a*s.y+u*u*s.z);return e.multiplyByScalar(t,c,n)},f.prototype.transformPositionToScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},f.prototype.transformPositionFromScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},f.prototype.equals=function(t){return this===t||i(t)&&e.equals(this._radii,t._radii)},f.prototype.toString=function(){return this._radii.toString()},f.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,o,u){if(r.typeOf.object("position",t),!s.equalsEpsilon(this._radii.x,this._radii.y,s.EPSILON15))throw new a("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");r.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),o=n(o,0);var c=this._squaredXOverSquaredZ;return i(u)||(u=new e),u.x=0,u.y=0,u.z=t.z*(1-c),Math.abs(u.z)>=this._radii.z-o?void 0:u},f}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,o,a){"use strict";function u(e){this._ellipsoid=r(e,a.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,o=t.longitude*i,a=t.latitude*i,u=t.height;return n(r)?(r.x=o,r.y=a,r.z=u,r):new e(o,a,u)},u.prototype.unproject=function(e,r){if(!n(e))throw new o("cartesian is required");var i=this._oneOverSemimajorAxis,a=e.x*i,u=e.y*i,s=e.z;return n(r)?(r.longitude=a,r.latitude=u,r.height=s,r):new t(a,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,o,a,u){"use strict";function s(e,t,n,i,o,a,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(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(a,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;3>r;++r){var n=e[s.getElementIndex(y[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,i=1,o=0;3>o;++o){var a=Math.abs(e[s.getElementIndex(y[o],h[o])]);a>n&&(i=o,n=a)}var c=1,l=0,f=h[i],p=y[i];if(Math.abs(e[s.getElementIndex(p,f)])>r){var d,m=e[s.getElementIndex(p,p)],E=e[s.getElementIndex(f,f)],O=e[s.getElementIndex(p,f)],v=(m-E)/2/O;d=0>v?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(p,p)]=c,t[s.getElementIndex(p,f)]=l,t[s.getElementIndex(f,p)]=-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,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new s),o[0]=e[i++],o[1]=e[i++],o[2]=e[i++],o[3]=e[i++],o[4]=e[i++],o[5]=e[i++],o[6]=e[i++],o[7]=e[i++],o[8]=e[i++],o},s.clone=function(e,t){return n(e)?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]):void 0},s.fromArray=function(e,i,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new s),o[0]=e[i],o[1]=e[i+1],o[2]=e[i+2],o[3]=e[i+3],o[4]=e[i+4],o[5]=e[i+5],o[6]=e[i+6],o[7]=e[i+7],o[8]=e[i+8],o},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,o=e.x*e.y,a=e.x*e.z,u=e.x*e.w,c=e.y*e.y,l=e.y*e.z,f=e.y*e.w,p=e.z*e.z,d=e.z*e.w,h=e.w*e.w,y=i-c-p+h,m=2*(o-d),E=2*(a+f),O=2*(o+d),v=-i+c-p+h,_=2*(l-u),w=2*(a-f),T=2*(l+u),b=-i-c+p+h;return n(r)?(r[0]=y,r[1]=O,r[2]=w,r[3]=m,r[4]=v,r[5]=T,r[6]=E,r[7]=_,r[8]=b,r):new s(y,m,E,O,v,_,w,T,b)},s.fromHeadingPitchRoll=function(e,r){t.typeOf.object("headingPitchRoll",e);var i=Math.cos(-e.pitch),o=Math.cos(-e.heading),a=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),l=Math.sin(e.roll),f=i*o,p=-a*c+l*u*o,d=l*c+a*u*o,h=i*c,y=a*o+l*u*c,m=-l*o+a*u*c,E=-u,O=l*i,v=a*i;return n(r)?(r[0]=f,r[1]=h,r[2]=E,r[3]=p,r[4]=y,r[5]=O,r[6]=d,r[7]=m,r[8]=v,r):new s(f,p,d,h,y,m,E,O,v)},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),o=Math.sin(e);return n(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=i,r[5]=o,r[6]=0,r[7]=-o,r[8]=i,r):new s(1,0,0,0,i,-o,0,o,i)},s.fromRotationY=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),o=Math.sin(e);return n(r)?(r[0]=i,r[1]=0,r[2]=-o,r[3]=0,r[4]=1,r[5]=0,r[6]=o,r[7]=0,r[8]=i,r):new s(i,0,o,0,1,0,-o,0,i)},s.fromRotationZ=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),o=Math.sin(e);return n(r)?(r[0]=i,r[1]=o,r[2]=0,r[3]=-o,r[4]=i,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new s(i,-o,0,o,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,o=e[i],a=e[i+1],u=e[i+2];return n.x=o,n.y=a,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 o=3*r;return i[o]=n.x,i[o+1]=n.y,i[o+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],o=e[r+3],a=e[r+6];return n.x=i,n.y=o,n.z=a,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 p=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],p)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],p)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],p)),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],o=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],a=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],p=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=i,n[1]=o,n[2]=a,n[3]=u,n[4]=s,n[5]=c,n[6]=l,n[7]=f,n[8]=p,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,o=r.y,a=r.z,u=e[0]*i+e[3]*o+e[6]*a,s=e[1]*i+e[4]*o+e[7]*a,c=e[2]*i+e[5]*o+e[8]*a;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],o=e[6],a=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]=o,r[3]=a,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r};var h=[1,0,0],y=[2,2,1],m=new s,E=new s;return s.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var i=u.EPSILON20,o=10,a=0,p=0;n(r)||(r={});for(var d=r.unitary=s.clone(s.IDENTITY,r.unitary),h=r.diagonal=s.clone(e,r.diagonal),y=i*c(h);o>p&&l(h)>y;)f(h,m),s.transpose(m,E),s.multiply(h,m,h),s.multiply(E,h,h),s.multiply(d,m,d),++a>2&&(++p,a=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],o=e[1],a=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return r*(a*l-c*u)+o*(c*i-n*l)+s*(n*u-a*i)},s.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[1],a=e[2],c=e[3],l=e[4],f=e[5],p=e[6],d=e[7],h=e[8],y=s.determinant(e);if(Math.abs(y)<=u.EPSILON15)throw new o("matrix is not invertible");r[0]=l*h-d*f,r[1]=d*a-i*h,r[2]=i*f-l*a,r[3]=p*f-c*h,r[4]=n*h-p*a,r[5]=c*a-n*f,r[6]=c*d-p*l,r[7]=p*i-n*d,r[8]=n*l-c*i;var m=1/y;return s.multiplyByScalar(r,m,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=a(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=a(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,o){"use strict";function a(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)}a.fromElements=function(e,t,n,i,o){return r(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new a(e,t,n,i)},a.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 a(t.red,t.green,t.blue,t.alpha)},a.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w):void 0},a.packedLength=4,a.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},a.unpack=function(n,i,o){return e.defined("array",n),i=t(i,0),r(o)||(o=new a),o.x=n[i++],o.y=n[i++],o.z=n[i++],o.w=n[i],o},a.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 o=0;i>o;++o)a.pack(t[o],n,4*o);return n},a.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 o=0;i>o;o+=4){var u=o/4;n[u]=a.unpack(t,o,n[u])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},a.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},a.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},a.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},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var u=new a;a.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitude(u)},a.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitudeSquared(u)},a.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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 a;a.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),a.multiplyByScalar(r,n,s),i=a.multiplyByScalar(t,1-n,i),a.add(s,i,i)};var c=new a;a.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=a.normalize(t,c);return a.abs(n,n),r=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,r):a.clone(a.UNIT_W,r):n.z<=n.w?a.clone(a.UNIT_Z,r):a.clone(a.UNIT_W,r):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,r):a.clone(a.UNIT_W,r):n.z<=n.w?a.clone(a.UNIT_Z,r):a.clone(a.UNIT_W,r)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,n,i)&&o.equalsEpsilon(e.y,t.y,n,i)&&o.equalsEpsilon(e.z,t.z,n,i)&&o.equalsEpsilon(e.w,t.w,n,i)},a.ZERO=i(new a(0,0,0,0)),a.UNIT_X=i(new a(1,0,0,0)),a.UNIT_Y=i(new a(0,1,0,0)),a.UNIT_Z=i(new a(0,0,1,0)),a.UNIT_W=i(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var l=new Float32Array(1),f=256,p=65536,d=16777216,h=1/f,y=1/p,m=1/d,E=38;return a.packFloat=function(t,n){if(e.typeOf.number("value",t),r(n)||(n=new a),l[0]=t,t=l[0],0===t)return a.clone(a.ZERO,n);var i,u=0>t?1:0;isFinite(t)?(t=Math.abs(t),i=Math.floor(o.logBase(t,10))+1,t/=Math.pow(10,i)):(t=.1,i=E);var s=t*f;return n.x=Math.floor(s),s=(s-n.x)*f,n.y=Math.floor(s),s=(s-n.y)*f,n.z=Math.floor(s),n.w=2*(i+E)+u,n},a.unpackFloat=function(t){e.typeOf.object("packedFloat",t);var r=t.w/2,n=Math.floor(r),i=2*(r-n);if(n-=E,i=2*i-1,i=-i,n>=E)return 0>i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var o=i*t.x*h;return o+=i*t.y*y,o+=i*t.z*m,o*Math.pow(10,n)},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.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,o,a,u,s,c){"use strict";function l(e,t,r,i,o,a,u,s,c,l,f,p,d,h,y,m){this[0]=n(e,0),this[1]=n(o,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(a,0),this[6]=n(l,0),this[7]=n(h,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(p,0),this[15]=n(m,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,o){return r.defined("array",e),t=n(t,0),i(o)||(o=new l),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},l.clone=function(e,t){return i(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):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]):void 0},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,o,a){return r.typeOf.object("rotation",t),o=n(o,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a):new l(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,o){r.typeOf.object("translation",e),r.typeOf.object("rotation",t),r.typeOf.object("scale",n),i(o)||(o=new l);var a=n.x,u=n.y,s=n.z,c=t.x*t.x,f=t.x*t.y,p=t.x*t.z,d=t.x*t.w,h=t.y*t.y,y=t.y*t.z,m=t.y*t.w,E=t.z*t.z,O=t.z*t.w,v=t.w*t.w,_=c-h-E+v,w=2*(f-O),T=2*(p+m),b=2*(f+O),A=-c+h-E+v,g=2*(y-d),R=2*(p-m),S=2*(y+d),N=-c-h+E+v;return o[0]=_*a,o[1]=b*a,o[2]=R*a,o[3]=0,o[4]=w*u,o[5]=A*u,o[6]=S*u,o[7]=0,o[8]=T*s,o[9]=g*s,o[10]=N*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},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,p=new e,d=new e;l.fromCamera=function(t,n){r.typeOf.object("camera",t);var o=t.position,a=t.direction,u=t.up;r.typeOf.object("camera.position",o),r.typeOf.object("camera.direction",a),r.typeOf.object("camera.up",u),e.normalize(a,f),e.normalize(e.cross(f,u,p),p),e.normalize(e.cross(p,f,d),d);var s=p.x,c=p.y,h=p.z,y=f.x,m=f.y,E=f.z,O=d.x,v=d.y,_=d.z,w=o.x,T=o.y,b=o.z,A=s*-w+c*-T+h*-b,g=O*-w+v*-T+_*-b,R=y*w+m*T+E*b;return i(n)?(n[0]=s,n[1]=O,n[2]=-y,n[3]=0,n[4]=c,n[5]=v,n[6]=-m,n[7]=0,n[8]=h,n[9]=_,n[10]=-E,n[11]=0,n[12]=A,n[13]=g,n[14]=R,n[15]=1,n):new l(s,c,h,A,O,v,_,g,-y,-m,-E,R,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,i,o){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",o);var a=Math.tan(.5*e),u=1/a,s=u/t,c=(i+n)/(n-i),l=2*i*n/(n-i);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},l.computeOrthographicOffCenter=function(e,t,n,i,o,a,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",o),r.typeOf.number("far",a),r.typeOf.object("result",u);var s=1/(t-e),c=1/(i-n),l=1/(a-o),f=-(t+e)*s,p=-(i+n)*c,d=-(a+o)*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]=p,u[14]=d,u[15]=1,u},l.computePerspectiveOffCenter=function(e,t,n,i,o,a,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",o),r.typeOf.number("far",a),r.typeOf.object("result",u);var s=2*o/(t-e),c=2*o/(i-n),l=(t+e)/(t-e),f=(i+n)/(i-n),p=-(a+o)/(a-o),d=-1,h=-2*a*o/(a-o);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]=p,u[11]=d,u[12]=0,u[13]=0,u[14]=h,u[15]=0,u},l.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,a){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",i),r.typeOf.number("near",o),r.typeOf.object("result",a);var u=2*o/(t-e),s=2*o/(i-n),c=(t+e)/(t-e),l=(i+n)/(i-n),f=-1,p=-1,d=-2*o;return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s,a[6]=0,a[7]=0,a[8]=c,a[9]=l,a[10]=f,a[11]=p,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},l.computeViewportTransformation=function(e,t,i,o){r.typeOf.object("result",o),e=n(e,n.EMPTY_OBJECT);var a=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,p=.5*(i-t),d=l,h=f,y=p,m=a+l,E=u+f,O=t+p,v=1;return o[0]=d,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=y,o[11]=0,o[12]=m,o[13]=E,o[14]=O,o[15]=v,o},l.computeView=function(t,n,i,o,a){return r.typeOf.object("position",t),r.typeOf.object("direction",n),r.typeOf.object("up",i),r.typeOf.object("right",o),r.typeOf.object("result",a),a[0]=o.x,a[1]=i.x,a[2]=-n.x,a[3]=0,a[4]=o.y,a[5]=i.y,a[6]=-n.y,a[7]=0,a[8]=o.z,a[9]=i.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(o,t),a[13]=-e.dot(i,t),a[14]=e.dot(n,t),a[15]=1,a},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,o=e[i],a=e[i+1],u=e[i+2],s=e[i+3];return n.x=o,n.y=a,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 o=4*t;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+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};var h=new e;l.setScale=function(t,n,i){r.typeOf.object("matrix",t),r.typeOf.object("scale",n),r.typeOf.object("result",i);var o=l.getScale(t,h),a=e.divideComponents(n,o,h);return l.multiplyByScale(t,a,i)},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],o=e[t+4],a=e[t+8],u=e[t+12];return n.x=i,n.y=o,n.z=a,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 y=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],y)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],y)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],y)),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],o=e[1],a=e[2],u=e[3],s=e[4],c=e[5],l=e[6],f=e[7],p=e[8],d=e[9],h=e[10],y=e[11],m=e[12],E=e[13],O=e[14],v=e[15],_=t[0],w=t[1],T=t[2],b=t[3],A=t[4],g=t[5],R=t[6],S=t[7],N=t[8],I=t[9],x=t[10],M=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=i*_+s*w+p*T+m*b,q=o*_+c*w+d*T+E*b,F=a*_+l*w+h*T+O*b,j=u*_+f*w+y*T+v*b,B=i*A+s*g+p*R+m*S,z=o*A+c*g+d*R+E*S,G=a*A+l*g+h*R+O*S,V=u*A+f*g+y*R+v*S,W=i*N+s*I+p*x+m*M,X=o*N+c*I+d*x+E*M,H=a*N+l*I+h*x+O*M,Y=u*N+f*I+y*x+v*M,k=i*C+s*P+p*D+m*U,Z=o*C+c*P+d*D+E*U,K=a*C+l*P+h*D+O*U,J=u*C+f*P+y*D+v*U;return n[0]=L,n[1]=q,n[2]=F,n[3]=j,n[4]=B,n[5]=z,n[6]=G,n[7]=V,n[8]=W,n[9]=X,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],o=e[1],a=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],p=e[10],d=e[12],h=e[13],y=e[14],m=t[0],E=t[1],O=t[2],v=t[4],_=t[5],w=t[6],T=t[8],b=t[9],A=t[10],g=t[12],R=t[13],S=t[14],N=i*m+u*E+l*O,I=o*m+s*E+f*O,x=a*m+c*E+p*O,M=i*v+u*_+l*w,C=o*v+s*_+f*w,P=a*v+c*_+p*w,D=i*T+u*b+l*A,U=o*T+s*b+f*A,L=a*T+c*b+p*A,q=i*g+u*R+l*S+d,F=o*g+s*R+f*S+h,j=a*g+c*R+p*S+y;return n[0]=N,n[1]=I,n[2]=x,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=q,n[13]=F,n[14]=j,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],o=e[1],a=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],p=e[10],d=t[0],h=t[1],y=t[2],m=t[3],E=t[4],O=t[5],v=t[6],_=t[7],w=t[8],T=i*d+u*h+l*y,b=o*d+s*h+f*y,A=a*d+c*h+p*y,g=i*m+u*E+l*O,R=o*m+s*E+f*O,S=a*m+c*E+p*O,N=i*v+u*_+l*w,I=o*v+s*_+f*w,x=a*v+c*_+p*w;return n[0]=T,n[1]=b,n[2]=A,n[3]=0,n[4]=g,n[5]=R,n[6]=S,n[7]=0,n[8]=N,n[9]=I,n[10]=x,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,o=t.y,a=t.z,u=i*e[0]+o*e[4]+a*e[8]+e[12],s=i*e[1]+o*e[5]+a*e[9]+e[13],c=i*e[2]+o*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=u,n[13]=s,n[14]=c,n[15]=e[15],n};var E=new e;l.multiplyByUniformScale=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scale",t),r.typeOf.object("result",n),E.x=t,E.y=t,E.z=t,l.multiplyByScale(e,E,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,o=t.y,a=t.z;return 1===i&&1===o&&1===a?l.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=0,n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},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,o=t.y,a=t.z,u=t.w,s=e[0]*i+e[4]*o+e[8]*a+e[12]*u,c=e[1]*i+e[5]*o+e[9]*a+e[13]*u,l=e[2]*i+e[6]*o+e[10]*a+e[14]*u,f=e[3]*i+e[7]*o+e[11]*a+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,o=t.y,a=t.z,u=e[0]*i+e[4]*o+e[8]*a,s=e[1]*i+e[5]*o+e[9]*a,c=e[2]*i+e[6]*o+e[10]*a;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,o=t.y,a=t.z,u=e[0]*i+e[4]*o+e[8]*a+e[12],s=e[1]*i+e[5]*o+e[9]*a+e[13],c=e[2]*i+e[6]*o+e[10]*a+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.multiplyByPlane=function(n,i,o){r.typeOf.object("matrix",n),r.typeOf.object("plane",i),r.typeOf.object("result",o);var a=new l,u=new l;l.inverse(n,a),l.transpose(a,u);var s=new t(i.normal.x,i.normal.y,i.normal.z,i.distance);l.multiplyByVector(u,s,s),o.normal.x=s.x,o.normal.y=s.y,o.normal.z=s.z;var c=e.magnitude(o.normal);return e.normalize(o.normal,o.normal),o.distance=s.w/c,o},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],o=e[3],a=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]=a,t[10]=e[10],t[11]=e[14],t[12]=o,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 O=new s,v=new s,_=new t,w=new t(0,0,0,1);return l.inverse=function(e,n){r.typeOf.object("matrix",e),r.typeOf.object("result",n);var i=e[0],o=e[4],a=e[8],f=e[12],p=e[1],d=e[5],h=e[9],y=e[13],m=e[2],E=e[6],T=e[10],b=e[14],A=e[3],g=e[7],R=e[11],S=e[15],N=T*S,I=b*R,x=E*S,M=b*g,C=E*R,P=T*g,D=m*S,U=b*A,L=m*R,q=T*A,F=m*g,j=E*A,B=N*d+M*h+C*y-(I*d+x*h+P*y),z=I*p+D*h+q*y-(N*p+U*h+L*y),G=x*p+U*d+F*y-(M*p+D*d+j*y),V=P*p+L*d+j*h-(C*p+q*d+F*h),W=I*o+x*a+P*f-(N*o+M*a+C*f),X=N*i+U*a+L*f-(I*i+D*a+q*f),H=M*i+D*o+j*f-(x*i+U*o+F*f),Y=C*i+q*o+F*a-(P*i+L*o+j*a);N=a*y,I=f*h,x=o*y,M=f*d,C=o*h,P=a*d,D=i*y,U=f*p,L=i*h,q=a*p,F=i*d,j=o*p;var k=N*g+M*R+C*S-(I*g+x*R+P*S),Z=I*A+D*R+q*S-(N*A+U*R+L*S),K=x*A+U*g+F*S-(M*A+D*g+j*S),J=P*A+L*g+j*R-(C*A+q*g+F*R),Q=x*T+P*b+I*E-(C*b+N*E+M*T),$=L*b+N*m+U*T-(D*T+q*b+I*m),ee=D*E+j*b+M*m-(F*b+x*m+U*E),te=F*T+C*m+q*E-(L*E+j*T+P*m),re=i*B+o*z+a*G+f*V;if(Math.abs(re)r&&(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,o,a){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),i=u.toRadians(r(i,0)),o=u.toRadians(r(o,0)), n(a)?(a.west=e,a.south=t,a.east=i,a.north=o,a):new s(e,t,i,o)},s.fromRadians=function(e,t,i,o,a){return n(a)?(a.west=r(e,0),a.south=r(t,0),a.east=r(i,0),a.north=r(o,0),a):new s(e,t,i,o)},s.fromCartographicArray=function(e,r){t.defined("cartographics",e);for(var i=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,p=0,d=e.length;d>p;p++){var h=e[p];i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),l=Math.min(l,h.latitude),f=Math.max(f,h.latitude);var y=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;a=Math.min(a,y),c=Math.max(c,y)}return o-i>c-a&&(i=a,o=c,o>u.PI&&(o-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=o,r.north=f,r):new s(i,l,o,f)},s.fromCartesianArray=function(e,i,a){t.defined("cartesians",e),i=r(i,o.WGS84);for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=Number.MAX_VALUE,p=-Number.MAX_VALUE,d=Number.MAX_VALUE,h=-Number.MAX_VALUE,y=0,m=e.length;m>y;y++){var E=i.cartesianToCartographic(e[y]);c=Math.min(c,E.longitude),l=Math.max(l,E.longitude),d=Math.min(d,E.latitude),h=Math.max(h,E.latitude);var O=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;f=Math.min(f,O),p=Math.max(p,O)}return l-c>p-f&&(c=f,l=p,l>u.PI&&(l-=u.TWO_PI),c>u.PI&&(c-=u.TWO_PI)),n(a)?(a.west=c,a.south=d,a.east=l,a.north=h,a):new s(c,d,l,h)},s.clone=function(e,t){return n(e)?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):void 0},s.equalsEpsilon=function(e,r,i){return t.typeOf.number("absoluteEpsilon",i),e===r||n(e)&&n(r)&&Math.abs(e.west-r.west)<=i&&Math.abs(e.south-r.south)<=i&&Math.abs(e.east-r.east)<=i&&Math.abs(e.north-r.north)<=i},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),s.equalsEpsilon(this,e,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 o=e.east;t.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.typeOf.number.lessThanOrEquals("east",o,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 o=r.east,a=r.west;a>o&&(o+=u.TWO_PI);var s=u.negativePiToPi(.5*(a+o)),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 o=e.east,a=e.west,c=r.east,l=r.west;a>o&&c>0?o+=u.TWO_PI:l>c&&o>0&&(c+=u.TWO_PI),a>o&&0>l?l+=u.TWO_PI:l>c&&0>a&&(a+=u.TWO_PI);var f=u.negativePiToPi(Math.max(a,l)),p=u.negativePiToPi(Math.min(o,c));if(!((e.west=p)){var d=Math.max(e.south,r.south),h=Math.min(e.north,r.north);if(!(d>=h))return n(i)?(i.west=f,i.south=d,i.east=p,i.north=h,i):new s(f,d,p,h)}},s.simpleIntersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var o=Math.max(e.west,r.west),a=Math.max(e.south,r.south),u=Math.min(e.east,r.east),c=Math.min(e.north,r.north);return a>=c||o>=u?void 0:n(i)?(i.west=o,i.south=a,i.east=u,i.north=c,i):new s(o,a,u,c)},s.union=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(i)||(i=new s);var o=e.east,a=e.west,c=r.east,l=r.west;a>o&&c>0?o+=u.TWO_PI:l>c&&o>0&&(c+=u.TWO_PI),a>o&&0>l?l+=u.TWO_PI:l>c&&0>a&&(a+=u.TWO_PI);var f=u.convertLongitudeRange(Math.min(a,l)),p=u.convertLongitudeRange(Math.max(o,c));return i.west=f,i.south=Math.min(e.south,r.south),i.east=p,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,o=e.west,a=e.east;return o>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>o||u.equalsEpsilon(n,o,u.EPSILON14))&&(a>n||u.equalsEpsilon(n,a,u.EPSILON14))&&i>=e.south&&i<=e.north};var c=new e;return s.subsample=function(e,i,a,l){t.typeOf.object("rectangle",e),i=r(i,o.WGS84),a=r(a,0),n(l)||(l=[]);var f=0,p=e.north,d=e.south,h=e.east,y=e.west,m=c;m.height=a,m.longitude=y,m.latitude=p,l[f]=i.cartographicToCartesian(m,l[f]),f++,m.longitude=h,l[f]=i.cartographicToCartesian(m,l[f]),f++,m.latitude=d,l[f]=i.cartographicToCartesian(m,l[f]),f++,m.longitude=y,l[f]=i.cartographicToCartesian(m,l[f]),f++,0>p?m.latitude=p:d>0?m.latitude=d:m.latitude=0;for(var E=1;8>E;++E)m.longitude=-Math.PI+E*u.PI_OVER_TWO,s.contains(e,m)&&(l[f]=i.cartographicToCartesian(m,l[f]),f++);return 0===m.latitude&&(m.longitude=y,l[f]=i.cartographicToCartesian(m,l[f]),f++,m.longitude=h,l[f]=i.cartographicToCartesian(m,l[f]),f++),l.length=f,l},s.MAX_VALUE=a(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","./Math","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,i,o,a,u,s,c,l,f,p){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,y=new e,m=new e,E=new e,O=new e,v=new e,_=new e,w=new e,T=new e,b=new e,A=new e,g=new e,R=4/3*c.PI;d.fromPoints=function(t,r){if(i(r)||(r=new d),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n,o=e.clone(t[0],_),a=e.clone(o,h),u=e.clone(o,y),s=e.clone(o,m),c=e.clone(o,E),l=e.clone(o,O),f=e.clone(o,v),p=t.length;for(n=1;p>n;n++){e.clone(t[n],o);var R=o.x,S=o.y,N=o.z;Rc.x&&e.clone(o,c),Sl.y&&e.clone(o,l),Nf.z&&e.clone(o,f)}var I=e.magnitudeSquared(e.subtract(c,a,w)),x=e.magnitudeSquared(e.subtract(l,u,w)),M=e.magnitudeSquared(e.subtract(f,s,w)),C=a,P=c,D=I;x>D&&(D=x,C=u,P=l),M>D&&(D=M,C=s,P=f);var U=T;U.x=.5*(C.x+P.x),U.y=.5*(C.y+P.y),U.z=.5*(C.z+P.z);var L=e.magnitudeSquared(e.subtract(P,U,w)),q=Math.sqrt(L),F=b;F.x=a.x,F.y=u.y,F.z=s.z;var j=A;j.x=c.x,j.y=l.y,j.z=f.z;var B=e.midpoint(F,j,g),z=0;for(n=0;p>n;n++){e.clone(t[n],o);var G=e.magnitude(e.subtract(o,B,w));G>z&&(z=G);var V=e.magnitudeSquared(e.subtract(o,U,w));if(V>L){var W=Math.sqrt(V);q=.5*(q+W),L=q*q;var X=W-q;U.x=(q*U.x+X*o.x)/W,U.y=(q*U.y+X*o.y)/W,U.z=(q*U.z+X*o.z)/W}}return z>q?(e.clone(U,r.center),r.radius=q):(e.clone(B,r.center),r.radius=z),r};var S=new a,N=new e,I=new e,x=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,o,a,u){if(i(u)||(u=new d),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,S),p.southwest(t,x),x.height=o,p.northeast(t,M),M.height=a;var s=r.project(x,N),c=r.project(M,I),l=c.x-s.x,f=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+h*h);var y=u.center;return y.x=s.x+.5*l,y.y=s.y+.5*f,y.z=s.z+.5*h,u};var C=[];d.fromRectangle3D=function(t,r,a,u){if(r=n(r,o.WGS84),a=n(a,0),i(u)||(u=new d),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;var s=p.subsample(t,r,a,C);return d.fromPoints(s,u)},d.fromVertices=function(t,o,a,u){if(i(u)||(u=new d),!i(t)||0===t.length)return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;o=n(o,e.ZERO),a=n(a,3),r.typeOf.number.greaterThanOrEquals("stride",a,3);var s=_;s.x=t[0]+o.x,s.y=t[1]+o.y,s.z=t[2]+o.z;var c,l=e.clone(s,h),f=e.clone(s,y),p=e.clone(s,m),R=e.clone(s,E),S=e.clone(s,O),N=e.clone(s,v),I=t.length;for(c=0;I>c;c+=a){var x=t[c]+o.x,M=t[c+1]+o.y,C=t[c+2]+o.z;s.x=x,s.y=M,s.z=C,xR.x&&e.clone(s,R),MS.y&&e.clone(s,S),CN.z&&e.clone(s,N)}var P=e.magnitudeSquared(e.subtract(R,l,w)),D=e.magnitudeSquared(e.subtract(S,f,w)),U=e.magnitudeSquared(e.subtract(N,p,w)),L=l,q=R,F=P;D>F&&(F=D,L=f,q=S),U>F&&(F=U,L=p,q=N);var j=T;j.x=.5*(L.x+q.x),j.y=.5*(L.y+q.y),j.z=.5*(L.z+q.z);var B=e.magnitudeSquared(e.subtract(q,j,w)),z=Math.sqrt(B),G=b;G.x=l.x,G.y=f.y,G.z=p.z;var V=A;V.x=R.x,V.y=S.y,V.z=N.z;var W=e.midpoint(G,V,g),X=0;for(c=0;I>c;c+=a){s.x=t[c]+o.x,s.y=t[c+1]+o.y,s.z=t[c+2]+o.z;var H=e.magnitude(e.subtract(s,W,w));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(s,j,w));if(Y>B){var k=Math.sqrt(Y);z=.5*(z+k),B=z*z;var Z=k-z;j.x=(z*j.x+Z*s.x)/k,j.y=(z*j.y+Z*s.y)/k,j.z=(z*j.z+Z*s.z)/k}}return X>z?(e.clone(j,u.center),u.radius=z):(e.clone(W,u.center),u.radius=X),u},d.fromEncodedCartesianVertices=function(t,r,n){if(i(n)||(n=new d),!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 o=_;o.x=t[0]+r[0],o.y=t[1]+r[1],o.z=t[2]+r[2];var a,u=e.clone(o,h),s=e.clone(o,y),c=e.clone(o,m),l=e.clone(o,E),f=e.clone(o,O),p=e.clone(o,v),R=t.length;for(a=0;R>a;a+=3){var S=t[a]+r[a],N=t[a+1]+r[a+1],I=t[a+2]+r[a+2];o.x=S,o.y=N,o.z=I,Sl.x&&e.clone(o,l),Nf.y&&e.clone(o,f),Ip.z&&e.clone(o,p)}var x=e.magnitudeSquared(e.subtract(l,u,w)),M=e.magnitudeSquared(e.subtract(f,s,w)),C=e.magnitudeSquared(e.subtract(p,c,w)),P=u,D=l,U=x;M>U&&(U=M,P=s,D=f),C>U&&(U=C,P=c,D=p);var L=T;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var q=e.magnitudeSquared(e.subtract(D,L,w)),F=Math.sqrt(q),j=b;j.x=u.x,j.y=s.y,j.z=c.z;var B=A;B.x=l.x,B.y=f.y,B.z=p.z;var z=e.midpoint(j,B,g),G=0;for(a=0;R>a;a+=3){o.x=t[a]+r[a],o.y=t[a+1]+r[a+1],o.z=t[a+2]+r[a+2];var V=e.magnitude(e.subtract(o,z,w));V>G&&(G=V);var W=e.magnitudeSquared(e.subtract(o,L,w));if(W>q){var X=Math.sqrt(W);F=.5*(F+X),q=F*F;var H=X-F;L.x=(F*L.x+H*o.x)/X,L.y=(F*L.y+H*o.y)/X,L.z=(F*L.z+H*o.z)/X}}return G>F?(e.clone(L,n.center),n.radius=F):(e.clone(z,n.center),n.radius=G),n},d.fromCornerPoints=function(t,n,o){r.typeOf.object("corner",t),r.typeOf.object("oppositeCorner",n),i(o)||(o=new d);var a=e.midpoint(t,n,o.center);return o.radius=e.distance(a,n),o},d.fromEllipsoid=function(t,n){return r.typeOf.object("ellipsoid",t),i(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;d.fromBoundingSpheres=function(t,r){if(i(r)||(r=new d),!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 d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);var o,a=[];for(o=0;n>o;o++)a.push(t[o].center);r=d.fromPoints(a,r);var u=r.center,s=r.radius;for(o=0;n>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var D=new e,U=new e,L=new e;d.fromOrientedBoundingBox=function(t,n){r.defined("orientedBoundingBox",t),i(n)||(n=new d);var o=t.halfAxes,a=l.getColumn(o,0,D),u=l.getColumn(o,1,U),s=l.getColumn(o,2,L);return e.add(a,u,a),e.add(a,s,a),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(a),n},d.clone=function(t,r){return i(t)?i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,i){r.typeOf.object("value",e),r.defined("array",t),i=n(i,0);var o=e.center;return t[i++]=o.x,t[i++]=o.y,t[i++]=o.z,t[i]=e.radius,t},d.unpack=function(e,t,o){r.defined("array",e),t=n(t,0),i(o)||(o=new d);var a=o.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],o.radius=e[t],o};var q=new e,F=new e;d.union=function(t,n,o){r.typeOf.object("left",t),r.typeOf.object("right",n),i(o)||(o=new d);var a=t.center,u=t.radius,s=n.center,c=n.radius,l=e.subtract(s,a,q),f=e.magnitude(l);if(u>=f+c)return t.clone(o),o;if(c>=f+u)return n.clone(o),o;var p=.5*(u+f+c),h=e.multiplyByScalar(l,(-u+p)/f,F);return e.add(h,a,h),e.clone(h,o.center),o.radius=p,o};var j=new e;d.expand=function(t,n,i){r.typeOf.object("sphere",t),r.typeOf.object("point",n),i=d.clone(t,i);var o=e.magnitude(e.subtract(n,i.center,j));return o>i.radius&&(i.radius=o),i},d.intersectPlane=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("plane",n);var i=t.center,o=t.radius,a=n.normal,s=e.dot(a,i)+n.distance;return-o>s?u.OUTSIDE:o>s?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),i(n)||(n=new d),n.center=f.multiplyByPoint(t,e.center,n.center),n.radius=f.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("cartesian",n);var i=e.subtract(t.center,n,B);return e.magnitudeSquared(i)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),i(n)||(n=new d),n.center=f.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;d.computePlaneDistances=function(t,n,o,a){r.typeOf.object("sphere",t),r.typeOf.object("position",n),r.typeOf.object("direction",o),i(a)||(a=new s);var u=e.subtract(t.center,n,z),c=e.dot(o,u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var G=new e,V=new e,W=new e,X=new e,H=new e,Y=new t,k=new Array(8),Z=0;8>Z;++Z)k[Z]=new e;var K=new a;return d.projectTo2D=function(t,i,o){r.typeOf.object("sphere",t),i=n(i,K);var a=i.ellipsoid,u=t.center,s=t.radius,c=a.geodeticSurfaceNormal(u,G),l=e.cross(e.UNIT_Z,c,V);e.normalize(l,l);var f=e.cross(c,l,W);e.normalize(f,f),e.multiplyByScalar(c,s,c),e.multiplyByScalar(f,s,f),e.multiplyByScalar(l,s,l);var p=e.negate(f,H),h=e.negate(l,X),y=k,m=y[0];e.add(c,f,m),e.add(m,l,m),m=y[1],e.add(c,f,m),e.add(m,h,m),m=y[2],e.add(c,p,m),e.add(m,h,m),m=y[3],e.add(c,p,m),e.add(m,l,m),e.negate(c,c),m=y[4],e.add(c,f,m),e.add(m,l,m),m=y[5],e.add(c,f,m),e.add(m,h,m),m=y[6],e.add(c,p,m),e.add(m,h,m),m=y[7],e.add(c,p,m),e.add(m,l,m);for(var E=y.length,O=0;E>O;++O){var v=y[O];e.add(u,v,v);var _=a.cartesianToCartographic(v,Y);i.project(_,v)}o=d.fromPoints(y,o),u=o.center;var w=u.x,T=u.y,b=u.z;return u.x=b,u.y=w,u.z=T,o},d.isOccluded=function(e,t){return r.typeOf.object("sphere",e),r.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.volume=function(){var e=this.radius;return R*e*e*e},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,o){"use strict";function a(e,r){this.x=t(e,0),this.y=t(r,0)}a.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new a(e,t)},a.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.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},a.unpack=function(n,i,o){return e.defined("array",n),i=t(i,0),r(o)||(o=new a),o.x=n[i++],o.y=n[i],o},a.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 o=0;i>o;++o)a.pack(t[o],n,2*o);return n},a.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 o=0;i>o;o+=2){var u=o/2;n[u]=a.unpack(t,o,n[u])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y)},a.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y)},a.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},a.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},a.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var u=new a;a.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitude(u)},a.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.subtract(t,r,u),a.magnitudeSquared(u)},a.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var i=a.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},a.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y},a.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},a.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},a.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},a.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},a.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},a.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},a.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r},a.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 a;a.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),a.multiplyByScalar(r,n,s),i=a.multiplyByScalar(t,1-n,i),a.add(s,i,i)};var c=new a,l=new a;a.angleBetween=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),a.normalize(t,c),a.normalize(r,l),o.acosClamped(a.dot(c,l))};var f=new a;return a.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=a.normalize(t,f);return a.abs(n,n),r=n.x<=n.y?a.clone(a.UNIT_X,r):a.clone(a.UNIT_Y,r)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,n,i)&&o.equalsEpsilon(e.y,t.y,n,i)},a.ZERO=i(new a(0,0)),a.UNIT_X=i(new a(1,0)),a.UNIT_Y=i(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/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(){return i.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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,o=["webkit","moz","o","ms","khtml"],a=0,u=o.length;u>a;++a){var s=o[a];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}),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=a(),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,o)}function n(e){this.then=e}function i(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(n){return o(n)}});return r}function o(e){var r=new n(function(r,n){try{return n?t(n(e)):o(e)}catch(i){return o(i)}});return r}function a(){function e(e,t,r){return p(e,t,r)}function r(e){return h(e)}function i(e){return h(o(e))}function u(e){return d(e)}var s,c,l,f,p,d,h;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=[],p=function(e,t,r){var n,i;return n=a(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(t){n.progress(t)}}: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 y(f,e),e},h=function(e){return e=t(e),p=e.then,h=t,d=E,y(l,e),f=l=w,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,o){return m(2,arguments),e(t,function(t){function u(e){y(e)}function s(e){h(e)}var c,l,f,p,d,h,y,m,O,v;if(O=t.length>>>0,c=Math.max(0,Math.min(r,O)),f=[],l=O-c+1,p=[],d=a(),c)for(m=d.progress,y=function(e){p.push(e),--l||(h=y=E,d.reject(p))},h=function(e){f.push(e),--c||(h=y=E,d.resolve(f))},v=0;O>v;++v)v in t&&e(t[v],s,u,m);else d.resolve(f);return d.then(n,i,o)})}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 m(1,arguments),p(e,O).then(t,r,n)}function f(){return p(arguments,O)}function p(t,r){return e(t,function(t){var n,i,o,u,s,c;if(o=i=t.length>>>0,n=[],c=a(),o)for(u=function(t,i){e(t,r).then(function(e){n[i]=e,--o||c.resolve(n)},c.reject)},s=0;i>s;s++)s in t?u(t[s],s):--o;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,o){return e(t,function(t){return e(n,function(e){return r(t,e,o,i)})})},v.apply(t,n)})}function h(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),o(e)},r.progress)}function y(e,t){for(var r,n=0;r=e[n++];)r(t)}function m(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function E(){}function O(e){return e}var v,_,w;return e.defer=a,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=p,e.reduce=d,e.any=c,e.some=s,e.chain=h,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},"yield":function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(w,t)})})}},_=[].slice,v=[].reduce||function(e){var t,r,n,i,o;if(o=0,t=Object(this),i=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){n=t[o++];break}if(++o>=i)throw new TypeError}else n=r[1];for(;i>o;++o)o in t&&(n=e(n,t[o],o,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen","./RuntimeError","../ThirdParty/when"],function(e,t,r,n,i){"use strict";function o(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(S)&&(S=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=o(e[1]))}return S}function u(){return a()&&N}function s(){if(!t(I)&&(I=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(I=!0,x=o(e[1]))}return I}function c(){return s()&&x}function l(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(M=!0,C=o(e[1]),C.isNightly=!!e[2])}return M}function f(){return l()&&C}function p(){if(!t(P)){P=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(P=!0,D=o(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(P=!0,D=o(e[1])))}return P}function d(){return p()&&D}function h(){if(!t(U)){U=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(U=!0,L=o(e[1]))}return U}function y(){return h()&&L}function m(){if(!t(q)){q=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(q=!0,F=o(e[1]))}return q}function E(){return t(j)||(j=/Windows/i.test(R.appVersion)),j}function O(){return m()&&F}function v(){return t(B)||(B="object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)),B}function _(){return t(z)||(z=!m()&&"undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),z}function w(){if(!t(V)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;V=t(r)&&""!==r,V&&(G=r)}return V}function T(){return w()?G:void 0}function b(){if(t(X))return X.promise;X=i.defer(),h()&&(W=!1,X.resolve(W));var e=new Image;return e.onload=function(){W=e.width>0&&e.height>0,X.resolve(W)},e.onerror=function(){W=!1,X.resolve(W)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",X.promise}function A(){return t(X)||b(),W}function g(){var e=window.navigator.userAgent.toLowerCase(),t="ipad"==e.match(/ipad/i),r="iphone os"==e.match(/iphone os/i),n="midp"==e.match(/midp/i),i="rv:1.2.3.4"==e.match(/rv:1.2.3.4/i),o="ucweb"==e.match(/ucweb/i),a="android"==e.match(/android/i),u="windows ce"==e.match(/windows ce/i),s="windows mobile"==e.match(/windows mobile/i);return t||r||n||i||o||a||u||s?!1:!0}var R;R="undefined"!=typeof navigator?navigator:{};var S,N,I,x,M,C,P,D,U,L,q,F,j,B,z,G,V,W,X,H=[];"undefined"!=typeof ArrayBuffer&&(H.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&H.push(Uint8ClampedArray),"undefined"!=typeof CanvasPixelArray&&H.push(CanvasPixelArray));var Y={isChrome:a,chromeVersion:u,isSafari:s,safariVersion:c,isWebkit:l,webkitVersion:f,isInternetExplorer:p,internetExplorerVersion:d,isEdge:h,edgeVersion:y,isFirefox:m,firefoxVersion:O,isWindows:E,isNodeJs:v,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:w,supportsWebP:b,supportsWebPSync:A,imageRenderingValue:T,typedArrayTypes:H,isPCBroswer:g};return Y.supportsFullscreen=function(){return r.supportsFullscreen()},Y.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},Y.supportsWebWorkers=function(){return"undefined"!=typeof Worker},Y.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!Y.isEdge()},Y}),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,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,i,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){if(!t(e))throw new r("value is required.");switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,n){if(!t(e))throw new r("componentDatatype is required.");if(!t(n))throw new r("valuesOrLength is required.");switch(e){case a.BYTE:return new Int8Array(n);case a.UNSIGNED_BYTE:return new Uint8Array(n);case a.SHORT:return new Int16Array(n);case a.UNSIGNED_SHORT:return new Uint16Array(n);case a.INT:return new Int32Array(n);case a.UNSIGNED_INT:return new Uint32Array(n);case a.FLOAT:return new Float32Array(n);case a.DOUBLE:return new Float64Array(n);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(n,i,o,u){if(!t(n))throw new r("componentDatatype is required.");if(!t(i))throw new r("buffer is required.");switch(o=e(o,0),u=e(u,(i.byteLength-o)/a.getSizeInBytes(n)),n){case a.BYTE:return new Int8Array(i,o,u);case a.UNSIGNED_BYTE:return new Uint8Array(i,o,u);case a.SHORT:return new Int16Array(i,o,u);case a.UNSIGNED_SHORT:return new Uint16Array(i,o,u);case a.INT:return new Int32Array(i,o,u);case a.UNSIGNED_INT:return new Uint32Array(i,o,u);case a.FLOAT:return new Float32Array(i,o,u);case a.DOUBLE:return new Float64Array(i,o,u);default:throw new r("componentDatatype is not a valid value.")}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE;default:throw new r("name is not a valid value.")}},i(a)}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,i,o,a,u){"use strict";function s(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 c=new e;s.fromAxisAngle=function(r,i,o){t.typeOf.object("axis",r),t.typeOf.number("angle",i);var a=i/2,u=Math.sin(a);c=e.normalize(r,c);var l=c.x*u,f=c.y*u,p=c.z*u,d=Math.cos(a);return n(o)?(o.x=l,o.y=f,o.z=p,o.w=d,o):new s(l,f,p,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,r){t.typeOf.object("matrix",e);var i,o,a,c,p,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],y=e[u.COLUMN2ROW2],m=d+h+y;if(m>0)i=Math.sqrt(m+1),p=.5*i,i=.5/i,o=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*i,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*i,c=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*i;else{var E=l,O=0;h>d&&(O=1),y>d&&y>h&&(O=2);var v=E[O],_=E[v];i=Math.sqrt(e[u.getElementIndex(O,O)]-e[u.getElementIndex(v,v)]-e[u.getElementIndex(_,_)]+1);var w=f;w[O]=.5*i,i=.5/i,p=(e[u.getElementIndex(_,v)]-e[u.getElementIndex(v,_)])*i,w[v]=(e[u.getElementIndex(v,O)]+e[u.getElementIndex(O,v)])*i,w[_]=(e[u.getElementIndex(_,O)]+e[u.getElementIndex(O,_)])*i,o=-w[0],a=-w[1],c=-w[2]}return n(r)?(r.x=o,r.y=a,r.z=c,r.w=p,r):new s(o,a,c,p)};var p=new s,d=new s,h=new s,y=new s;s.fromHeadingPitchRoll=function(r,n){return t.typeOf.object("headingPitchRoll",r),y=s.fromAxisAngle(e.UNIT_X,r.roll,p),h=s.fromAxisAngle(e.UNIT_Y,-r.pitch,n),n=s.multiply(h,y,h),d=s.fromAxisAngle(e.UNIT_Z,-r.heading,p),s.multiply(d,n,n)};var m=new e,E=new e,O=new s,v=new s,_=new s;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.x,n[i++]=e.y,n[i++]=e.z,n[i]=e.w,n},s.unpack=function(e,i,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new s),o.x=e[i],o.y=e[i+1],o.z=e[i+2],o.w=e[i+3],o},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,_),s.conjugate(_,_);for(var i=0,o=r-t+1;o>i;i++){var a=3*i;s.unpack(e,4*(t+i),O),s.multiply(O,_,O),O.w<0&&s.negate(O,O),s.computeAxis(O,m);var u=s.computeAngle(O);n[a]=m.x*u,n[a+1]=m.y*u,n[a+2]=m.z*u}},s.unpackInterpolationResult=function(t,r,i,o,a){n(a)||(a=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*o,v),0===u?s.clone(s.IDENTITY,O):s.fromAxisAngle(E,u,O),s.multiply(O,v,a)},s.clone=function(e,t){return n(e)?n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},s.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},s.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},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,r){t.typeOf.object("result",r);var n=1/s.magnitude(e),i=e.x*n,o=e.y*n,a=e.z*n,u=e.w*n;return r.x=i,r.y=o,r.z=a,r.w=u,r},s.inverse=function(e,r){t.typeOf.object("result",r);var n=s.magnitudeSquared(e);return r=s.conjugate(e,r),s.multiplyByScalar(r,1/n,r)},s.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},s.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},s.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},s.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},s.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var i=e.x,o=e.y,a=e.z,u=e.w,s=r.x,c=r.y,l=r.z,f=r.w,p=u*s+i*f+o*l-a*c,d=u*c-i*l+o*f+a*s,h=u*l+i*c-o*s+a*f,y=u*f-i*s-o*c-a*l;return n.x=p,n.y=d,n.z=h,n.w=y,n},s.multiplyByVec=function(t,r,n){var i=new e,o=new e,a=new e(t.x,t.y,t.z);i=e.cross(a,r,i),o=e.cross(a,i,o);var u=new e;u=e.multiplyByScalar(i,2*t.w,u);var s=new e;return s=e.multiplyByScalar(i,2,s),n=e.add(r,u,n),n=e.add(n,s,n)},s.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},s.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},s.computeAxis=function(e,r){t.typeOf.object("quaternion",e),t.typeOf.object("result",r);var n=e.w;if(Math.abs(n-1)o&&(o=-o,u=T=s.negate(r,T)),1-oU;++U){var L=U+1,q=2*L+1;M[U]=1/(L*q),C[U]=L/q}return M[7]=x/136,C[7]=8*x/17,s.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 o,a=s.dot(e,r);a>=0?o=1:(o=-1,a=-a);for(var u=a-1,c=1-n,l=n*n,f=c*c,p=7;p>=0;--p)P[p]=(M[p]*l-C[p])*u,D[p]=(M[p]*f-C[p])*u;var d=o*n*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),h=c*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),y=s.multiplyByScalar(e,h,I);return s.multiplyByScalar(r,d,i),s.add(y,i,i)},s.fastSquad=function(e,r,n,i,o,a){t.typeOf.object("q0",e),t.typeOf.object("q1",r),t.typeOf.object("s0",n),t.typeOf.object("s1",i),t.typeOf.number("t",o),t.typeOf.object("result",a);var u=s.fastSlerp(e,r,o,S),c=s.fastSlerp(n,i,o,N);return s.fastSlerp(u,c,2*o*(1-o),a)},s.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},s.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},s.ZERO=o(new s(0,0,0,0)),s.IDENTITY=o(new s(0,0,0,1)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function i(t,i,o,l,f,p,d,h,y,m){var E=t+i;e.multiplyByScalar(l,Math.cos(E),a),e.multiplyByScalar(o,Math.sin(E),u),e.add(a,u,a);var O=Math.cos(t);O*=O;var v=Math.sin(t);v*=v;var _=p/Math.sqrt(d*O+f*v),w=_/h;return n.fromAxisAngle(a,w,s),r.fromQuaternion(s,c),r.multiplyByVector(c,y,m),e.normalize(m,m),e.multiplyByScalar(m,h,m),m}var o={},a=new e,u=new e,s=new n,c=new r,l=new e,f=new e,p=new e,d=new e;o.raisePositionsToHeight=function(t,r,n){for(var i=r.ellipsoid,o=r.height,a=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,h=n?c:0,y=0;c>y;y+=3){var m=y+1,E=y+2,O=e.fromArray(t,y,l);i.scaleToGeodeticSurface(O,O);var v=e.clone(O,f),_=i.geodeticSurfaceNormal(O,d),w=e.multiplyByScalar(_,o,p);e.add(O,w,O),n&&(e.multiplyByScalar(_,a,w),e.add(v,w,v),s[y+h]=v.x,s[m+h]=v.y,s[E+h]=v.z),s[y]=O.x,s[m]=O.y,s[E]=O.z}return s};var h=new e,y=new e,m=new e;return o.computeEllipsePositions=function(r,n,o){var a=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,d=8*r.granularity,E=a*a,O=u*u,v=u*a,_=e.magnitude(c),w=e.normalize(c,h),T=e.cross(e.UNIT_Z,c,y);T=e.normalize(T,T);var b=e.cross(w,T,m),A=1+Math.ceil(t.PI_OVER_TWO/d),g=t.PI_OVER_TWO/(A-1),R=t.PI_OVER_TWO-A*g;0>R&&(A-=Math.ceil(Math.abs(R)/g));var S,N,I,x,M,C=2*(A*(A+2)),P=n?new Array(3*C):void 0,D=0,U=l,L=f,q=4*A*3,F=q-1,j=0,B=o?new Array(q):void 0;for(R=t.PI_OVER_TWO,U=i(R,s,b,T,E,v,O,_,w,U),n&&(P[D++]=U.x,P[D++]=U.y,P[D++]=U.z),o&&(B[F--]=U.z,B[F--]=U.y,B[F--]=U.x),R=t.PI_OVER_TWO-g,S=1;A+1>S;++S){if(U=i(R,s,b,T,E,v,O,_,w,U),L=i(Math.PI-R,s,b,T,E,v,O,_,w,L),n){for(P[D++]=U.x,P[D++]=U.y,P[D++]=U.z,I=2*S+2,N=1;I-1>N;++N)x=N/(I-1),M=e.lerp(U,L,x,p),P[D++]=M.x,P[D++]=M.y,P[D++]=M.z;P[D++]=L.x,P[D++]=L.y,P[D++]=L.z}o&&(B[F--]=U.z,B[F--]=U.y,B[F--]=U.x,B[j++]=L.x,B[j++]=L.y,B[j++]=L.z),R=t.PI_OVER_TWO-(S+1)*g}for(S=A;S>1;--S){if(R=t.PI_OVER_TWO-(S-1)*g,U=i(-R,s,b,T,E,v,O,_,w,U),L=i(R+Math.PI,s,b,T,E,v,O,_,w,L),n){for(P[D++]=U.x,P[D++]=U.y,P[D++]=U.z,I=2*(S-1)+2,N=1;I-1>N;++N)x=N/(I-1),M=e.lerp(U,L,x,p),P[D++]=M.x,P[D++]=M.y,P[D++]=M.z;P[D++]=L.x,P[D++]=L.y,P[D++]=L.z}o&&(B[F--]=U.z,B[F--]=U.y,B[F--]=U.x,B[j++]=L.x,B[j++]=L.y,B[j++]=L.z)}R=t.PI_OVER_TWO,U=i(-R,s,b,T,E,v,O,_,w,U);var z={};return n&&(P[D++]=U.x,P[D++]=U.y,P[D++]=U.z,z.positions=P,z.numPts=A),o&&(B[F--]=U.z,B[F--]=U.y,B[F--]=U.x,z.outerPositions=B),z},o}),define("Core/GeometryOffsetAttribute",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,TOP:1,ALL:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,r,n,i,o){"use strict";function a(e,t,n,i){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(t,0),this[3]=r(i,0)}a.packedLength=4,a.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},a.unpack=function(e,i,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new a),o[0]=e[i++],o[1]=e[i++],o[2]=e[i++],o[3]=e[i++],o},a.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3]):void 0},a.fromArray=function(e,i,o){return t.defined("array",e),i=r(i,0),n(o)||(o=new a),o[0]=e[i],o[1]=e[i+1],o[2]=e[i+2],o[3]=e[i+3],o},a.fromColumnMajorArray=function(e,r){return t.defined("values",e),a.clone(e,r)},a.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3],r):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=e.y,r):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=e,r):new a(e,0,0,e)},a.fromRotation=function(e,r){t.typeOf.number("angle",e);var i=Math.cos(e),o=Math.sin(e);return n(r)?(r[0]=i,r[1]=o,r[2]=-o,r[3]=i,r):new a(i,-o,o,i)},a.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):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,r){return t.typeOf.number.greaterThanOrEquals("row",r,0),t.typeOf.number.lessThanOrEquals("row",r,1),t.typeOf.number.greaterThanOrEquals("column",e,0),t.typeOf.number.lessThanOrEquals("column",e,1),2*e+r},a.getColumn=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("result",n);var i=2*r,o=e[i],a=e[i+1];return n.x=o,n.y=a,n},a.setColumn=function(e,r,n,i){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=a.clone(e,i);var o=2*r;return i[o]=n.x,i[o+1]=n.y,i},a.getRow=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("result",n);var i=e[r],o=e[r+2];return n.x=i,n.y=o,n},a.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,1),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=a.clone(e,i),i[r]=n.x,i[r+2]=n.y,i};var u=new e;a.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],u)),n.y=e.magnitude(e.fromElements(r[2],r[3],u)),n};var s=new e;return a.getMaximumScale=function(t){return a.getScale(t,s),e.maximumComponent(s)},a.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[2]*r[1],o=e[0]*r[2]+e[2]*r[3],a=e[1]*r[0]+e[3]*r[1],u=e[1]*r[2]+e[3]*r[3];return n[0]=i,n[1]=a,n[2]=o,n[3]=u,n},a.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},a.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},a.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var i=e[0]*r.x+e[2]*r.y,o=e[1]*r.x+e[3]*r.y;return n.x=i,n.y=o,n},a.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},a.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.y,n[3]=e[3]*r.y,n},a.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},a.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[2],o=e[1],a=e[3];return r[0]=n,r[1]=i,r[2]=o,r[3]=a,r},a.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},a.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]},a.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},a.equalsEpsilon=function(e,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},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,i(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/binarySearch",["./Check"],function(e){"use strict";function t(t,r,n){e.defined("array",t),e.defined("itemToFind",r),e.defined("comparator",n);for(var i,o,a=0,u=t.length-1;u>=a;)if(i=~~((a+u)/2),o=n(t[i],r),0>o)a=i+1;else{if(!(o>0))return i;u=i-1}return~(u+1)}return t}),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},o=function(e,t,r,n,o,a){var u=n-e.length;return u>0&&(e=r||!o?i(e,n,a,r):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,n,a,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),o(e,r,n,a,s)},u=function(e,t,r,n,i,a){return null!=n&&(e=e.slice(0,n)),o(e,"",t,r,i,a)},s=function(e,n,s,c,l,f,p){var d,h,y,m,E;if("%%"==e)return"%";for(var O=!1,v="",_=!1,w=!1,T=" ",b=s.length,A=0;s&&b>A;A++)switch(s.charAt(A)){case" ":v=" ";break;case"+":v="+";break;case"-":O=!0;break;case"'":T=s.charAt(A+1);break;case"0":_=!0;break;case"#":w=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,O=!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(p)>-1?6:"d"==p?0:void 0,E=n?t[n.slice(0,-1)]:t[r++],p){case"s":return u(String(E),O,c,f,_,T);case"c":return u(String.fromCharCode(+E),O,c,f,_);case"b":return a(E,2,w,O,c,f,_);case"o":return a(E,8,w,O,c,f,_);case"x":return a(E,16,w,O,c,f,_);case"X":return a(E,16,w,O,c,f,_).toUpperCase();case"u":return a(E,10,w,O,c,f,_);case"i":case"d":return d=+E||0,d=Math.round(d-d%1),h=0>d?"-":v,E=h+i(String(Math.abs(d)),f,"0",!1),o(E,h,O,c,_);case"e":case"E":case"f":case"F":case"g":case"G":return d=+E,h=0>d?"-":v,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(p.toLowerCase())], m=["toString","toUpperCase"]["eEfFgG".indexOf(p)%2],E=h+Math.abs(d)[y](f),o(E,h,O,c,_)[m]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,i,o,a,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=i,this.second=o,this.millisecond=a,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,o,a,u,s,c){"use strict";function l(e,t){return y.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var r=y.leapSeconds,n=t(r,v,l);0>n&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var o=y.secondsDifference(r[n].julianDate,e);o>i&&(n--,i=r[n].offset)}y.addSeconds(e,i,e)}function p(e,r){v.julianDate=e;var n=y.leapSeconds,i=t(n,v,l);if(0>i&&(i=~i),0===i)return y.addSeconds(e,-n[0].offset,r);if(i>=n.length)return y.addSeconds(e,-n[i-1].offset,r);var o=y.secondsDifference(n[i].julianDate,e);return 0===o?y.addSeconds(e,-n[i].offset,r):1>=o?void 0:y.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,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function h(e,t,r,n,i,o,a){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,0>n&&(n+=24);var f=o+(n*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+a*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function y(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 m=new o,E=[31,28,31,30,31,30,31,31,30,31,30,31],O=29,v=new u,_=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,T=/^(\d{4})-?(\d{3})$/,b=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,A=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,R=/^(\d{2})(\.\d+)?/.source+g.source,S=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,N=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,I="Invalid ISO 8601 date.";y.fromGregorianDate=function(e,t){if(!(e instanceof o))throw new i("date must be a valid GregorianDate.");var r=h(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return n(t)?(d(r[0],r[1],t),f(t),t):new y(r[0],r[1],c.UTC)},y.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new i("date must be a valid JavaScript Date.");var r=h(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 y(r[0],r[1],c.UTC)},y.fromIso8601=function(e,t){if("string"!=typeof e)throw new i(I);e=e.replace(",",".");var r,o,u,s=e.split("T"),l=1,p=1,m=0,v=0,g=0,x=0,M=s[0],C=s[1];if(!n(M))throw new i(I);var P;if(s=M.match(A),null!==s){if(P=M.split("-").length-1,P>0&&2!==P)throw new i(I);r=+s[1],l=+s[2],p=+s[3]}else if(s=M.match(w),null!==s)r=+s[1],l=+s[2];else if(s=M.match(_),null!==s)r=+s[1];else{var D;if(s=M.match(T),null!==s){if(r=+s[1],D=+s[2],u=a(r),1>D||u&&D>366||!u&&D>365)throw new i(I)}else{if(s=M.match(b),null===s)throw new i(I);r=+s[1];var U=+s[2],L=+s[3]||0;if(P=M.split("-").length-1,P>0&&(!n(s[3])&&1!==P||n(s[3])&&2!==P))throw new i(I);var q=new Date(Date.UTC(r,0,4));D=7*U+L-q.getUTCDay()-3}o=new Date(Date.UTC(r,0,1)),o.setUTCDate(D),l=o.getUTCMonth()+1,p=o.getUTCDate()}if(u=a(r),1>l||l>12||1>p||(2!==l||!u)&&p>E[l-1]||u&&2===l&&p>O)throw new i(I);var F;if(n(C)){if(s=C.match(N),null!==s){if(P=C.split(":").length-1,P>0&&2!==P&&3!==P)throw new i(I);m=+s[1],v=+s[2],g=+s[3],x=1e3*+(s[4]||0),F=5}else if(s=C.match(S),null!==s){if(P=C.split(":").length-1,P>2)throw new i(I);m=+s[1],v=+s[2],g=60*+(s[3]||0),F=4}else{if(s=C.match(R),null===s)throw new i(I);m=+s[1],v=60*+(s[2]||0),F=3}if(v>=60||g>=61||m>24||24===m&&(v>0||g>0||x>0))throw new i(I);var j=s[F],B=+s[F+1],z=+(s[F+2]||0);switch(j){case"+":m-=B,v-=z;break;case"-":m+=B,v+=z;break;case"Z":break;default:v+=new Date(Date.UTC(r,l-1,p,m,v)).getTimezoneOffset()}}var G=60===g;for(G&&g--;v>=60;)v-=60,m++;for(;m>=24;)m-=24,p++;for(o=u&&2===l?O:E[l-1];p>o;)p-=o,l++,l>12&&(l-=12,r++),o=u&&2===l?O:E[l-1];for(;0>v;)v+=60,m--;for(;0>m;)m+=24,p--;for(;1>p;)l--,1>l&&(l+=12,r--),o=u&&2===l?O:E[l-1],p+=o;var V=h(r,l,p,m,v,g,x);return n(t)?(d(V[0],V[1],t),f(t)):t=new y(V[0],V[1],c.UTC),G&&y.addSeconds(t,1,t),t},y.now=function(e){return y.fromDate(new Date,e)};var x=new y(0,0,c.TAI);return y.toGregorianDate=function(e,t){if(!n(e))throw new i("julianDate is required.");var r=!1,a=p(e,x);n(a)||(y.addSeconds(e,-1,x),a=p(x,x),r=!0);var u=a.dayNumber,c=a.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 h=80*l/2447|0,m=l-(2447*h/80|0)|0;l=h/11|0;var E=h+2-12*l|0,O=100*(f-49)+d+l|0,v=c/s.SECONDS_PER_HOUR|0,_=c-v*s.SECONDS_PER_HOUR,w=_/s.SECONDS_PER_MINUTE|0;_-=w*s.SECONDS_PER_MINUTE;var T=0|_,b=(_-T)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(T+=1),n(t)?(t.year=O,t.month=E,t.day=m,t.hour=v,t.minute=w,t.second=T,t.millisecond=b,t.isLeapSecond=r,t):new o(O,E,m,v,w,T,b,r)},y.toDate=function(e){if(!n(e))throw new i("julianDate is required.");var t=y.toGregorianDate(e,m),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},y.toIso8601=function(t,r){if(!n(t))throw new i("julianDate is required.");var o=y.toGregorianDate(t,m),a=o.year,u=o.month,s=o.day,c=o.hour,l=o.minute,f=o.second,p=o.millisecond;1e4===a&&1===u&&1===s&&0===c&&0===l&&0===f&&0===p&&(a=9999,u=12,s=31,c=24);var d;return n(r)||0===p?n(r)&&0!==r?(d=(.01*p).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a,u,s,c,l,f,d)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a,u,s,c,l,f):(d=(.01*p).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a,u,s,c,l,f,d))},y.clone=function(e,t){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new y(e.dayNumber,e.secondsOfDay,c.TAI):void 0},y.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},y.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},y.equalsEpsilon=function(e,t,r){if(!n(r))throw new i("epsilon is required.");return e===t||n(e)&&n(t)&&Math.abs(y.secondsDifference(e,t))<=r},y.totalDays=function(e){if(!n(e))throw new i("julianDate is required.");return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},y.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)},y.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,o=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+o},y.computeTaiMinusUtc=function(e){v.julianDate=e;var r=y.leapSeconds,n=t(r,v,l);return 0>n&&(n=~n,--n,0>n&&(n=0)),r[n].offset},y.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)},y.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 o=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,o,r)},y.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 o=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,o,r)},y.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 o=e.dayNumber+t;return d(o,e.secondsOfDay,r)},y.lessThan=function(e,t){return y.compare(e,t)<0},y.lessThanOrEquals=function(e,t){return y.compare(e,t)<=0},y.greaterThan=function(e,t){return y.compare(e,t)>0},y.greaterThanOrEquals=function(e,t){return y.compare(e,t)>=0},y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return y.toIso8601(this)},y.leapSeconds=[new u(new y(2441317,43210,c.TAI),10),new u(new y(2441499,43211,c.TAI),11),new u(new y(2441683,43212,c.TAI),12),new u(new y(2442048,43213,c.TAI),13),new u(new y(2442413,43214,c.TAI),14),new u(new y(2442778,43215,c.TAI),15),new u(new y(2443144,43216,c.TAI),16),new u(new y(2443509,43217,c.TAI),17),new u(new y(2443874,43218,c.TAI),18),new u(new y(2444239,43219,c.TAI),19),new u(new y(2444786,43220,c.TAI),20),new u(new y(2445151,43221,c.TAI),21),new u(new y(2445516,43222,c.TAI),22),new u(new y(2446247,43223,c.TAI),23),new u(new y(2447161,43224,c.TAI),24),new u(new y(2447892,43225,c.TAI),25),new u(new y(2448257,43226,c.TAI),26),new u(new y(2448804,43227,c.TAI),27),new u(new y(2449169,43228,c.TAI),28),new u(new y(2449534,43229,c.TAI),29),new u(new y(2450083,43230,c.TAI),30),new u(new y(2450630,43231,c.TAI),31),new u(new y(2451179,43232,c.TAI),32),new u(new y(2453736,43233,c.TAI),33),new u(new y(2454832,43234,c.TAI),34),new u(new y(2456109,43235,c.TAI),35),new u(new y(2457204,43236,c.TAI),36),new u(new y(2457754,43237,c.TAI),37)],y}),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 o.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(a,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,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],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/appendForwardSlash",[],function(){"use strict";function e(e){return(0===e.length||"/"!==e[e.length-1])&&(e+="/"),e}return e}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var i=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];n&&(a=t(a,n)),i[o]=a}return i}return t}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function r(n,i,o){o=e(o,!1);var a,u,s,c={},l=t(n),f=t(i);if(l)for(a in n)n.hasOwnProperty(a)&&(u=n[a],f&&o&&"object"==typeof u&&i.hasOwnProperty(a)?(s=i[a],"object"==typeof s?c[a]=r(u,s,o):c[a]=u):c[a]=u);if(f)for(a in i)i.hasOwnProperty(a)&&!c.hasOwnProperty(a)&&(s=i[a],c[a]=s);return c}return r}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(e,t){var r;return"undefined"!=typeof document&&(r=document),i._implementation(e,t,r)}return i._implementation=function(i,o,a){if(!r(i))throw new n("relative uri is required.");if(!r(o)){if("undefined"==typeof a)return i;o=t(a.baseURI,a.location.href)}var u=new e(o),s=new e(i);return s.resolve(u).toString()},i}),define("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(n,i){if(!t(n))throw new r("uri is required.");var o="",a=n.lastIndexOf("/");return-1!==a&&(o=n.substring(0,a+1)),i?(n=new e(n),t(n.query)&&(o+="?"+n.query),t(n.fragment)&&(o+="#"+n.fragment),o):o}return n}),define("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(n){if(!t(n))throw new r("uri is required.");var i=new e(n);i.normalize();var o=i.path,a=o.lastIndexOf("/");return-1!==a&&(o=o.substr(a+1)),a=o.lastIndexOf("."),o=-1===a?"":o.substr(a+1)}return n}),define("Core/isBlobUri",["./Check"],function(e){"use strict";function t(t){return e.typeOf.string("uri",t),r.test(t)}var r=/^blob:/i;return t}),define("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(r)||(r=document.createElement("a")),r.href=window.location.href;var n=r.host,i=r.protocol;return r.href=t,r.href=r.href,i!==r.protocol||n!==r.host}var r;return t}),define("Core/isDataUri",["./Check"],function(e){"use strict";function t(t){return e.typeOf.string("uri",t),r.test(t)}var r=/^data:/i;return t}),define("Core/loadAndExecuteScript",["../ThirdParty/when"],function(e){"use strict";function t(t){var r=e.defer(),n=document.createElement("script");n.async=!0,n.src=t;var i=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,i.removeChild(n),r.resolve()},n.onerror=function(e){r.reject(e)},i.appendChild(n),r.promise}return t}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function n(n){if(!e(n))throw new t("obj is required.");var i="";for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=encodeURIComponent(o)+"=";if(r(a))for(var s=0,c=a.length;c>s;++s)i+=u+encodeURIComponent(a[s])+"&";else i+=u+encodeURIComponent(a)+"&"}return i=i.slice(0,-1)}return n}),define("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function n(n){if(!e(n))throw new t("queryString is required.");var i={};if(""===n)return i;for(var o=n.replace(/\+/g,"%20").split(/[&;]/),a=0,u=o.length;u>a;++a){var s=o[a].split("="),c=decodeURIComponent(s[0]),l=s[1];l=e(l)?decodeURIComponent(l):"";var f=i[c];"string"==typeof f?i[c]=[f,l]:r(f)?f.push(l):i[c]=l}return i}return n}),define("Core/RequestState",["../Core/freezeObject"],function(e){"use strict";var t={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};return e(t)}),define("Core/RequestType",["../Core/freezeObject"],function(e){"use strict";var t={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};return e(t)}),define("Core/Request",["./defaultValue","./defined","./RequestState","./RequestType"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.throttleByServer,!1),o=e(t.throttle,!1);this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=e(t.priority,0),this.throttle=o,this.throttleByServer=i,this.type=e(t.type,n.OTHER),this.serverKey=void 0,this.state=r.UNISSUED,this.deferred=void 0,this.cancelled=!1}return i.prototype.cancel=function(){this.cancelled=!0},i.prototype.clone=function(e){return t(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new i(this)},i}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n0){var a=i.substring(0,o),u=i.substring(o+2);t[a]=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("Core/Event",["./Check","./defined","./defineProperties"],function(e,t,r){"use strict";function n(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function i(e,t){return t-e}return r(n.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),n.prototype.addEventListener=function(t,r){e.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(r);var n=this;return function(){n.removeEventListener(t,r)}},n.prototype.removeEventListener=function(t,r){e.typeOf.func("listener",t);for(var n=this._listeners,i=this._scopes,o=-1,a=0;ae;e++){var a=r[e];t(a)&&r[e].apply(n[e],arguments)}var u=this._toRemove;if(o=u.length,o>0){for(u.sort(i),e=0;o>e;e++){var s=u[e];r.splice(s,1),n.splice(s,1)}u.length=0}this._insideRaiseEvent=!1},n}),define("Core/Heap",["./Check","./defaultValue","./defined","./defineProperties"],function(e,t,r,n){"use strict";function i(t){e.typeOf.object("options",t),e.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function o(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}return n(i.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),i.prototype.reserve=function(e){e=t(e,this._length),this._array.length=e},i.prototype.heapify=function(e){e=t(e,0);for(var r=this._length,n=this._comparator,i=this._array,a=-1,u=!0;u;){var s=2*(e+1),c=s-1;a=r>c&&n(i[c],i[e])<0?c:e,r>s&&n(i[s],i[a])<0&&(a=s),a!==e?(o(i,a,e),e=a):u=!1}},i.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},i.prototype.insert=function(t){e.defined("element",t);var n=this._array,i=this._comparator,a=this._maximumLength,u=this._length++;for(ua&&(c=n[a],this._length=a),c},i.prototype.pop=function(r){if(r=t(r,0),0!==this._length){e.typeOf.number.lessThan("index",r,this._length);var n=this._array,i=n[r];return o(n,r,--this._length),this.heapify(r),i}},i}),define("Core/RequestScheduler",["../ThirdParty/Uri","../ThirdParty/when","./Check","./defaultValue","./defined","./defineProperties","./Event","./Heap","./isBlobUri","./isDataUri","./RequestState"],function(e,t,r,n,i,o,a,u,s,c,l){"use strict";function f(e,t){return e.priority-t.priority}function p(){}function d(e){i(e.priorityFunction)&&(e.priority=e.priorityFunction())}function h(e){var t=n(p.requestsByServer[e],p.maximumRequestsPerServer);return g[e]0&&(w.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+w.numberOfAttemptedRequests),w.numberOfAttemptedRequests=0),w.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+w.numberOfCancelledRequests),w.numberOfCancelledRequests=0),w.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+w.numberOfCancelledActiveRequests),w.numberOfCancelledActiveRequests=0),w.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+w.numberOfFailedRequests),w.numberOfFailedRequests=0)),w.lastNumberOfActiveRequests=w.numberOfActiveRequests)}var w={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},T=20,b=new u({comparator:f});b.maximumLength=T,b.reserve(T);var A=[],g={},R="undefined"!=typeof document?new e(document.location.href):new e,S=new a;return p.maximumRequests=50,p.maximumRequestsPerServer=6,p.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},p.throttleRequests=!0,p.debugShowStatistics=!1,p.requestCompletedEvent=S,o(p,{statistics:{get:function(){return w}},priorityHeapLength:{get:function(){return T},set:function(e){if(T>e)for(;b.length>e;){var t=b.pop();v(t)}T=e,b.maximumLength=e,b.reserve(e)}}}),p.update=function(){var e,t,r=0,n=A.length;for(e=0;n>e;++e)t=A[e],t.cancelled&&v(t),t.state===l.ACTIVE?r>0&&(A[e-r]=t):++r;A.length-=r;var i=b.internalArray,o=b.length;for(e=0;o>e;++e)d(i[e]);b.resort();for(var a=Math.max(p.maximumRequests-A.length,0),u=0;a>u&&b.length>0;)t=b.pop(),t.cancelled?v(t):!t.throttleByServer||h(t.serverKey)?(O(t),++u):v(t);_()},p.getServerKey=function(t){r.typeOf.string("url",t);var n=new e(t).resolve(R);n.normalize();var o=n.authority;/:/.test(o)||(o=o+":"+("https"===n.scheme?"443":"80"));var a=g[o];return i(a)||(g[o]=0),o},p.request=function(e){if(r.typeOf.object("request",e),r.typeOf.string("request.url",e.url),r.typeOf.func("request.requestFunction",e.requestFunction),c(e.url)||s(e.url))return S.raiseEvent(),e.state=l.RECEIVED,e.requestFunction();if(++w.numberOfAttemptedRequests,i(e.serverKey)||(e.serverKey=p.getServerKey(e.url)),!e.throttleByServer||h(e.serverKey)){if(!p.throttleRequests||!e.throttle)return O(e);if(!(A.length>=p.maximumRequests)){d(e);var t=b.insert(e);if(i(t)){if(t===e)return;v(t)}return y(e)}}},p.clearForSpecs=function(){for(;b.length>0;){var e=b.pop();v(e)}for(var t=A.length,r=0;t>r;++r)v(A[r]);A.length=0,g={},w.numberOfAttemptedRequests=0,w.numberOfActiveRequests=0,w.numberOfCancelledRequests=0,w.numberOfCancelledActiveRequests=0,w.numberOfFailedRequests=0,w.numberOfActiveRequestsEver=0,w.lastNumberOfActiveRequests=0},p.numberOfActiveRequestsByServer=function(e){return g[e]},p.requestHeap=b,p}),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(-1!==i.indexOf("@")){var o=i.split("@");i=o[1]}if(-1===i.indexOf(":")){var a=n.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)i+=":80";else{if("https"!==a)return;i+=":443"}}return i}}var i={},o={};return i.add=function(e,n){if(!t(e))throw new r("host is required.");if(!t(n)||0>=n)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(o[i])||(o[i]=!0)},i.remove=function(e,n){if(!t(e))throw new r("host is required.");if(!t(n)||0>=n)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(o[i])&&delete o[i]},i.contains=function(e){if(!t(e))throw new r("url is required.");var i=n(e);return t(i)&&t(o[i])?!0:!1},i.clear=function(){o={}},i}),define("Core/Resource",["../ThirdParty/Uri","../ThirdParty/when","./appendForwardSlash","./Check","./clone","./combine","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./getAbsoluteUri","./getBaseUri","./getExtensionFromUri","./isBlobUri","./isCrossOriginUrl","./isDataUri","./loadAndExecuteScript","./objectToQuery","./queryToObject","./Request","./RequestErrorEvent","./RequestScheduler","./RequestState","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,o,a,u,s,c,l,f,p,d,h,y,m,E,O,v,_,w,T,b,A,g){"use strict";function R(e,t,r,n){var i=e.query;if(!u(i)||0===i.length)return{};var o;if(-1===i.indexOf("=")){var a={};a[i]=void 0,o=a}else o=v(i);r?t._queryParameters=x(o,t._queryParameters,n):t._queryParameters=o,e.query=void 0}function S(e,t){var r=t._queryParameters,n=Object.keys(r);1!==n.length||u(r[n[0]])?e.query=O(r):e.query=n[0]}function N(e,t){return u(e)?u(e.clone)?e.clone():i(e):t}function I(e){if(e.state===b.ISSUED||e.state===b.ACTIVE)throw new A("The Resource is already being fetched.");e.state=b.UNISSUED,e.deferred=void 0}function x(e,t,r){if(!r)return o(e,t);var n=i(e,!0);for(var a in t)if(t.hasOwnProperty(a)){var s=n[a],c=t[a];u(s)?(Array.isArray(s)||(s=n[a]=[s]),n[a]=s.concat(c)):n[a]=Array.isArray(c)?c.slice():c}return n}function M(t){t=a(t,a.EMPTY_OBJECT),"string"==typeof t&&(t={url:t}),n.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=N(t.templateValues,{}),this._queryParameters=N(t.queryParameters,{}),this.headers=N(t.headers,{}),this.request=a(t.request,new _),this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=a(t.retryAttempts,0),this._retryCount=0;var r=new e(t.url);R(r,this,!0,!0),r.fragment=void 0,this._url=r.toString()}function C(e){var r=e.resource,n=e.flipY,i=e.preferImageBitmap,o=r.request;o.url=r.url,o.requestFunction=function(){var e=r.url,o=!1;r.isDataUri||r.isBlobUri||(o=r.isCrossOriginUrl);var a=t.defer();return M._Implementations.createImage(e,o,a,n,i),a.promise};var a=T.request(o);return u(a)?a.otherwise(function(e){return o.state!==b.FAILED?t.reject(e):r.retryOnError(e).then(function(a){return a?(o.state=b.UNISSUED,o.deferred=void 0,C({resource:r,flipY:n,preferImageBitmap:i})):t.reject(e)})}):void 0}function P(e,r,n){var i={};i[r]=n,e.setQueryParameters(i);var o=e.request;o.url=e.url,o.requestFunction=function(){var r=t.defer();return window[n]=function(e){r.resolve(e);try{delete window[n]}catch(t){window[n]=void 0}},M._Implementations.loadAndExecuteScript(e.url,n,r),r.promise};var a=T.request(o);return u(a)?a.otherwise(function(i){return o.state!==b.FAILED?t.reject(i):e.retryOnError(i).then(function(a){return a?(o.state=b.UNISSUED,o.deferred=void 0,P(e,r,n)):t.reject(i)})}):void 0}function D(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function U(e,t){for(var r=D(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),o=0;o=300)return void o.reject(new w(e.statusCode,e,e.headers));var r=[];e.on("data",function(e){r.push(e)}),e.on("end",function(){var n=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(n,function(e,r){e?o.reject(new A("Error decompressing response.")):o.resolve(F(r,t))}):o.resolve(F(n,t))})}).on("error",function(e){o.reject(new w)}).end()}var B=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();M.createIfNeeded=function(e){return e instanceof M?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new M({url:e})};var z;M.supportsImageBitmapOptions=function(){if(u(z))return z;if("function"!=typeof createImageBitmap)return z=t.resolve(!1);var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg==";return z=M.fetchBlob({url:e}).then(function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})}).then(function(e){return!0}).otherwise(function(){return!1})},s(M,{isBlobSupported:{get:function(){return B}}}),s(M.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){var r=new e(t);R(r,this,!1),r.fragment=void 0,this._url=r.toString()}},extension:{get:function(){return d(this._url)}},isDataUri:{get:function(){return m(this._url)}},isBlobUri:{get:function(){return h(this._url)}},isCrossOriginUrl:{ get:function(){return y(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),M.prototype.getUrlComponent=function(t,r){if(this.isDataUri)return this._url;var n=new e(this._url);t&&S(n,this);var i=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),o=this._templateValues;return i=i.replace(/{(.*?)}/g,function(e,t){var r=o[t];return u(r)?encodeURIComponent(r):e}),r&&u(this.proxy)&&(i=this.proxy.getURL(i)),i},M.prototype.setQueryParameters=function(e,t){t?this._queryParameters=x(this._queryParameters,e,!1):this._queryParameters=x(e,this._queryParameters,!1)},M.prototype.appendQueryParameters=function(e){this._queryParameters=x(e,this._queryParameters,!0)},M.prototype.setTemplateValues=function(e,t){t?this._templateValues=o(this._templateValues,e):this._templateValues=o(e,this._templateValues)},M.prototype.getDerivedResource=function(t){var r=this.clone();if(r._retryCount=0,u(t.url)){var n=new e(t.url),i=a(t.preserveQueryParameters,!1);R(n,r,!0,i),n.fragment=void 0,r._url=n.resolve(new e(f(this._url))).toString()}return u(t.queryParameters)&&(r._queryParameters=o(t.queryParameters,r._queryParameters)),u(t.templateValues)&&(r._templateValues=o(t.templateValues,r.templateValues)),u(t.headers)&&(r.headers=o(t.headers,r.headers)),u(t.proxy)&&(r.proxy=t.proxy),u(t.request)&&(r.request=t.request),u(t.retryCallback)&&(r.retryCallback=t.retryCallback),u(t.retryAttempts)&&(r.retryAttempts=t.retryAttempts),r},M.prototype.retryOnError=function(e){var r=this.retryCallback;if("function"!=typeof r||this._retryCount>=this.retryAttempts)return t(!1);var n=this;return t(r(this,e)).then(function(e){return++n._retryCount,e})},M.prototype.clone=function(e){return u(e)||(e=new M({url:this._url})),e._url=this._url,e._queryParameters=i(this._queryParameters),e._templateValues=i(this._templateValues),e.headers=i(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},M.prototype.getBaseUri=function(e){return p(this.getUrlComponent(e),e)},M.prototype.appendForwardSlash=function(){this._url=r(this._url)},M.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},M.fetchArrayBuffer=function(e){var t=new M(e);return t.fetchArrayBuffer()},M.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},M.fetchBlob=function(e){var t=new M(e);return t.fetchBlob()},M.prototype.fetchImage=function(e){e=a(e,a.EMPTY_OBJECT);var r=a(e.preferImageBitmap,!1),n=a(e.preferBlob,!1),i=a(e.flipY,!1);if(I(this.request),!B||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return C({resource:this,flipY:i,preferImageBitmap:r});var o=this.fetchBlob();if(u(o)){var s,c,l,f;return M.supportsImageBitmapOptions().then(function(e){return s=e,c=s&&r,o}).then(function(e){if(u(e)){if(f=e,c)return M.createImageBitmapFromBlob(e,{flipY:i,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return l=new M({url:t}),C({resource:l,flipY:i,preferImageBitmap:!1})}}).then(function(e){return u(e)?(e.blob=f,c?e:(window.URL.revokeObjectURL(l.url),e)):void 0}).otherwise(function(e){return u(l)&&window.URL.revokeObjectURL(l.url),e.blob=f,t.reject(e)})}},M.fetchImage=function(e){var t=new M(e);return t.fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},M.prototype.fetchText=function(){return this.fetch({responseType:"text"})},M.fetchText=function(e){var t=new M(e);return t.fetchText()},M.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(u(e))return e.then(function(e){return u(e)?JSON.parse(e):void 0})},M.fetchJson=function(e){var t=new M(e);return t.fetchJson()},M.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},M.fetchXML=function(e){var t=new M(e);return t.fetchXML()},M.prototype.fetchJsonp=function(e){e=a(e,"callback"),I(this.request);var t;do t="loadJsonp"+Math.random().toString().substring(2,8);while(u(window[t]));return P(this,e,t)},M.fetchJsonp=function(e){var t=new M(e);return t.fetchJsonp(e.callbackParameterName)},M.prototype._makeRequest=function(e){var r=this;I(r.request);var n=r.request;n.url=r.url,n.requestFunction=function(){var i=e.responseType,a=o(e.headers,r.headers),s=e.overrideMimeType,c=e.method,l=e.data,f=t.defer(),p=M._Implementations.loadWithXhr(r.url,i,c,l,a,f,s);return u(p)&&u(p.abort)&&(n.cancelFunction=function(){p.abort()}),f.promise};var i=T.request(n);return u(i)?i.then(function(e){return e}).otherwise(function(i){return n.state!==b.FAILED?t.reject(i):r.retryOnError(i).then(function(o){return o?(n.state=b.UNISSUED,n.deferred=void 0,r.fetch(e)):t.reject(i)})}):void 0};var G=/^data:(.*?)(;base64)?,(.*)$/;M.prototype.fetch=function(e){return e=N(e,{}),e.method="GET",this._makeRequest(e)},M.fetch=function(e){var t=new M(e);return t.fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype["delete"]=function(e){return e=N(e,{}),e.method="DELETE",this._makeRequest(e)},M["delete"]=function(e){var t=new M(e);return t["delete"]({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},M.prototype.head=function(e){return e=N(e,{}),e.method="HEAD",this._makeRequest(e)},M.head=function(e){var t=new M(e);return t.head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.options=function(e){return e=N(e,{}),e.method="OPTIONS",this._makeRequest(e)},M.options=function(e){var t=new M(e);return t.options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.post=function(e,t){return n.defined("data",e),t=N(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},M.post=function(e){var t=new M(e);return t.post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.put=function(e,t){return n.defined("data",e),t=N(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},M.put=function(e){var t=new M(e);return t.put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M.prototype.patch=function(e,t){return n.defined("data",e),t=N(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},M.patch=function(e){var t=new M(e);return t.patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},M._Implementations={},M._Implementations.createImage=function(e,t,r,n,i){M.supportsImageBitmapOptions().then(function(n){return n&&i?M.fetchBlob({url:e}):void q(e,t,r)}).then(function(e){return u(e)?M.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1}):void 0}).then(function(e){u(e)&&r.resolve(e)}).otherwise(r.reject)},M.createImageBitmapFromBlob=function(e,t){return n.defined("options",t),n.typeOf.bool("options.flipY",t.flipY),n.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var V="undefined"==typeof XMLHttpRequest;return M._Implementations.loadWithXhr=function(e,t,r,n,i,o,a){var s=G.exec(e);if(null!==s)return void o.resolve(L(s,t));if(V)return void j(e,t,r,n,i,o,a);var c=new XMLHttpRequest;if(g.contains(e)&&(c.withCredentials=!0),e=e.replace(/{/g,"%7B").replace(/}/g,"%7D"),c.open(r,e,!0),u(a)&&u(c.overrideMimeType)&&c.overrideMimeType(a),u(i))for(var l in i)i.hasOwnProperty(l)&&c.setRequestHeader(l,i[l]);u(t)&&(c.responseType=t);var f=!1;return"string"==typeof e&&(f=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),c.onload=function(){if((c.status<200||c.status>=300)&&(!f||0!==c.status))return void o.reject(new w(c.status,c.response,c.getAllResponseHeaders()));var e=c.response,n=c.responseType;if("HEAD"===r||"OPTIONS"===r){var i=c.getAllResponseHeaders(),a=i.trim().split(/[\r\n]+/),s={};return a.forEach(function(e){var t=e.split(": "),r=t.shift();s[r]=t.join(": ")}),void o.resolve(s)}if(204===c.status)o.resolve();else if(!u(e)||u(t)&&n!==t)if("json"===t&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(l){o.reject(l)}else(""===n||"document"===n)&&u(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):""!==n&&"text"!==n||!u(c.responseText)?o.reject(new A("Invalid XMLHttpRequest response type.")):o.resolve(c.responseText);else o.resolve(e)},c.onerror=function(e){o.reject(new w)},c.send(n),c},M._Implementations.loadAndExecuteScript=function(e,t,r){return E(e,t).otherwise(r.reject)},M._DefaultImplementations={},M._DefaultImplementations.createImage=M._Implementations.createImage,M._DefaultImplementations.loadWithXhr=M._Implementations.loadWithXhr,M._DefaultImplementations.loadAndExecuteScript=M._Implementations.loadAndExecuteScript,M.DEFAULT=l(new M({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),M}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./Resource","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,o,a,u,s,c,l,f){"use strict";function p(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))h(this,t.data);else if(n(t.url)){var i=s.createIfNeeded(t.url),o=this;this._downloadPromise=e(i.fetchJson(),function(e){h(o,e)},function(){o._dataError="An error occurred while retrieving the EOP data from the URL "+i.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return a.compare(e.julianDate,t)}function h(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"),o=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),p=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),h=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>o||0>s||0>c||0>p||0>h||0>y)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=r.samples,E=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=p,e._yCelestialPoleOffsetRadiansColumn=h,e._taiMinusUtcSecondsColumn=y,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var O,v=e._addNewLeapSeconds,_=0,w=m.length;w>_;_+=e._columnCount){var T=m[_+i],b=m[_+y],A=T+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new a(A,b,f.TAI);if(E.push(g),v){if(b!==O&&n(O)){var R=a.leapSeconds,S=t(R,g,d);if(0>S){var N=new u(g,b);R.splice(~S,0,N)}}O=b}}}function y(e,t,r,n,i){var o=r*n;i.xPoleWander=t[o+e._xPoleWanderRadiansColumn],i.yPoleWander=t[o+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function m(e,t,r){return t+e*(r-t)}function E(e,t,r,n,i,o,u){var s=e._columnCount;if(o>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[o];if(c.equals(l)||n.equals(c))return y(e,r,i,s,u),u;if(n.equals(l))return y(e,r,o,s,u),u;var f=a.secondsDifference(n,c)/a.secondsDifference(l,c),p=i*s,d=o*s,h=r[p+e._ut1MinusUtcSecondsColumn],E=r[d+e._ut1MinusUtcSecondsColumn],O=E-h;if(O>.5||-.5>O){var v=r[p+e._taiMinusUtcSecondsColumn],_=r[d+e._taiMinusUtcSecondsColumn];v!==_&&(l.equals(n)?h=E:E-=_-v)}return u.xPoleWander=m(f,r[p+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[p+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[p+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[p+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,h,E),u}return p.NONE=o({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}}),p.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},p.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 o=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=o[u],p=o[u+1],d=a.lessThanOrEquals(f,e),h=!n(p),y=h||a.greaterThanOrEquals(p,e);if(d&&y)return s=u,!h&&p.equals(e)&&++s,l=s+1,E(this,o,this._samples,e,s,l,r),r}var m=t(o,e,a.compare,this._dateColumn);return m>=0?(ms&&(s=0)),this._lastIndex=s,E(this,o,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},p}),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 o=2*(e.w*e.y-e.z*e.x),a=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,a),n.pitch=-Math.asin(o),n},i.fromDegrees=function(e,o,a,u){if(!t(e))throw new r("heading is required");if(!t(o))throw new r("pitch is required");if(!t(a))throw new r("roll is required");return t(u)||(u=new i),u.heading=e*n.RADIANS_PER_DEGREE,u.pitch=o*n.RADIANS_PER_DEGREE,u.roll=a*n.RADIANS_PER_DEGREE,u},i.clone=function(e,r){return t(e)?t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new i(e.heading,e.pitch,e.roll):void 0},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,o){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,i,o)&&n.equalsEpsilon(e.pitch,r.pitch,i,o)&&n.equalsEpsilon(e.roll,r.roll,i,o)},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/buildModuleUrl",["./defined","./DeveloperError","./getAbsoluteUri","./Resource","require"],function(e,t,r,n,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),i=h.exec(n);if(null!==i)return i[1]}}function a(t){return"undefined"==typeof document?t:(e(f)||(f=document.createElement("a")),f.href=t,f.href=f.href,f.href)}function u(){if(e(p))return p;var u;if(u="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:e(define.amd)&&!define.amd.toUrlUndefined&&e(i.toUrl)?r("..",l("Core/buildModuleUrl.js")):o(),!e(u))throw new t("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return p=new n({url:a(u)}),p.appendForwardSlash(),p}function s(e){return a(i.toUrl("../"+e))}function c(e){var t=u().getDerivedResource({url:e});return t.url}function l(t){e(d)||(d=e(define.amd)&&!define.amd.toUrlUndefined&&e(i.toUrl)?s:c);var r=d(t);return r}var f,p,d,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=h,l._buildModuleUrlFromBaseUrl=c,l._clearBaseResource=function(){p=void 0},l.setBaseUrl=function(e){p=n.DEFAULT.getDerivedResource({url:e})},l.getCesiumBaseUrl=u,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","./Resource","./TimeStandard"],function(e,t,r,n,i,o,a,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=a.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(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),s=Math.pow(this._stepSizeDays,t),c=0;t>=c;++c){n[c]=s,i[c]=c*this._stepSizeDays;for(var l=0;t>=l;++l)l!==c&&(n[c]*=c-l);n[c]=1/n[c]}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,o.daysDifference(n,e._sampleZeroDateTT)}function l(r,i){if(r._chunkDownloadsInProgress[i])return r._chunkDownloadsInProgress[i];var o=e.defer();r._chunkDownloadsInProgress[i]=o;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.getDerivedResource({templateValues:{0:i}}):new a({url:t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json")}),e(u.fetchJson(),function(e){r._chunkDownloadsInProgress[i]=!1;for(var t=r._samples,n=e.samples,a=i*r._samplesPerXysFile*3,u=0,s=n.length;s>u;++u)t[a+u]=n[u];o.resolve()}),o.promise}var f=new o(0,0,u.TAI);return s.prototype.preload=function(t,r,n,i){var o=c(this,t,r),a=c(this,n,i),u=o/this._stepSizeDays-this._interpolationOrder/2|0;0>u&&(u=0);var s=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,p=s/this._samplesPerXysFile|0,d=[],h=f;p>=h;++h)d.push(l(this,h));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var o=c(this,e,t);if(!(0>o)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var u=this._interpolationOrder,s=a-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(s=0));var p=!1,d=this._samples;if(n(d[3*s])||(l(this,s/this._samplesPerXysFile|0),p=!0),n(d[3*f])||(l(this,f/this._samplesPerXysFile|0),p=!0),!p){n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var h,y,m=o-s*this._stepSizeDays,E=this._work,O=this._denominators,v=this._coef,_=this._xTable;for(h=0;u>=h;++h)E[h]=m-_[h];for(h=0;u>=h;++h){for(v[h]=1,y=0;u>=y;++y)y!==h&&(v[h]*=E[y]);v[h]*=O[h];var w=3*(s+h);r.x+=v[h]*d[w++],r.y+=v[h]*d[w++],r.s+=v[h]*d[w]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,i,o,a,u,s,c,l,f,p,d,h,y,m,E,O,v,_){"use strict";var w={},T={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"}},b={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={},g={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},R=new r,S=new r,N=new r;w.localFrameToFixedFrameGenerator=function(e,t){if(!T.hasOwnProperty(e)||!T[e].hasOwnProperty(t))throw new s("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,i=T[e][t],o=e+t;return u(A[o])?n=A[o]:(n=function(n,o,c){if(!u(n))throw new s("origin is required.");if(u(c)||(c=new O),m.equalsEpsilon(n.x,0,m.EPSILON14)&&m.equalsEpsilon(n.y,0,m.EPSILON14)){var l=m.sign(n.z);r.unpack(b[e],0,R),"east"!==e&&"west"!==e&&r.multiplyByScalar(R,l,R),r.unpack(b[t],0,S),"east"!==t&&"west"!==t&&r.multiplyByScalar(S,l,S),r.unpack(b[i],0,N),"east"!==i&&"west"!==i&&r.multiplyByScalar(N,l,N)}else{o=a(o,f.WGS84),o.geodeticSurfaceNormal(n,g.up);var p=g.up,d=g.east;d.x=-n.y,d.y=n.x,d.z=0,r.normalize(d,g.east),r.cross(p,d,g.north),r.multiplyByScalar(g.up,-1,g.down),r.multiplyByScalar(g.east,-1,g.west),r.multiplyByScalar(g.north,-1,g.south),R=g[e],S=g[t],N=g[i]}return c[0]=R.x,c[1]=R.y,c[2]=R.z,c[3]=0,c[4]=S.x,c[5]=S.y,c[6]=S.z,c[7]=0,c[8]=N.x,c[9]=N.y,c[10]=N.z,c[11]=0,c[12]=n.x,c[13]=n.y,c[14]=n.z,c[15]=1,c},A[o]=n),n},w.eastNorthUpToFixedFrame=w.localFrameToFixedFrameGenerator("east","north"),w.northEastDownToFixedFrame=w.localFrameToFixedFrameGenerator("north","east"),w.northUpEastToFixedFrame=w.localFrameToFixedFrameGenerator("north","up"),w.northWestUpToFixedFrame=w.localFrameToFixedFrameGenerator("north","west");var I=new v,x=new r(1,1,1),M=new O;w.headingPitchRollToFixedFrame=function(e,t,n,i,u){o.typeOf.object("HeadingPitchRoll",t),i=a(i,w.eastNorthUpToFixedFrame);var s=v.fromHeadingPitchRoll(t,I),c=O.fromTranslationQuaternionRotationScale(r.ZERO,s,x,M);return u=i(e,n,u),O.multiply(u,c,u)};var C=new O,P=new E;w.headingPitchRollQuaternion=function(e,t,r,n,i){o.typeOf.object("HeadingPitchRoll",t);var a=w.headingPitchRollToFixedFrame(e,t,r,n,C),u=O.getRotation(a,P);return v.fromRotationMatrix(u,i)};var D=new r(1,1,1),U=new r,L=new O,q=new O,F=new E,j=new v;w.fixedFrameToHeadingPitchRoll=function(e,t,n,i){o.defined("transform",e),t=a(t,f.WGS84),n=a(n,w.eastNorthUpToFixedFrame),u(i)||(i=new p);var s=O.getTranslation(e,U);if(r.equals(s,r.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;var c=O.inverseTransformation(n(s,t,L),L),l=O.setScale(e,D,q);l=O.setTranslation(l,r.ZERO,l),c=O.multiply(c,l,c);var d=v.fromRotationMatrix(O.getRotation(c,F),j);return d=v.normalize(d,d),p.fromQuaternion(d,i)};var B=24110.54841,z=8640184.812866,G=.093104,V=-62e-7,W=1.1772758384668e-19,X=72921158553e-15,H=m.TWO_PI/86400,Y=new y;w.computeTemeToPseudoFixedMatrix=function(e,t){if(!u(e))throw new s("date is required.");Y=y.addSeconds(e,-y.computeTaiMinusUtc(e),Y);var r,n=Y.dayNumber,i=Y.secondsOfDay,o=n-2451545;r=i>=43200?(o+.5)/_.DAYS_PER_JULIAN_CENTURY:(o-.5)/_.DAYS_PER_JULIAN_CENTURY;var a=B+r*(z+r*(G+r*V)),c=a*H%m.TWO_PI,l=X+W*(n-2451545.5),f=(i+.5*_.SECONDS_PER_DAY)%_.SECONDS_PER_DAY,p=c+l*f,d=Math.cos(p),h=Math.sin(p);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(d,h,0,-h,d,0,0,0,1)},w.iau2006XysData=new d,w.earthOrientationParameters=c.NONE;var k=32.184,Z=2451545;w.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+k,i=t.stop.dayNumber,o=t.stop.secondsOfDay+k,a=w.iau2006XysData.preload(r,n,i,o),u=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,u])},w.computeIcrfToFixedMatrix=function(e,t){if(!u(e))throw new s("date is required.");u(t)||(t=new E);var r=w.computeFixedToIcrfMatrix(e,t);if(u(r))return E.transpose(r,t)};var K=new h(0,0,0),J=new l(0,0,0,0,0,0),Q=new E,$=new E;w.computeFixedToIcrfMatrix=function(e,t){if(!u(e))throw new s("date is required.");u(t)||(t=new E);var r=w.earthOrientationParameters.compute(e,J);if(u(r)){var n=e.dayNumber,i=e.secondsOfDay+k,o=w.iau2006XysData.computeXysRadians(n,i,K);if(u(o)){var a=o.x+r.xPoleOffset,c=o.y+r.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-c*c)),f=Q;f[0]=1-l*a*a,f[3]=-l*a*c,f[6]=a,f[1]=-l*a*c,f[4]=1-l*c*c,f[7]=c,f[2]=-a,f[5]=-c,f[8]=1-l*(a*a+c*c);var p=E.fromRotationZ(-o.s,$),d=E.multiply(f,p,Q),h=e.dayNumber,O=e.secondsOfDay-y.computeTaiMinusUtc(e)+r.ut1MinusUtc,v=h-2451545,T=O/_.SECONDS_PER_DAY,b=.779057273264+T+.00273781191135448*(v+T);b=b%1*m.TWO_PI;var A=E.fromRotationZ(b,$),g=E.multiply(d,A,Q),R=Math.cos(r.xPoleWander),S=Math.cos(r.yPoleWander),N=Math.sin(r.xPoleWander),I=Math.sin(r.yPoleWander),x=n-Z+i/_.SECONDS_PER_DAY;x/=36525;var M=-47e-6*x*m.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=$;return D[0]=R*C,D[1]=R*P,D[2]=N,D[3]=-S*P+I*N*C,D[4]=S*C+I*N*P,D[5]=-I*R,D[6]=-I*P-S*N*C,D[7]=I*C-S*N*P,D[8]=S*R,E.multiply(g,D,t)}}};var ee=new n;w.pointToWindowCoordinates=function(e,t,r,n){return n=w.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},w.pointToGLWindowCoordinates=function(e,r,i,o){if(!u(e))throw new s("modelViewProjectionMatrix is required.");if(!u(r))throw new s("viewportTransformation is required.");if(!u(i))throw new s("point is required.");u(o)||(o=new t);var a=ee;return O.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,a),a),n.multiplyByScalar(a,1/a.w,a),O.multiplyByVector(r,a,a),t.fromCartesian4(a,o)};var te=new r,re=new r,ne=new r;w.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!u(e))throw new s("position is required.");if(!u(t))throw new s("velocity is required.");var o=a(n,f.WGS84).geodeticSurfaceNormal(e,te),c=r.cross(t,o,re);r.equalsEpsilon(c,r.ZERO,m.EPSILON6)&&(c=r.clone(r.UNIT_X,c));var l=r.cross(c,t,ne);return r.normalize(l,l),r.cross(t,l,c),r.negate(c,c),r.normalize(c,c),u(i)||(i=new E),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=c.x,i[4]=c.y,i[5]=c.z,i[6]=l.x,i[7]=l.y,i[8]=l.z,i};var ie=new O(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),oe=new i,ae=new r,ue=new r,se=new E,ce=new O,le=new O;return w.basisTo2D=function(e,t,n){if(!u(e))throw new s("projection is required.");if(!u(t))throw new s("matrix is required.");if(!u(n))throw new s("result is required.");var i=O.getTranslation(t,ue),o=e.ellipsoid,a=o.cartesianToCartographic(i,oe),c=e.project(a,ae);r.fromElements(c.z,c.x,c.y,c);var l=w.eastNorthUpToFixedFrame(i,o,ce),f=O.inverseTransformation(l,le),p=O.getRotation(t,se),d=O.multiplyByMatrix3(f,p,n);return O.multiply(ie,d,n),O.setTranslation(n,c,n),n},w.wgs84To2DModelMatrix=function(e,t,n){if(!u(e))throw new s("projection is required.");if(!u(t))throw new s("center is required.");if(!u(n))throw new s("result is required.");var i=e.ellipsoid,o=w.eastNorthUpToFixedFrame(t,i,ce),a=O.inverseTransformation(o,le),c=i.cartesianToCartographic(t,oe),l=e.project(c,ae);r.fromElements(l.z,l.x,l.y,l);var f=O.fromTranslation(l,ce);return O.multiply(ie,a,n),O.multiply(f,n,n),n},w}),define("Core/Geometry",["./Cartesian2","./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./GeometryOffsetAttribute","./GeometryType","./Matrix2","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms"],function(e,t,r,n,i,o,a,u,s,c,l,f,p,d,h,y){"use strict";function m(e){e=i(e,i.EMPTY_OBJECT),n.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=i(e.primitiveType,p.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=i(e.geometryType,s.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}m.computeNumberOfVertices=function(e){n.typeOf.object("geometry",e);var t=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&o(e.attributes[r])&&o(e.attributes[r].values)){var i=e.attributes[r],u=i.values.length/i.componentsPerAttribute;if(t!==u&&-1!==t)throw new a("All attribute lists must have the same number of attributes.");t=u}return t};var E=new r,O=new t,v=new f,_=[new r,new r,new r],w=[new e,new e,new e],T=[new e,new e,new e],b=new t,A=new d,g=new f,R=new c;return m._textureCoordinateRotationPoints=function(n,i,o,a){var u,s=h.center(a,E),p=r.toCartesian(s,o,O),m=y.eastNorthUpToFixedFrame(p,o,v),S=f.inverse(m,v),N=w,I=_;I[0].longitude=a.west,I[0].latitude=a.south,I[1].longitude=a.west,I[1].latitude=a.north,I[2].longitude=a.east,I[2].latitude=a.south;var x=b;for(u=0;3>u;u++)r.toCartesian(I[u],o,x),x=f.multiplyByPointAsVector(S,x,x),N[u].x=x.x,N[u].y=x.y;var M=d.fromAxisAngle(t.UNIT_Z,-i,A),C=l.fromQuaternion(M,g),P=n.length,D=Number.POSITIVE_INFINITY,U=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY;for(u=0;P>u;u++)x=f.multiplyByPointAsVector(S,n[u],x),x=l.multiplyByVector(C,x,x),D=Math.min(D,x.x),U=Math.min(U,x.y),L=Math.max(L,x.x),q=Math.max(q,x.y);var F=c.fromRotation(i,R),j=T;j[0].x=D,j[0].y=U,j[1].x=D,j[1].y=q,j[2].x=L,j[2].y=U;var B=N[0],z=N[2].x-B.x,G=N[1].y-B.y;for(u=0;3>u;u++){var V=j[u];c.multiplyByVector(F,V,V),V.x=(V.x-B.x)/z,V.y=(V.y-B.y)/G}var W=j[0],X=j[1],H=j[2],Y=new Array(6);return e.pack(W,Y),e.pack(X,Y,2),e.pack(H,Y,4),Y},m}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(n){if(n=e(n,e.EMPTY_OBJECT),!t(n.componentDatatype))throw new r("options.componentDatatype is required.");if(!t(n.componentsPerAttribute))throw new r("options.componentsPerAttribute is required.");if(n.componentsPerAttribute<1||n.componentsPerAttribute>4)throw new r("options.componentsPerAttribute must be between 1 and 4.");if(!t(n.values))throw new r("options.values is required.");this.componentDatatype=n.componentDatatype,this.componentsPerAttribute=n.componentsPerAttribute,this.normalize=e(n.normalize,!1),this.values=n.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function i(i){if(i=e(i,e.EMPTY_OBJECT),!t(i.geometry))throw new r("options.geometry is required.");this.geometry=i.geometry,this.modelMatrix=n.clone(e(i.modelMatrix,n.IDENTITY)),this.id=i.id,this.pickPrimitive=i.pickPrimitive,this.attributes=e(i.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,i,o){"use strict";function a(e){return p[0]=e,p[0]}function u(e){return e>>1^-(1&e)}var s=1/256,c=256,l={};l.octEncodeInRange=function(e,n,a){r.defined("vector",e),r.defined("result",a);var u=t.magnitudeSquared(e);if(Math.abs(u-1)>o.EPSILON6)throw new i("vector must be normalized.");if(a.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),a.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var s=a.x,c=a.y;a.x=(1-Math.abs(c))*o.signNotZero(s),a.y=(1-Math.abs(s))*o.signNotZero(c)}return a.x=o.toSNorm(a.x,n),a.y=o.toSNorm(a.y,n),a},l.octEncode=function(e,t){return l.octEncodeInRange(e,255,t)};var f=new e,p=new Uint8Array(1);l.octEncodeToCartesian4=function(e,t){return l.octEncodeInRange(e,65535,f),t.x=a(f.x*s),t.y=a(f.x),t.z=a(f.y*s),t.w=a(f.y),t},l.octDecodeInRange=function(e,n,a,u){if(r.defined("result",u),0>e||e>a||0>n||n>a)throw new i("x and y must be unsigned normalized integers between 0 and "+a);if(u.x=o.fromSNorm(e,a),u.y=o.fromSNorm(n,a),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))*o.signNotZero(s),u.y=(1-Math.abs(s))*o.signNotZero(u.y)}return t.normalize(u,u)},l.octDecode=function(e,t,r){return l.octDecodeInRange(e,t,255,r)},l.octDecodeFromCartesian4=function(e,t){r.typeOf.object("encoded",e),r.typeOf.object("result",t);var n=e.x,o=e.y,a=e.z,u=e.w;if(0>n||n>255||0>o||o>255||0>a||a>255||0>u||u>255)throw new i("x, y, z, and w must be unsigned normalized integers between 0 and 255");var s=n*c+o,f=a*c+u;return l.octDecodeInRange(s,f,65535,t); },l.octPackFloat=function(e){return r.defined("encoded",e),256*e.x+e.y};var d=new e;return l.octEncodeFloat=function(e){return l.octEncode(e,d),l.octPackFloat(d)},l.octDecodeFloat=function(e,t){r.defined("value",e);var n=e/256,i=Math.floor(n),o=256*(n-i);return l.octDecode(i,o,t)},l.octPack=function(e,t,n,i){r.defined("v1",e),r.defined("v2",t),r.defined("v3",n),r.defined("result",i);var o=l.octEncodeFloat(e),a=l.octEncodeFloat(t),u=l.octEncode(n,d);return i.x=65536*u.x+o,i.y=65536*u.y+a,i},l.octUnpack=function(e,t,n,i){r.defined("packed",e),r.defined("v1",t),r.defined("v2",n),r.defined("v3",i);var o=e.x/65536,a=Math.floor(o),u=65536*(o-a);o=e.y/65536;var s=Math.floor(o),c=65536*(o-s);l.octDecodeFloat(u,t),l.octDecodeFloat(c,n),l.octDecode(a,s,i)},l.compressTextureCoordinates=function(e){r.defined("textureCoordinates",e);var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},l.decompressTextureCoordinates=function(e,t){r.defined("compressed",e),r.defined("result",t);var n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-4096*i)/4095,t},l.zigZagDeltaDecode=function(e,t,i){r.defined("uBuffer",e),r.defined("vBuffer",t),r.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),n(i)&&r.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,i.length);for(var o=e.length,a=0,s=0,c=0,l=0;o>l;++l)a+=u(e[l]),s+=u(t[l]),e[l]=a,t[l]=s,n(i)&&(c+=u(i[l]),i[l]=c)},l.octShortToFloat=function(e){return o.clamp(3051850947599719e-20*e,-1,1)},l.octShortDecode=function(e,n,i){if(r.defined("result",i),i.x=l.octShortToFloat(e),i.y=l.octShortToFloat(n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var a=i.x;i.x=(1-Math.abs(i.y))*o.signNotZero(a),i.y=(1-Math.abs(a))*o.signNotZero(i.y)}return t.normalize(i,i)},l}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined","./Math"],function(e,t,r,n,i){"use strict";function o(o,c,l,f,p){r.defined("point",o),r.defined("p0",c),r.defined("p1",l),r.defined("p2",f),n(p)||(p=new t);var d,h,y,m,E,O,v,_;if(n(c.z)){if(t.equalsEpsilon(o,c,i.EPSILON14))return t.clone(t.UNIT_X,p);if(t.equalsEpsilon(o,l,i.EPSILON14))return t.clone(t.UNIT_Y,p);if(t.equalsEpsilon(o,f,i.EPSILON14))return t.clone(t.UNIT_Z,p);d=t.subtract(l,c,a),h=t.subtract(f,c,u),y=t.subtract(o,c,s),m=t.dot(d,d),E=t.dot(d,h),O=t.dot(d,y),v=t.dot(h,h),_=t.dot(h,y)}else{if(e.equalsEpsilon(o,c,i.EPSILON14))return t.clone(t.UNIT_X,p);if(e.equalsEpsilon(o,l,i.EPSILON14))return t.clone(t.UNIT_Y,p);if(e.equalsEpsilon(o,f,i.EPSILON14))return t.clone(t.UNIT_Z,p);d=e.subtract(l,c,a),h=e.subtract(f,c,u),y=e.subtract(o,c,s),m=e.dot(d,d),E=e.dot(d,h),O=e.dot(d,y),v=e.dot(h,h),_=e.dot(h,y)}var w=m*v-E*E,T=1/w;return p.y=(v*O-E*_)*T,p.z=(m*_-E*O)*T,p.x=1-p.y-p.z,p}var a=new t,u=new t,s=new t;return o}),define("Core/EncodedCartesian3",["./Cartesian3","./Check","./defined"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,n){t.typeOf.number("value",e),r(n)||(n={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};var i={high:0,low:0};n.fromCartesian=function(e,o){t.typeOf.object("cartesian",e),r(o)||(o=new n);var a=o.high,u=o.low;return n.encode(e.x,i),a.x=i.high,u.x=i.low,n.encode(e.y,i),a.y=i.high,u.y=i.low,n.encode(e.z,i),a.z=i.high,u.z=i.low,o};var o=new n;return n.writeElements=function(e,r,i){t.defined("cartesianArray",r),t.typeOf.number("index",i),t.typeOf.number.greaterThanOrEquals("index",i,0),n.fromCartesian(e,o);var a=o.high,u=o.low;r[i]=a.x,r[i+1]=a.y,r[i+2]=a.z,r[i+3]=u.x,r[i+4]=u.y,r[i+5]=u.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,i){"use strict";var o={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},o.fromSizeInBytes=function(e){switch(e){case 2:return o.UNSIGNED_SHORT;case 4:return o.UNSIGNED_INT;case 1:return o.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.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)},o.createTypedArrayFromArrayBuffer=function(r,i,o,a){if(!e(r))throw new t("numberOfVertices is required.");if(!e(i))throw new t("sourceArray is required.");if(!e(o))throw new t("byteOffset is required.");return r>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(i,o,a):new Uint16Array(i,o,a)},r(o)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var i=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(r)))u&&u/ss&&s/ua)return[];var c=Math.sqrt(a);return[-c,c]}if(0===o)return a=-i/n,0>a?[a,0]:[0,a];var l=i*i,f=4*n*o,p=r(l,-f,t.EPSILON14);if(0>p)return[];var d=-.5*r(i,t.sign(i)*Math.sqrt(p),t.EPSILON14);return i>0?[d/n,o/d]:[o/d,d/n]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var i,o,a=e,u=t/3,s=r/3,c=n,l=a*s,f=u*c,p=u*u,d=s*s,h=a*s-p,y=a*c-u*s,m=u*c-d,E=4*h*m-y*y;if(0>E){var O,v,_;p*f>=l*d?(O=a,v=h,_=-2*u*h+a*y):(O=c,v=m,_=-c*y+2*s*m);var w=0>_?-1:1,T=-w*Math.abs(O)*Math.sqrt(-E);o=-_+T;var b=o/2,A=0>b?-Math.pow(-b,1/3):Math.pow(b,1/3),g=o===T?-A:-v/A;return i=0>=v?A+g:-_/(A*A+g*g+v),p*f>=l*d?[(i-u)/a]:[-c/(i+s)]}var R=h,S=-2*u*h+a*y,N=m,I=-c*y+2*s*m,x=Math.sqrt(E),M=Math.sqrt(3)/2,C=Math.abs(Math.atan2(a*x,-S)/3);i=2*Math.sqrt(-R);var P=Math.cos(C);o=i*P;var D=i*(-P/2-M*Math.sin(C)),U=o+D>2*u?o-u:D-u,L=a,q=U/L;C=Math.abs(Math.atan2(c*x,-I)/3),i=2*Math.sqrt(-N),P=Math.cos(C),o=i*P,D=i*(-P/2-M*Math.sin(C));var F=-c,j=2*s>o+D?o+s:D+s,B=F/j,z=L*j,G=-U*j-L*F,V=U*F,W=(s*G-u*V)/(-u*G+s*z);return W>=q?B>=q?B>=W?[q,W,B]:[q,B,W]:[B,q,W]:B>=q?[W,q,B]:B>=W?[W,B,q]:[B,W,q]}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 o=t*t,a=r*r,u=n*n,s=i*i,c=18*t*r*n*i+a*u-27*o*s-4*(t*u*n+a*r*i);return c},n.computeRealRoots=function(n,i,o,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 o)throw new e("c is a required number.");if("number"!=typeof a)throw new e("d is a required number.");var u,s;if(0===n)return t.computeRealRoots(i,o,a);if(0===i){if(0===o){if(0===a)return[0,0,0];s=-a/n;var c=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[c,c,c]}return 0===a?(u=t.computeRealRoots(n,0,o),0===u.Length?[0]:[u[0],0,u[1]]):r(n,0,o,a)}return 0===o?0===a?(s=-i/n,0>s?[s,0,0]:[0,0,s]):r(n,i,0,a):0===a?(u=t.computeRealRoots(n,i,o),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,o,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function i(t,i,o,a){var u=t*t,s=i-3*u/8,c=o-i*t/2+u*t/8,l=a-o*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 p=-t/4,d=f[f.length-1];if(Math.abs(d)=0&&E>=0){var O=Math.sqrt(m),v=Math.sqrt(E);return[p-v,p-O,p+O,p+v]}if(m>=0&&0>E)return y=Math.sqrt(m),[p-y,p+y];if(0>m&&E>=0)return y=Math.sqrt(E),[p-y,p+y]}return[]}if(d>0){var _=Math.sqrt(d),w=(s+d-c/_)/2,T=(s+d+c/_)/2,b=n.computeRealRoots(1,_,w),A=n.computeRealRoots(1,-_,T);return 0!==b.length?(b[0]+=p,b[1]+=p,0!==A.length?(A[0]+=p,A[1]+=p,b[1]<=A[0]?[b[0],b[1],A[0],A[1]]:A[1]<=b[0]?[A[0],A[1],b[0],b[1]]:b[0]>=A[0]&&b[1]<=A[1]?[A[0],b[0],b[1],A[1]]:A[0]>=b[0]&&A[1]<=b[1]?[b[0],A[0],A[1],b[1]]:b[0]>A[0]&&b[0]0){var h,y,m=d[0],E=i-m,O=E*E,v=t/2,_=E/2,w=O-4*a,T=O+4*Math.abs(a),b=c-4*m,A=c+4*Math.abs(m);if(0>m||b*T>w*A){var g=Math.sqrt(b);h=g/2,y=0===g?0:(t*_-o)/g}else{var R=Math.sqrt(w);h=0===R?0:(t*_-o)/R,y=R/2}var S,N;0===v&&0===h?(S=0,N=0):r.sign(v)===r.sign(h)?(S=v+h,N=m/S):(N=v-h,S=m/N);var I,x;0===_&&0===y?(I=0,x=0):r.sign(_)===r.sign(y)?(I=_+y,x=a/I):(x=_-y,I=a/x);var M=n.computeRealRoots(1,S,I),C=n.computeRealRoots(1,N,x);if(0!==M.length)return 0!==C.length?M[1]<=C[0]?[M[0],M[1],C[0],C[1]]:C[1]<=M[0]?[C[0],C[1],M[0],M[1]]:M[0]>=C[0]&&M[1]<=C[1]?[C[0],M[0],M[1],C[1]]:C[0]>=M[0]&&C[1]<=M[1]?[M[0],C[0],C[1],M[1]]:M[0]>C[0]&&M[0]l?1:0;switch(h+=0>f?h+1:h,h+=0>p?h+1:h,h+=0>d?h+1:h){case 0:return i(l,f,p,d);case 1:return o(l,f,p,d);case 2:return o(l,f,p,d);case 3:return i(l,f,p,d);case 4:return i(l,f,p,d);case 5:return o(l,f,p,d);case 6:return i(l,f,p,d);case 7:return i(l,f,p,d);case 8:return o(l,f,p,d);case 9:return i(l,f,p,d);case 10:return i(l,f,p,d);case 11:return o(l,f,p,d);case 12:return i(l,f,p,d);case 13:return i(l,f,p,d);case 14:return i(l,f,p,d);case 15:return i(l,f,p,d);default:return}},a}),define("Core/Ray",["./Cartesian3","./Check","./defaultValue","./defined"],function(e,t,r,n){"use strict";function i(t,n){n=e.clone(r(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(r(t,e.ZERO)),this.direction=n}return i.clone=function(t,r){return n(t)?n(r)?(r.origin=e.clone(t.origin),r.direction=e.clone(t.direction),r):new i(t.origin,t.direction):void 0},i.getPoint=function(r,i,o){return t.typeOf.object("ray",r),t.typeOf.number("t",i),n(o)||(o=new e),o=e.multiplyByScalar(r.direction,i,o),e.add(r.origin,o,o)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,i,o,a,u,s,c,l){"use strict";function f(e,t,r,n){var i=t*t-4*e*r;if(!(0>i)){if(i>0){var o=1/(2*e),a=Math.sqrt(i),u=(-t+a)*o,s=(-t-a)*o;return s>u?(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 p(t,r,i){n(i)||(i=new o);var a=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(a,s,O),p=e.dot(u,u),d=2*e.dot(u,l),h=e.magnitudeSquared(l)-c,y=f(p,d,h,T);return n(y)?(i.start=y.root0,i.stop=y.root1,i):void 0}function d(e,t,r){var n=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))D;++D){var U,L=l[D],q=L*L,F=Math.max(1-q,0),j=Math.sqrt(F);U=a.sign(h)===a.sign(m)?d(h*q+m,y*L,a.EPSILON12):a.sign(m)===a.sign(y*L)?d(h*q,y*L+m,a.EPSILON12):d(h*q+y*L,m,a.EPSILON12);var B=d(E*L,O,a.EPSILON15),z=U*B;0>z?v.push(new e(i,o*L,o*j)):z>0?v.push(new e(i,o*L,o*-j)):0!==j?(v.push(new e(i,o*L,o*-j)),v.push(new e(i,o*L,o*j)),++D):v.push(new e(i,o*L,o*j))}return v}var y={};y.rayPlane=function(t,r,o){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("plane is required.");n(o)||(o=new e);var u=t.origin,s=t.direction,c=r.normal,l=e.dot(c,s);if(!(Math.abs(l)f))return o=e.multiplyByScalar(s,f,o),e.add(u,o,o)}};var m=new e,E=new e,O=new e,v=new e,_=new e;y.rayTriangleParametric=function(t,o,u,s,c){if(!n(t))throw new i("ray is required.");if(!n(o))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,p,d,h,y=t.origin,w=t.direction,T=e.subtract(u,o,m),b=e.subtract(s,o,E),A=e.cross(w,b,O),g=e.dot(T,A);if(c){if(gp||p>g)return;if(f=e.cross(l,T,_),d=e.dot(w,f),0>d||p+d>g)return;h=e.dot(b,f)/g}else{if(Math.abs(g)p||p>1)return;if(f=e.cross(l,T,_),d=e.dot(w,f)*R,0>d||p+d>1)return;h=e.dot(b,f)*R}return h},y.rayTriangle=function(t,r,i,o,a,u){var s=y.rayTriangleParametric(t,r,i,o,a);if(n(s)&&!(0>s))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var w=new l;y.lineSegmentTriangle=function(t,r,o,a,u,s,c){if(!n(t))throw new i("v0 is required.");if(!n(r))throw new i("v1 is required.");if(!n(o))throw new i("p0 is required.");if(!n(a))throw new i("p1 is required.");if(!n(u))throw new i("p2 is required.");var l=w;e.clone(t,l.origin),e.subtract(r,t,l.direction),e.normalize(l.direction,l.direction);var f=y.rayTriangleParametric(l,o,a,u,s);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(c)||(c=new e),e.multiplyByScalar(l.direction,f,c),e.add(l.origin,c,c))};var T={root0:0,root1:0};y.raySphere=function(e,t,r){if(!n(e))throw new i("ray is required.");if(!n(t))throw new i("sphere is required.");return r=p(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var b=new l;y.lineSegmentSphere=function(t,r,o,a){if(!n(t))throw new i("p0 is required.");if(!n(r))throw new i("p1 is required.");if(!n(o))throw new i("sphere is required.");var u=b;e.clone(t,u.origin);var s=e.subtract(r,t,u.direction),c=e.magnitude(s);return e.normalize(s,s),a=p(u,o,a),!n(a)||a.stop<0||a.start>c?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,c),a)};var A=new e,g=new e;y.rayEllipsoid=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var a,u,s,c,l,f=r.oneOverRadii,p=e.multiplyComponents(f,t.origin,A),d=e.multiplyComponents(f,t.direction,g),h=e.magnitudeSquared(p),y=e.dot(p,d);if(h>1){if(y>=0)return;var m=y*y;if(a=h-1,u=e.magnitudeSquared(d),s=u*a,s>m)return;if(m>s){c=y*y-s,l=-y+Math.sqrt(c);var E=l/u,O=a/l;return O>E?new o(E,O):{start:O,stop:E}}var v=Math.sqrt(a/u);return new o(v,v)}return 1>h?(a=h-1,u=e.magnitudeSquared(d),s=u*a,c=y*y-s,l=-y+Math.sqrt(c),new o(0,l/u)):0>y?(u=e.magnitudeSquared(d),new o(0,-y/u)):void 0};var R=new e,S=new e,N=new e,I=new e,x=new e,M=new u,C=new u,P=new u,D=new u,U=new u,L=new u,q=new u,F=new e,j=new e,B=new t;y.grazingAltitudeLocation=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var o=t.origin,s=t.direction;if(!e.equals(o,e.ZERO)){var c=r.geodeticSurfaceNormal(o,R);if(e.dot(s,c)>=0)return o}var l=n(this.rayEllipsoid(t,r)),f=r.transformPositionToScaledSpace(s,R),p=e.normalize(f,f),d=e.mostOrthogonalAxis(f,I),y=e.normalize(e.cross(d,p,S),S),m=e.normalize(e.cross(p,y,N),N),E=M;E[0]=p.x,E[1]=p.y,E[2]=p.z,E[3]=y.x,E[4]=y.y,E[5]=y.z,E[6]=m.x,E[7]=m.y,E[8]=m.z;var O=u.transpose(E,C),v=u.fromScale(r.radii,P),_=u.fromScale(r.oneOverRadii,D),w=U;w[0]=0,w[1]=-s.z,w[2]=s.y,w[3]=s.z,w[4]=0,w[5]=-s.x,w[6]=-s.y,w[7]=s.x,w[8]=0;var T,b,A=u.multiply(u.multiply(O,_,L),w,L),g=u.multiply(u.multiply(A,v,q),E,q),z=u.multiplyByVector(A,o,x),G=h(g,e.negate(z,R),0,0,1),V=G.length;if(V>0){for(var W=e.clone(e.ZERO,j),X=Number.NEGATIVE_INFINITY,H=0;V>H;++H){T=u.multiplyByVector(v,u.multiplyByVector(E,G[H],F),F);var Y=e.normalize(e.subtract(T,o,I),I),k=e.dot(Y,s);k>X&&(X=k,W=e.clone(T,W))}var Z=r.cartesianToCartographic(W,B);return X=a.clamp(X,0,1),b=e.magnitude(e.subtract(W,o,I))*Math.sqrt(1-X*X),b=l?-b:b,Z.height=b,r.cartographicToCartesian(Z,new e)}};var z=new e;return y.lineSegmentPlane=function(t,r,o,u){if(!n(t))throw new i("endPoint0 is required.");if(!n(r))throw new i("endPoint1 is required.");if(!n(o))throw new i("plane is required.");n(u)||(u=new e);var s=e.subtract(r,t,z),c=o.normal,l=e.dot(c,s);if(!(Math.abs(l)p||p>1))return e.multiplyByScalar(s,p,u),e.add(t,u,u),u}},y.trianglePlaneIntersection=function(t,r,o,a){if(!(n(t)&&n(r)&&n(o)&&n(a)))throw new i("p0, p1, p2, and plane are required.");var u=a.normal,s=a.distance,c=e.dot(u,t)+s<0,l=e.dot(u,r)+s<0,f=e.dot(u,o)+s<0,p=0;p+=c?1:0,p+=l?1:0,p+=f?1:0;var d,h;if((1===p||2===p)&&(d=new e,h=new e),1===p){if(c)return y.lineSegmentPlane(t,r,a,d),y.lineSegmentPlane(t,o,a,h),{positions:[t,r,o,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return y.lineSegmentPlane(r,o,a,d),y.lineSegmentPlane(r,t,a,h),{positions:[t,r,o,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(f)return y.lineSegmentPlane(o,t,a,d),y.lineSegmentPlane(o,r,a,h),{positions:[t,r,o,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===p){if(!c)return y.lineSegmentPlane(r,t,a,d),y.lineSegmentPlane(o,t,a,h),{positions:[t,r,o,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return y.lineSegmentPlane(o,r,a,d),y.lineSegmentPlane(t,r,a,h),{positions:[t,r,o,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!f)return y.lineSegmentPlane(t,o,a,d),y.lineSegmentPlane(r,o,a,h),{positions:[t,r,o,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},y}),define("Core/Plane",["./Cartesian3","./Check","./defined","./DeveloperError","./freezeObject","./Math","./Matrix4"],function(e,t,r,n,i,o,a){"use strict";function u(r,i){if(t.typeOf.object("normal",r),!o.equalsEpsilon(e.magnitude(r),1,o.EPSILON6))throw new n("normal must be normalized.");t.typeOf.number("distance",i),this.normal=e.clone(r),this.distance=i}u.fromPointNormal=function(i,a,s){if(t.typeOf.object("point",i),t.typeOf.object("normal",a),!o.equalsEpsilon(e.magnitude(a),1,o.EPSILON6))throw new n("normal must be normalized.");var c=-e.dot(a,i);return r(s)?(e.clone(a,s.normal),s.distance=c,s):new u(a,c)};var s=new e;u.fromCartesian4=function(i,a){t.typeOf.object("coefficients",i);var c=e.fromCartesian4(i,s),l=i.w;if(!o.equalsEpsilon(e.magnitude(c),1,o.EPSILON6))throw new n("normal must be normalized.");return r(a)?(e.clone(c,a.normal),a.distance=l,a):new u(c,l)},u.getPointDistance=function(r,n){return t.typeOf.object("plane",r),t.typeOf.object("point",n),e.dot(r.normal,n)+r.distance};var c=new e;u.projectPointOntoPlane=function(n,i,o){t.typeOf.object("plane",n),t.typeOf.object("point",i),r(o)||(o=new e);var a=u.getPointDistance(n,i),s=e.multiplyByScalar(n.normal,a,c);return e.subtract(i,s,o)};var l=new e;return u.transform=function(r,n,i){return t.typeOf.object("plane",r),t.typeOf.object("transform",n),a.multiplyByPointAsVector(n,r.normal,s),e.normalize(s,s),e.multiplyByScalar(r.normal,-r.distance,l),a.multiplyByPoint(n,l,l),u.fromPointNormal(l,s,i)},u.clone=function(n,i){return t.typeOf.object("plane",n),r(i)?(e.clone(n.normal,i.normal),i.distance=n.distance,i):new u(n.normal,n.distance)},u.equals=function(r,n){return t.typeOf.object("left",r),t.typeOf.object("right",n),r.distance===n.distance&&e.equals(r.normal,n.normal)},u.ORIGIN_XY_PLANE=i(new u(e.UNIT_Z,0)),u.ORIGIN_YZ_PLANE=i(new u(e.UNIT_X,0)),u.ORIGIN_ZX_PLANE=i(new u(e.UNIT_Y,0)),u}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var i=n.indices,o=n.maximumIndex,a=e(n.cacheSize,24);if(!t(i))throw new r("indices is required.");var u=i.length;if(3>u||u%3!==0)throw new r("indices length must be a multiple of three.");if(0>=o)throw new r("maximumIndex must be greater than zero.");if(3>a)throw new r("cacheSize must be greater than two.");if(!t(o)){o=0;for(var s=0,c=i[s];u>s;)c>o&&(o=c),++s,c=i[s]}for(var l=[],f=0;o+1>f;f++)l[f]=0;for(var p=a+1,d=0;u>d;++d)p-l[i[d]]>a&&(l[i[d]]=p,++p);return(p-a+1)/(u/3)},n.tipsify=function(n){function i(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;n>a;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function o(e,t,r,n,o,a,u){for(var s,c=-1,l=-1,f=0;fl||-1===l)&&(l=s,c=p)),++f}return-1===c?i(n,a,e,u):c}n=e(n,e.EMPTY_OBJECT);var a,u=n.indices,s=n.maximumIndex,c=e(n.cacheSize,24);if(!t(u))throw new r("indices is required.");var l=u.length;if(3>l||l%3!==0)throw new r("indices length must be a multiple of three.");if(0>=s)throw new r("maximumIndex must be greater than zero.");if(3>c)throw new r("cacheSize must be greater than two.");var f=0,p=0,d=u[p],h=l;if(t(s))f=s+1;else{for(;h>p;)d>f&&(f=d),++p,d=u[p];if(-1===f)return 0;++f}var y,m=[];for(y=0;f>y;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};p=0;for(var E=0;h>p;)m[u[p]].vertexTriangles.push(E),++m[u[p]].numLiveTriangles,m[u[p+1]].vertexTriangles.push(E),++m[u[p+1]].numLiveTriangles,m[u[p+2]].vertexTriangles.push(E),++m[u[p+2]].numLiveTriangles,++E,p+=3;var O=0,v=c+1;a=1;var _,w,T=[],b=[],A=0,g=[],R=l/3,S=[];for(y=0;R>y;y++)S[y]=!1;for(var N,I;-1!==O;){T=[],w=m[O],I=w.vertexTriangles.length;for(var x=0;I>x;++x)if(E=w.vertexTriangles[x],!S[E]){S[E]=!0,p=E+E+E;for(var M=0;3>M;++M)N=u[p],T.push(N),b.push(N),g[A]=N,++A,_=m[N],--_.numLiveTriangles,v-_.timeStamp>c&&(_.timeStamp=v,++v),++p}O=o(u,c,T,m,v,b,f)}return g},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,o,a,u,s,c,l,f,p,d,h,y,m,E,O,v,_,w,T,b,A){"use strict";function g(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function R(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),i=0,o=0;t>o;o+=3,i+=6)g(n,i,e[o],e[o+1],e[o+2]);return n}function S(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var i=6,o=3;t>o;++o,i+=6)g(n,i,e[o-1],e[o],e[o-2]);return n}return new Uint16Array}function N(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),i=e[0],o=0,a=1;t>a;++a,o+=6)g(n,o,i,e[a],e[a+1]);return n}return new Uint16Array}function I(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new h({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],o=0;oo;o+=3)i.unpack(r,o,se),w.multiplyByPoint(e,se,se),i.pack(se,r,o)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,o=0;n>o;o+=3)i.unpack(r,o,se),_.multiplyByVector(e,se,se),se=i.normalize(se,se),i.pack(se,r,o)}function P(e,t){var r,n=e.length,i={},o=e[0][t].attributes;for(r in o)if(o.hasOwnProperty(r)&&c(o[r])&&c(o[r].values)){for(var a=o[r],s=a.values.length,l=!0,f=1;n>f;++f){var p=e[f][t].attributes[r];if(!c(p)||a.componentDatatype!==p.componentDatatype||a.componentsPerAttribute!==p.componentsPerAttribute||a.normalize!==p.normalize){l=!1;break}s+=p.values.length}l&&(i[r]=new h({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,s)}))}return i}function D(e,t){var n,o,a,u,s=e.length,f=e[0].modelMatrix,p=c(e[0][t].indices),h=e[0][t].primitiveType;for(o=1;s>o;++o){if(!w.equals(e[o].modelMatrix,f))throw new l("All instances must have the same modelMatrix.");if(c(e[o][t].indices)!==p)throw new l("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==h)throw new l("All instance geometries must have the same primitiveType.")}var y,E,O,v=P(e,t);for(n in v)if(v.hasOwnProperty(n))for(y=v[n].values,u=0,o=0;s>o;++o)for(E=e[o][t].attributes[n].values,O=E.length,a=0;O>a;++a)y[u++]=E[a];var _;if(p){var T=0;for(o=0;s>o;++o)T+=e[o][t].indices.length;var A=d.computeNumberOfVertices(new d({attributes:v,primitiveType:b.POINTS})),g=m.createTypedArray(A,T),R=0,S=0;for(o=0;s>o;++o){var N=e[o][t].indices,I=N.length;for(u=0;I>u;++u)g[R++]=S+N[u];S+=d.computeNumberOfVertices(e[o][t])}_=g}var x,M=new i,C=0;for(o=0;s>o;++o){if(x=e[o][t].boundingSphere,!c(x)){M=void 0;break}i.add(x.center,M,M)}if(c(M))for(i.divideByScalar(M,s,M),o=0;s>o;++o){x=e[o][t].boundingSphere;var D=i.magnitude(i.subtract(x.center,M,fe))+x.radius;D>C&&(C=D)}return new d({attributes:v,indices:_,primitiveType:h,boundingSphere:c(M)?new r(M,C):void 0})}function U(e){if(c(e.indices))return e;var t=d.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least three.");if(t%3!==0)throw new l("The number of vertices must be a multiple of three.");for(var r=m.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function L(e){var t=d.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least three.");var r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;t>i;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=b.TRIANGLES,e}function q(e){var t=d.computeNumberOfVertices(e);if(3>t)throw new l("The number of vertices must be at least 3.");var r=m.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,i=3;t-1>i;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,t>i+2&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=b.TRIANGLES,e}function F(e){if(c(e.indices))return e;var t=d.computeNumberOfVertices(e);if(2>t)throw new l("The number of vertices must be at least two.");if(t%2!==0)throw new l("The number of vertices must be a multiple of 2.");for(var r=m.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function j(e){var t=d.computeNumberOfVertices(e);if(2>t)throw new l("The number of vertices must be at least two.");var r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=b.LINES,e}function B(e){var t=d.computeNumberOfVertices(e);if(2>t)throw new l("The number of vertices must be at least two.");var r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=b.LINES,e}function z(e){switch(e.primitiveType){case b.TRIANGLE_FAN:return L(e);case b.TRIANGLE_STRIP:return q(e);case b.TRIANGLES:return U(e);case b.LINE_STRIP:return j(e);case b.LINE_LOOP:return B(e);case b.LINES:return F(e)}return e}function G(e,t){Math.abs(e.y)o?i>a?v.sign(e.y):v.sign(r.y):o>a?v.sign(t.y):v.sign(r.y);var u=0>n;G(e,u),G(t,u),G(r,u)}function W(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),i.clone(r,n),G(r,!0),G(n,!1)}function X(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){V(e,t,r);var n=e.y<0,i=t.y<0,o=r.y<0,a=0;a+=n?1:0,a+=i?1:0,a+=o?1:0;var u=Ie.indices;1===a?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,ge,Se),W(e,r,Re,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(W(t,r,ge,Se),W(t,e,Re,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):o&&(W(r,e,ge,Se),W(r,t,Re,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===a&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?i?o||(W(r,e,ge,Se),W(r,t,Re,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,ge,Se),W(t,e,Re,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,ge,Se),W(e,r,Re,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,(1===a||2===a)&&(s[3]=ge,s[4]=Re,s[5]=Se,s[6]=Ne,s.length=7),Ie}}function H(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var i in n)if(n.hasOwnProperty(i)&&c(n[i])&&c(n[i].values)){var o=n[i];o.values=u.createTypedArray(o.componentDatatype,o.values)}var a=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(a,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var i=t[n];r[n]=new h({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function k(e,t,r){var n=c(e.geometry.boundingSphere);t=H(t,n),r=H(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,t){var r=new e,n=new e,i=new e;return function(o,a,u,s,c,l,f,p){var d=e.fromArray(c,o*t,r),h=e.fromArray(c,a*t,n),y=e.fromArray(c,u*t,i);e.multiplyByScalar(d,s.x,d),e.multiplyByScalar(h,s.y,h),e.multiplyByScalar(y,s.z,y);var m=e.add(d,h,d);e.add(m,y,m),p&&e.normalize(m,m),e.pack(m,l,f*t)}}function K(e,r,n,o,a,u,s,l,f,p,d,h,y,m,E,O){if(c(u)||c(s)||c(l)||c(f)||c(p)||0!==m){var v=i.fromArray(a,3*e,De),_=i.fromArray(a,3*r,Ue),w=i.fromArray(a,3*n,Le),T=t(o,v,_,w,qe);if(c(u)&&Me(e,r,n,T,u,h.normal.values,O,!0),c(p)){var b=i.fromArray(p,3*e,De),A=i.fromArray(p,3*r,Ue),g=i.fromArray(p,3*n,Le);i.multiplyByScalar(b,T.x,b),i.multiplyByScalar(A,T.y,A),i.multiplyByScalar(g,T.z,g);var R;i.equals(b,i.ZERO)&&i.equals(A,i.ZERO)&&i.equals(g,i.ZERO)?(R=De,R.x=0,R.y=0,R.z=0):(R=i.add(b,A,b),i.add(R,g,R),i.normalize(R,R)),i.pack(R,h.extrudeDirection.values,3*O)}if(c(d)&&Pe(e,r,n,T,d,h.applyOffset.values,O), c(s)&&Me(e,r,n,T,s,h.tangent.values,O,!0),c(l)&&Me(e,r,n,T,l,h.bitangent.values,O,!0),c(f)&&Ce(e,r,n,T,f,h.st.values,O),m>0)for(var S=0;m>S;S++){var N=y[S];J(e,r,n,T,O,E[N],h[N])}}}function J(e,t,r,n,i,o,a){var u=o.componentsPerAttribute,s=o.values,c=a.values;switch(u){case 4:xe(e,t,r,n,s,c,i,!1);break;case 3:Me(e,t,r,n,s,c,i,!1);break;case 2:Ce(e,t,r,n,s,c,i,!1);break;default:c[i]=s[e]*n.x+s[t]*n.y+s[r]*n.z}}function Q(e,t,r,n,i,o){var a=e.position.values.length/3;if(-1!==i){var u=n[i],s=r[u];return-1===s?(r[u]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(s),s)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function $(e){var t=e.geometry,r=t.attributes,n=r.position.values,o=c(r.normal)?r.normal.values:void 0,a=c(r.bitangent)?r.bitangent.values:void 0,u=c(r.tangent)?r.tangent.values:void 0,s=c(r.st)?r.st.values:void 0,l=c(r.extrudeDirection)?r.extrudeDirection.values:void 0,f=c(r.applyOffset)?r.applyOffset.values:void 0,p=t.indices,d=[];for(var h in r)r.hasOwnProperty(h)&&!Fe[h]&&c(r[h])&&d.push(h);var y,m,E,O,v,_=d.length,w=Y(t),T=Y(t),b=[];b.length=n.length/3;var A=[];for(A.length=n.length/3,v=0;vv;v+=3){var R=p[v],S=p[v+1],N=p[v+2],I=i.fromArray(n,3*R),x=i.fromArray(n,3*S),M=i.fromArray(n,3*N),C=X(I,x,M);if(c(C)&&C.positions.length>3)for(var P=C.positions,D=C.indices,U=D.length,L=0;U>L;++L){var q=D[L],F=P[q];F.y<0?(y=T.attributes,m=T.indices,E=b):(y=w.attributes,m=w.indices,E=A),O=Q(y,m,E,p,3>q?v+q:-1,F),K(R,S,N,F,n,o,u,a,s,l,f,y,d,_,r,O)}else c(C)&&(I=C.positions[0],x=C.positions[1],M=C.positions[2]),I.y<0?(y=T.attributes,m=T.indices,E=b):(y=w.attributes,m=w.indices,E=A),O=Q(y,m,E,p,v,I),K(R,S,N,I,n,o,u,a,s,l,f,y,d,_,r,O),O=Q(y,m,E,p,v+1,x),K(R,S,N,x,n,o,u,a,s,l,f,y,d,_,r,O),O=Q(y,m,E,p,v+2,M),K(R,S,N,M,n,o,u,a,s,l,f,y,d,_,r,O)}k(e,T,w)}function ee(e,t,r,n,o,a,u){if(c(u)){var s=i.fromArray(n,3*e,De);i.equalsEpsilon(s,r,v.EPSILON10)?a.applyOffset.values[o]=u[e]:a.applyOffset.values[o]=u[t]}}function te(e){var t,r=e.geometry,n=r.attributes,o=n.position.values,a=c(n.applyOffset)?n.applyOffset.values:void 0,u=r.indices,s=Y(r),l=Y(r),f=u.length,p=[];p.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;tt;t+=2){var h,y=u[t],m=u[t+1],E=i.fromArray(o,3*y,De),_=i.fromArray(o,3*m,Ue);Math.abs(E.y)u;u+=3){var s=i.unpack(r,u,We);if(!(s.x>0)){var c=i.unpack(n,u,Xe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):i.pack(s,n,u));var l=i.unpack(o,u,He);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(a>u+3?(o[u]=r[u+3],o[u+1]=r[u+4],o[u+2]=r[u+5]):i.pack(s,o,u))}}}function ne(e){var t,r,a,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,p=s.nextPosition.values,d=s.expandAndWidth.values,h=c(s.st)?s.st.values:void 0,y=c(s.color)?s.color.values:void 0,m=c(s.dist)?s.dist.values:void 0,E=Y(u),_=Y(u),w=!1,T=l.length/3;for(t=0;T>t;t+=4){var b=t,A=t+2,g=i.fromArray(l,3*b,We),R=i.fromArray(l,3*A,Xe);if(Math.abs(g.y)<$e)for(g.y=$e*(R.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,r=3*b;3*b+12>r;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(R.y)<$e)for(R.y=$e*(g.y<0?-1:1),l[3*(t+2)+1]=R.y,l[3*(t+3)+1]=R.y,r=3*b;3*b+12>r;r+=3)p[r]=l[3*(t+2)],p[r+1]=l[3*(t+2)+1],p[r+2]=l[3*(t+2)+2];var S=E.attributes,N=E.indices,I=_.attributes,x=_.indices,M=O.lineSegmentPlane(g,R,je,Ye);if(c(M)){w=!0;var C=i.multiplyByScalar(i.UNIT_Y,Qe,ke);g.y<0&&(i.negate(C,C),S=_.attributes,N=_.indices,I=E.attributes,x=E.indices);var P=i.add(M,C,Ze);S.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),S.position.values.push(P.x,P.y,P.z),S.position.values.push(P.x,P.y,P.z),S.prevPosition.values.push(f[3*b],f[3*b+1],f[3*b+2]),S.prevPosition.values.push(f[3*b+3],f[3*b+4],f[3*b+5]),S.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),S.nextPosition.values.push(P.x,P.y,P.z),S.nextPosition.values.push(P.x,P.y,P.z),S.nextPosition.values.push(P.x,P.y,P.z),S.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(R.x,R.y,R.z,R.x,R.y,R.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(R.x,R.y,R.z,R.x,R.y,R.z),I.nextPosition.values.push(p[3*A],p[3*A+1],p[3*A+2]),I.nextPosition.values.push(p[3*A+3],p[3*A+4],p[3*A+5]);var D=n.fromArray(d,2*b,Ge),U=Math.abs(D.y);S.expandAndWidth.values.push(-1,U,1,U),S.expandAndWidth.values.push(-1,-U,1,-U),I.expandAndWidth.values.push(-1,U,1,U),I.expandAndWidth.values.push(-1,-U,1,-U);var L=i.magnitudeSquared(i.subtract(M,g,He));if(L/=i.magnitudeSquared(i.subtract(R,g,He)),c(y)){var q=o.fromArray(y,4*b,Je),F=o.fromArray(y,4*A,Je),j=v.lerp(q.x,F.x,L),B=v.lerp(q.y,F.y,L),z=v.lerp(q.z,F.z,L),G=v.lerp(q.w,F.w,L);for(r=4*b;4*b+8>r;++r)S.color.values.push(y[r]);for(S.color.values.push(j,B,z,G),S.color.values.push(j,B,z,G),I.color.values.push(j,B,z,G),I.color.values.push(j,B,z,G),r=4*A;4*A+8>r;++r)I.color.values.push(y[r])}if(c(h)){var V=n.fromArray(h,2*b,Ge),W=n.fromArray(h,2*(t+3),Ve),X=v.lerp(V.x,W.x,L);for(r=2*b;2*b+4>r;++r)S.st.values.push(h[r]);for(S.st.values.push(X,V.y),S.st.values.push(X,W.y),I.st.values.push(X,V.y),I.st.values.push(X,W.y),r=2*A;2*A+4>r;++r)I.st.values.push(h[r])}if(c(m)){var H=i.fromArray(m,3*b,Ke),Z=i.fromArray(m,3*A,Ke),K=v.lerp(H.x,Z.x,L);for(r=3*b;3*b+6>r;++r)S.dist.values.push(m[r]);for(S.dist.values.push(K,H.y,H.z),S.dist.values.push(K,H.y,H.z),I.dist.values.push(K,Z.y,Z.z),I.dist.values.push(K,Z.y,Z.z),r=3*A;3*A+6>r;++r)I.dist.values.push(m[r])}a=S.position.values.length/3-4,N.push(a,a+2,a+1),N.push(a+1,a+2,a+3),a=I.position.values.length/3-4,x.push(a,a+2,a+1),x.push(a+1,a+2,a+3)}else{var J,Q;for(g.y<0?(J=_.attributes,Q=_.indices):(J=E.attributes,Q=E.indices),J.position.values.push(g.x,g.y,g.z),J.position.values.push(g.x,g.y,g.z),J.position.values.push(R.x,R.y,R.z),J.position.values.push(R.x,R.y,R.z),r=3*t;3*t+12>r;++r)J.prevPosition.values.push(f[r]),J.nextPosition.values.push(p[r]);for(r=2*t;2*t+8>r;++r)J.expandAndWidth.values.push(d[r]),c(h)&&J.st.values.push(h[r]);if(c(y))for(r=4*t;4*t+16>r;++r)J.color.values.push(y[r]);if(c(m))for(r=3*t;3*t+12>r;++r)J.dist.values.push(m[r]);a=J.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}w&&(re(_),re(E)),k(e,_,E)}var ie={};ie.toWireframe=function(e){if(!c(e))throw new l("geometry is required.");var t=e.indices;if(c(t)){switch(e.primitiveType){case b.TRIANGLES:e.indices=R(t);break;case b.TRIANGLE_STRIP:e.indices=S(t);break;case b.TRIANGLE_FAN:e.indices=N(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=b.LINES}return e},ie.createLineSegmentsForVectors=function(e,t,n){if(t=s(t,"normal"),!c(e))throw new l("geometry is required.");if(!c(e.attributes.position))throw new l("geometry.attributes.position is required.");if(!c(e.attributes[t]))throw new l("geometry.attributes must have an attribute with the same name as the attributeName parameter, "+t+".");n=s(n,1e4);for(var i=e.attributes.position.values,o=e.attributes[t].values,a=i.length,f=new Float64Array(2*a),p=0,y=0;a>y;y+=3)f[p++]=i[y],f[p++]=i[y+1],f[p++]=i[y+2],f[p++]=i[y]+o[y]*n,f[p++]=i[y+1]+o[y+1]*n,f[p++]=i[y+2]+o[y+2]*n;var m,E=e.boundingSphere;return c(E)&&(m=new r(E.center,E.radius+n)),new d({attributes:{position:new h({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f})},primitiveType:b.LINES,boundingSphere:m})},ie.createAttributeLocations=function(e){if(!c(e))throw new l("geometry is required.");var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,a=r.length;for(t=0;a>t;++t){var u=r[t];c(n[u])&&(i[u]=o++)}for(var s in n)n.hasOwnProperty(s)&&!c(i[s])&&(i[s]=o++);return i},ie.reorderForPreVertexCache=function(e){if(!c(e))throw new l("geometry is required.");var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;t>i;i++)n[i]=-1;for(var o,a=r,s=a.length,f=m.createTypedArray(t,s),p=0,h=0,y=0;s>p;)o=n[a[p]],-1!==o?f[h]=o:(o=a[p],n[o]=y,f[h]=y,++y),++p,++h;e.indices=f;var E=e.attributes;for(var O in E)if(E.hasOwnProperty(O)&&c(E[O])&&c(E[O].values)){for(var v=E[O],_=v.values,w=0,T=v.componentsPerAttribute,b=u.createTypedArray(v.componentDatatype,y*T);t>w;){var A=n[w];if(-1!==A)for(var g=0;T>g;g++)b[T*A+g]=_[T*w+g];++w}v.values=b}}return e},ie.reorderForPostVertexCache=function(e,t){if(!c(e))throw new l("geometry is required.");var r=e.indices;if(e.primitiveType===b.TRIANGLES&&c(r)){for(var n=r.length,i=0,o=0;n>o;o++)r[o]>i&&(i=r[o]);e.indices=A.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},ie.fitToUnsignedShortIndices=function(e){if(!c(e))throw new l("geometry is required.");if(c(e.indices)&&e.primitiveType!==b.TRIANGLES&&e.primitiveType!==b.LINES&&e.primitiveType!==b.POINTS)throw new l("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=v.SIXTY_FOUR_KILOBYTES){var n,i=[],o=[],a=0,u=I(e.attributes),s=e.indices,f=s.length;e.primitiveType===b.TRIANGLES?n=3:e.primitiveType===b.LINES?n=2:e.primitiveType===b.POINTS&&(n=1);for(var p=0;f>p;p+=n){for(var h=0;n>h;++h){var y=s[p+h],m=i[y];c(m)||(m=a++,i[y]=m,x(u,e.attributes,y)),o.push(m)}a+n>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],a=0,u=I(e.attributes))}0!==o.length&&t.push(new d({attributes:u,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var oe=new i,ae=new a;ie.projectTo2D=function(e,t,r,n,o){if(!c(e))throw new l("geometry is required.");if(!c(t))throw new l("attributeName is required.");if(!c(r))throw new l("attributeName3D is required.");if(!c(n))throw new l("attributeName2D is required.");if(!c(e.attributes[t]))throw new l("geometry must have attribute matching the attributeName argument: "+t+".");if(e.attributes[t].componentDatatype!==u.DOUBLE)throw new l("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");var a=e.attributes[t];o=c(o)?o:new p;for(var s=o.ellipsoid,f=a.values,d=new Float64Array(f.length),y=0,m=0;md;++d)f.encode(o[d],ue),s[d]=ue.high,p[d]=ue.low;var y=i.componentsPerAttribute;return e.attributes[r]=new h({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:s}),e.attributes[n]=new h({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:p}),delete e.attributes[t],e};var se=new i,ce=new w,le=new _;ie.transformToWorldCoordinates=function(e){if(!c(e))throw new l("instance is required.");var t=e.modelMatrix;if(w.equals(t,w.IDENTITY))return e;var n=e.geometry.attributes;M(t,n.position),M(t,n.prevPosition),M(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(w.inverse(t,ce),w.transpose(ce,ce),w.getRotation(ce,le),C(le,n.normal),C(le,n.tangent),C(le,n.bitangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=w.clone(w.IDENTITY),e};var fe=new i;ie.combineInstances=function(e){if(!c(e)||e.length<1)throw new l("instances is required and must have length greater than zero.");for(var t=[],r=[],n=e.length,i=0;n>i;++i){var o=e[i];c(o.geometry)?t.push(o):c(o.westHemisphereGeometry)&&c(o.eastHemisphereGeometry)&&r.push(o)}var a=[];return t.length>0&&a.push(D(t,"geometry")),r.length>0&&(a.push(D(r,"westHemisphereGeometry")),a.push(D(r,"eastHemisphereGeometry"))),a};var pe=new i,de=new i,he=new i,ye=new i;ie.computeNormal=function(e){if(!c(e))throw new l("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new l("geometry.attributes.position.values is required.");if(!c(e.indices))throw new l("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new l("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==b.TRIANGLES)throw new l("geometry.primitiveType must be PrimitiveType.TRIANGLES.");var t,r=e.indices,n=e.attributes,o=n.position.values,a=n.position.values.length/3,s=r.length,f=new Array(a),p=new Array(s/3),d=new Array(s);for(t=0;a>t;t++)f[t]={indexOffset:0,count:0,currentCount:0};var y=0;for(t=0;s>t;t+=3){var m=r[t],E=r[t+1],O=r[t+2],_=3*m,w=3*E,T=3*O;de.x=o[_],de.y=o[_+1],de.z=o[_+2],he.x=o[w],he.y=o[w+1],he.z=o[w+2],ye.x=o[T],ye.y=o[T+1],ye.z=o[T+2],f[m].count++,f[E].count++,f[O].count++,i.subtract(he,de,he),i.subtract(ye,de,ye),p[y]=i.cross(he,ye,new i),y++}var A=0;for(t=0;a>t;t++)f[t].indexOffset+=A,A+=f[t].count;y=0;var g;for(t=0;s>t;t+=3){g=f[r[t]];var R=g.indexOffset+g.currentCount;d[R]=y,g.currentCount++,g=f[r[t+1]],R=g.indexOffset+g.currentCount,d[R]=y,g.currentCount++,g=f[r[t+2]],R=g.indexOffset+g.currentCount,d[R]=y,g.currentCount++,y++}var S=new Float32Array(3*a);for(t=0;a>t;t++){var N=3*t;if(g=f[t],i.clone(i.ZERO,pe),g.count>0){for(y=0;yn;n+=3){var O=r[n],v=r[n+1],_=r[n+2];y=3*O,m=3*v,E=3*_;var w=2*O,T=2*v,A=2*_,g=o[y],R=o[y+1],S=o[y+2],N=s[w],I=s[w+1],x=s[T+1]-I,M=s[A+1]-I,C=1/((s[T]-N)*M-(s[A]-N)*x),P=(M*(o[m]-g)-x*(o[E]-g))*C,D=(M*(o[m+1]-R)-x*(o[E+1]-R))*C,U=(M*(o[m+2]-S)-x*(o[E+2]-S))*C;d[y]+=P,d[y+1]+=D,d[y+2]+=U,d[m]+=P,d[m+1]+=D,d[m+2]+=U,d[E]+=P,d[E+1]+=D,d[E+2]+=U}var L=new Float32Array(3*f),q=new Float32Array(3*f);for(n=0;f>n;n++){y=3*n,m=y+1,E=y+2;var F=i.fromArray(a,y,me),j=i.fromArray(d,y,Oe),B=i.dot(F,j);i.multiplyByScalar(F,B,Ee),i.normalize(i.subtract(j,Ee,j),j),L[y]=j.x,L[m]=j.y,L[E]=j.z,i.normalize(i.cross(F,j,j),j),q[y]=j.x,q[m]=j.y,q[E]=j.z}return e.attributes.tangent=new h({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.bitangent=new h({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:q}),e};var ve=new n,_e=new i,we=new i,Te=new i,be=new n;ie.compressVertices=function(t){if(!c(t))throw new l("geometry is required.");var r,o,a=t.attributes.extrudeDirection;if(c(a)){var s=a.values;o=s.length/3;var f=new Float32Array(2*o),p=0;for(r=0;o>r;++r)i.fromArray(s,3*r,_e),i.equals(_e,i.ZERO)?p+=2:(be=e.octEncodeInRange(_e,65535,be),f[p++]=be.x,f[p++]=be.y);return t.attributes.compressedAttributes=new h({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:f}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,y=t.attributes.st,m=c(d),E=c(y);if(!m&&!E)return t;var O,v,_,w,T=t.attributes.tangent,b=t.attributes.bitangent,A=c(T),g=c(b);m&&(O=d.values),E&&(v=y.values),A&&(_=T.values),g&&(w=b.values);var R=m?O.length:v.length,S=m?3:2;o=R/S;var N=o,I=E&&m?2:1;I+=A||g?1:0,N*=I;var x=new Float32Array(N),M=0;for(r=0;o>r;++r){E&&(n.fromArray(v,2*r,ve),x[M++]=e.compressTextureCoordinates(ve));var C=3*r;m&&c(_)&&c(w)?(i.fromArray(O,C,_e),i.fromArray(_,C,we),i.fromArray(w,C,Te),e.octPack(_e,we,Te,ve),x[M++]=ve.x,x[M++]=ve.y):(m&&(i.fromArray(O,C,_e),x[M++]=e.octEncodeFloat(_e)),A&&(i.fromArray(_,C,_e),x[M++]=e.octEncodeFloat(_e)),g&&(i.fromArray(w,C,_e),x[M++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new h({componentDatatype:u.FLOAT,componentsPerAttribute:I,values:x}),m&&delete t.attributes.normal,E&&delete t.attributes.st,g&&delete t.attributes.bitangent,A&&delete t.attributes.tangent,t};var Ae=new i,ge=new i,Re=new i,Se=new i,Ne=new i,Ie={positions:new Array(7),indices:new Array(9)},xe=Z(o,4),Me=Z(i,3),Ce=Z(n,2),Pe=function(e,t,r,n,i,o,a){var u=i[e]*n.x,s=i[t]*n.y,c=i[r]*n.z;o[a]=u+s+c>v.EPSILON6?1:0},De=new i,Ue=new i,Le=new i,qe=new i,Fe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0},je=T.fromPointNormal(i.ZERO,i.UNIT_Y),Be=new i,ze=new i,Ge=new n,Ve=new n,We=new i,Xe=new i,He=new i,Ye=new i,ke=new i,Ze=new i,Ke=new i,Je=new o,Qe=5*v.EPSILON9,$e=v.EPSILON6;return ie.splitLongitude=function(e){if(!c(e))throw new l("instance is required.");var t=e.geometry,n=t.boundingSphere;if(c(n)){var i=n.center.x-n.radius;if(i>0||r.intersectPlane(n,T.ORIGIN_ZX_PLANE)!==E.INTERSECTING)return e}if(t.geometryType!==y.NONE)switch(t.geometryType){case y.POLYLINES:ne(e);break;case y.TRIANGLES:$(e);break;case y.LINES:te(e)}else z(t),t.primitiveType===b.TRIANGLES?$(e):t.primitiveType===b.LINES&&te(e);return e},ie}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return i.POSITION_ONLY=n(new i({position:!0})),i.POSITION_AND_NORMAL=n(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=n(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=n(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=n(new i({position:!0,color:!0})),i.ALL=n(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(n,i,o){if(!t(n))throw new r("value is required");if(!t(i))throw new r("array is required");return o=e(o,0),i[o++]=n.position?1:0,i[o++]=n.normal?1:0,i[o++]=n.st?1:0,i[o++]=n.tangent?1:0,i[o++]=n.bitangent?1:0,i[o]=n.color?1:0,i},i.unpack=function(n,o,a){if(!t(n))throw new r("array is required");return o=e(o,0),t(a)||(a=new i),a.position=1===n[o++],a.normal=1===n[o++],a.st=1===n[o++],a.tangent=1===n[o++],a.bitangent=1===n[o++],a.color=1===n[o],a},i.clone=function(e,r){return t(e)?(t(r)||(r=new i),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r):void 0},i}),define("Core/EllipseGeometry",["./arrayFill","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryOffsetAttribute","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./Rectangle","./VertexFormat"],function(e,t,r,n,i,o,a,u,s,c,l,f,p,d,h,y,m,E,O,v,_,w,T,b,A,g,R){"use strict";function S(t,i,o){var u=i.vertexFormat,c=i.center,l=i.semiMajorAxis,p=i.semiMinorAxis,h=i.ellipsoid,E=i.stRotation,v=o?t.length/3*2:t.length/3,_=i.shadowVolume,w=u.st?new Float32Array(2*v):void 0,b=u.normal?new Float32Array(3*v):void 0,g=u.tangent?new Float32Array(3*v):void 0,R=u.bitangent?new Float32Array(3*v):void 0,S=_?new Float32Array(3*v):void 0,N=0,I=W,x=X,M=H,C=new d(h),P=C.project(h.cartesianToCartographic(c,Y),k),D=h.scaleToGeodeticSurface(c,L);h.geodeticSurfaceNormal(D,D);var U=z,j=G;if(0!==E){var J=A.fromAxisAngle(D,E,V);U=T.fromQuaternion(J,U),J=A.fromAxisAngle(D,-E,V),j=T.fromQuaternion(J,j)}else U=T.clone(T.IDENTITY,U),j=T.clone(T.IDENTITY,j);for(var Q=r.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Z),$=r.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,K),ee=t.length,te=o?ee:0,re=te/3*2,ne=0;ee>ne;ne+=3){var ie=ne+1,oe=ne+2,ae=n.fromArray(t,ne,L);if(u.st){var ue=T.multiplyByVector(U,ae,q),se=C.project(h.cartesianToCartographic(ue,Y),F);n.subtract(se,P,se),B.x=(se.x+l)/(2*l),B.y=(se.y+p)/(2*p),Q.x=Math.min(B.x,Q.x),Q.y=Math.min(B.y,Q.y),$.x=Math.max(B.x,$.x),$.y=Math.max(B.y,$.y),o&&(w[N+re]=B.x,w[N+1+re]=B.y),w[N++]=B.x,w[N++]=B.y}(u.normal||u.tangent||u.bitangent||_)&&(I=h.geodeticSurfaceNormal(ae,I),_&&(S[ne+te]=-I.x,S[ie+te]=-I.y,S[oe+te]=-I.z),(u.normal||u.tangent||u.bitangent)&&((u.tangent||u.bitangent)&&(x=n.normalize(n.cross(n.UNIT_Z,I,x),x),T.multiplyByVector(j,x,x)),u.normal&&(b[ne]=I.x,b[ie]=I.y,b[oe]=I.z,o&&(b[ne+te]=-I.x,b[ie+te]=-I.y,b[oe+te]=-I.z)),u.tangent&&(g[ne]=x.x,g[ie]=x.y,g[oe]=x.z,o&&(g[ne+te]=-x.x,g[ie+te]=-x.y,g[oe+te]=-x.z)),u.bitangent&&(M=n.normalize(n.cross(I,x,M),M),R[ne]=M.x,R[ie]=M.y,R[oe]=M.z,o&&(R[ne+te]=M.x,R[ie+te]=M.y,R[oe+te]=M.z))))}if(u.st){ee=w.length;for(var ce=0;ee>ce;ce+=2)w[ce]=(w[ce]-Q.x)/($.x-Q.x),w[ce+1]=(w[ce+1]-Q.y)/($.y-Q.y)}var le=new m;if(u.position){var fe=f.raisePositionsToHeight(t,i,o);le.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:fe})}if(u.st&&(le.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:w})),u.normal&&(le.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:b})),u.tangent&&(le.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),u.bitangent&&(le.bitangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),_&&(le.extrudeDirection=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),o&&s(i.offsetAttribute)){var pe=new Uint8Array(v);if(i.offsetAttribute===O.TOP)pe=e(pe,1,0,v/2);else{var de=i.offsetAttribute===O.NONE?0:1;pe=e(pe,de)}le.applyOffset=new y({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:pe})}return le}function N(e){var t,r,n,i,o,a=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,i=0;3>i;i++)a[u++]=n++,a[u++]=t,a[u++]=n;for(i=2;e+1>i;++i){for(n=i*(i+1)-1,t=(i-1)*i-1,a[u++]=n++,a[u++]=t,a[u++]=n,r=2*i,o=0;r-1>o;++o)a[u++]=n,a[u++]=t++,a[u++]=t,a[u++]=n++,a[u++]=t,a[u++]=n;a[u++]=n++,a[u++]=t,a[u++]=n}for(r=2*e,++n,++t,i=0;r-1>i;++i)a[u++]=n,a[u++]=t++,a[u++]=t,a[u++]=n++,a[u++]=t,a[u++]=n;for(a[u++]=n,a[u++]=t++,a[u++]=t,a[u++]=n++,a[u++]=t++,a[u++]=t,++t,i=e-1;i>1;--i){for(a[u++]=t++,a[u++]=t,a[u++]=n,r=2*i,o=0;r-1>o;++o)a[u++]=n,a[u++]=t++,a[u++]=t,a[u++]=n++,a[u++]=t,a[u++]=n;a[u++]=t++,a[u++]=t++,a[u++]=n++}for(i=0;3>i;i++)a[u++]=t++,a[u++]=t,a[u++]=n;return a}function I(e){var r=e.center;J=n.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(r,J),e.height,J),J=n.add(r,J,J);var i=new t(J,e.semiMajorAxis),o=f.computeEllipsePositions(e,!0,!1),a=o.positions,u=o.numPts,s=S(a,e,!1),c=N(u);return c=_.createTypedArray(a.length/3,c),{boundingSphere:i,attributes:s,indices:c}}function x(t,i){var o=i.vertexFormat,u=i.center,c=i.semiMajorAxis,l=i.semiMinorAxis,f=i.ellipsoid,p=i.height,h=i.extrudedHeight,E=i.stRotation,v=t.length/3*2,_=new Float64Array(3*v),w=o.st?new Float32Array(2*v):void 0,b=o.normal?new Float32Array(3*v):void 0,g=o.tangent?new Float32Array(3*v):void 0,R=o.bitangent?new Float32Array(3*v):void 0,S=i.shadowVolume,N=S?new Float32Array(3*v):void 0,I=0,x=W,M=X,C=H,P=new d(f),D=P.project(f.cartesianToCartographic(u,Y),k),U=f.scaleToGeodeticSurface(u,L);f.geodeticSurfaceNormal(U,U);for(var G=A.fromAxisAngle(U,E,V),J=T.fromQuaternion(G,z),Q=r.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Z),$=r.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,K),ee=t.length,te=ee/3*2,re=0;ee>re;re+=3){var ne,ie=re+1,oe=re+2,ae=n.fromArray(t,re,L);if(o.st){var ue=T.multiplyByVector(J,ae,q),se=P.project(f.cartesianToCartographic(ue,Y),F);n.subtract(se,D,se),B.x=(se.x+c)/(2*c),B.y=(se.y+l)/(2*l),Q.x=Math.min(B.x,Q.x),Q.y=Math.min(B.y,Q.y),$.x=Math.max(B.x,$.x),$.y=Math.max(B.y,$.y),w[I+te]=B.x,w[I+1+te]=B.y,w[I++]=B.x,w[I++]=B.y}ae=f.scaleToGeodeticSurface(ae,ae),ne=n.clone(ae,q),x=f.geodeticSurfaceNormal(ae,x),S&&(N[re+ee]=-x.x,N[ie+ee]=-x.y,N[oe+ee]=-x.z);var ce=n.multiplyByScalar(x,p,j);if(ae=n.add(ae,ce,ae),ce=n.multiplyByScalar(x,h,ce),ne=n.add(ne,ce,ne),o.position&&(_[re+ee]=ne.x,_[ie+ee]=ne.y,_[oe+ee]=ne.z,_[re]=ae.x,_[ie]=ae.y,_[oe]=ae.z),o.normal||o.tangent||o.bitangent){C=n.clone(x,C);var le=n.fromArray(t,(re+3)%ee,j);n.subtract(le,ae,le);var fe=n.subtract(ne,ae,F);x=n.normalize(n.cross(fe,le,x),x),o.normal&&(b[re]=x.x,b[ie]=x.y,b[oe]=x.z,b[re+ee]=x.x,b[ie+ee]=x.y,b[oe+ee]=x.z),o.tangent&&(M=n.normalize(n.cross(C,x,M),M),g[re]=M.x,g[ie]=M.y,g[oe]=M.z,g[re+ee]=M.x,g[re+1+ee]=M.y,g[re+2+ee]=M.z),o.bitangent&&(R[re]=C.x,R[ie]=C.y,R[oe]=C.z,R[re+ee]=C.x,R[ie+ee]=C.y,R[oe+ee]=C.z)}}if(o.st){ee=w.length;for(var pe=0;ee>pe;pe+=2)w[pe]=(w[pe]-Q.x)/($.x-Q.x),w[pe+1]=(w[pe+1]-Q.y)/($.y-Q.y)}var de=new m;if(o.position&&(de.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:_})),o.st&&(de.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:w})),o.normal&&(de.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:b})),o.tangent&&(de.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),o.bitangent&&(de.bitangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),S&&(de.extrudeDirection=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),s(i.offsetAttribute)){var he=new Uint8Array(v);if(i.offsetAttribute===O.TOP)he=e(he,1,0,v/2);else{var ye=i.offsetAttribute===O.NONE?0:1;he=e(he,ye)}de.applyOffset=new y({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:he})}return de}function M(e){for(var t=e.length/3,r=_.createTypedArray(t,6*t),n=0,i=0;t>i;i++){var o=i,a=i+t,u=(o+1)%t,s=u+t;r[n++]=o,r[n++]=a,r[n++]=u,r[n++]=u,r[n++]=a,r[n++]=s}return r}function C(e){var r=e.center,i=e.ellipsoid,o=e.semiMajorAxis,a=n.multiplyByScalar(i.geodeticSurfaceNormal(r,L),e.height,L);Q.center=n.add(r,a,Q.center),Q.radius=o,a=n.multiplyByScalar(i.geodeticSurfaceNormal(r,a),e.extrudedHeight,a),$.center=n.add(r,a,$.center),$.radius=o;var u=f.computeEllipsePositions(e,!0,!0),s=u.positions,c=u.numPts,l=u.outerPositions,p=t.union(Q,$),d=S(s,e,!0),y=N(c),m=y.length;y.length=2*m;for(var O=s.length/3,w=0;m>w;w+=3)y[w+m]=y[w+2]+O,y[w+1+m]=y[w+1]+O,y[w+2+m]=y[w]+O;var T=_.createTypedArray(2*O/3,y),A=new h({attributes:d,indices:T,primitiveType:b.TRIANGLES}),g=x(l,e);y=M(l);var R=_.createTypedArray(2*l.length/3,y),I=new h({attributes:g,indices:R,primitiveType:b.TRIANGLES}),C=v.combineInstances([new E({geometry:A}),new E({geometry:I})]);return{boundingSphere:p,attributes:C[0].attributes,indices:C[0].indices}}function P(e,t,r,i,o,a,u){for(var s=f.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:r,rotation:i,granularity:o},!1,!0),c=s.outerPositions,l=c.length/3,p=new Array(l),d=0;l>d;++d)p[d]=n.fromArray(c,3*d);var h=g.fromCartesianArray(p,a,u);return h.width>w.PI&&(h.north=h.north>0?w.PI_OVER_TWO-w.EPSILON7:h.north,h.south=h.south<0?w.EPSILON7-w.PI_OVER_TWO:h.south,h.east=w.PI,h.west=-w.PI),h}function D(e){e=u(e,u.EMPTY_OBJECT);var t=e.center,r=u(e.ellipsoid,p.WGS84),i=e.semiMajorAxis,a=e.semiMinorAxis,s=u(e.granularity,w.RADIANS_PER_DEGREE),c=u(e.vertexFormat,R.DEFAULT);if(o.defined("options.center",t),o.typeOf.number("options.semiMajorAxis",i),o.typeOf.number("options.semiMinorAxis",a),a>i)throw new l("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(0>=s)throw new l("granularity must be greater than zero.");var f=u(e.height,0),d=u(e.extrudedHeight,f);this._center=n.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=a,this._ellipsoid=p.clone(r),this._rotation=u(e.rotation,0),this._stRotation=u(e.stRotation,0),this._height=Math.max(d,f),this._granularity=s,this._vertexFormat=R.clone(c),this._extrudedHeight=Math.min(d,f),this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}function U(e){var t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];for(var r=f.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0),i=r.outerPositions,o=i.length/3,a=new Array(o),u=0;o>u;++u)a[u]=n.fromArray(i,3*u);var s=e._ellipsoid,c=e.rectangle;return h._textureCoordinateRotationPoints(a,t,s,c)}var L=new n,q=new n,F=new n,j=new n,B=new r,z=new T,G=new T,V=new A,W=new n,X=new n,H=new n,Y=new i,k=new n,Z=new r,K=new r,J=new n,Q=new t,$=new t;D.packedLength=n.packedLength+p.packedLength+R.packedLength+9,D.pack=function(e,t,r){return o.defined("value",e),o.defined("array",t),r=u(r,0),n.pack(e._center,t,r),r+=n.packedLength,p.pack(e._ellipsoid,t,r),r+=p.packedLength,R.pack(e._vertexFormat,t,r),r+=R.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._shadowVolume?1:0,t[r]=u(e._offsetAttribute,-1),t};var ee=new n,te=new p,re=new R,ne={center:ee,ellipsoid:te,vertexFormat:re,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};return D.unpack=function(e,t,r){o.defined("array",e),t=u(t,0);var i=n.unpack(e,t,ee);t+=n.packedLength;var a=p.unpack(e,t,te);t+=p.packedLength;var c=R.unpack(e,t,re);t+=R.packedLength;var l=e[t++],f=e[t++],d=e[t++],h=e[t++],y=e[t++],m=e[t++],E=e[t++],O=1===e[t++],v=e[t];return s(r)?(r._center=n.clone(i,r._center),r._ellipsoid=p.clone(a,r._ellipsoid),r._vertexFormat=R.clone(c,r._vertexFormat),r._semiMajorAxis=l,r._semiMinorAxis=f, r._rotation=d,r._stRotation=h,r._height=y,r._granularity=m,r._extrudedHeight=E,r._shadowVolume=O,r._offsetAttribute=-1===v?void 0:v,r):(ne.height=y,ne.extrudedHeight=E,ne.granularity=m,ne.stRotation=h,ne.rotation=d,ne.semiMajorAxis=l,ne.semiMinorAxis=f,ne.shadowVolume=O,ne.offsetAttribute=-1===v?void 0:v,new D(ne))},D.computeRectangle=function(e,t){e=u(e,u.EMPTY_OBJECT);var r=e.center,n=u(e.ellipsoid,p.WGS84),i=e.semiMajorAxis,a=e.semiMinorAxis,s=u(e.granularity,w.RADIANS_PER_DEGREE),c=u(e.rotation,0);if(o.defined("options.center",r),o.typeOf.number("options.semiMajorAxis",i),o.typeOf.number("options.semiMinorAxis",a),a>i)throw new l("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(0>=s)throw new l("granularity must be greater than zero.");return P(r,i,a,c,s,n,t)},D.createGeometry=function(t){if(!(t._semiMajorAxis<=0||t._semiMinorAxis<=0)){var r=t._height,n=t._extrudedHeight,i=!w.equalsEpsilon(r,n,0,w.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);var o,u={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:r,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};if(i)u.extrudedHeight=n,u.shadowVolume=t._shadowVolume,u.offsetAttribute=t._offsetAttribute,o=C(u);else if(o=I(u),s(t._offsetAttribute)){var c=o.attributes.position.values.length,l=new Uint8Array(c/3),f=t._offsetAttribute===O.NONE?0:1;e(l,f),o.attributes.applyOffset=new y({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new h({attributes:o.attributes,indices:o.indices,primitiveType:b.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:t._offsetAttribute})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,i=e._ellipsoid,o=t(n,i),a=r(n,i);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:i,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:o,height:a,vertexFormat:R.POSITION_ONLY,shadowVolume:!0})},c(D.prototype,{rectangle:{get:function(){return s(this._rectangle)||(this._rectangle=P(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return s(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=U(this)),this._textureCoordinateRotationPoints}}}),D}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,n,i,o,a,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT);var n=e.radius;t.typeOf.number("radius",n);var i={center:e.center,semiMajorAxis:n,semiMinorAxis:n,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new o(i),this._workerName="createCircleGeometry"}s.packedLength=o.packedLength,s.pack=function(e,r,n){return t.typeOf.object("value",e),o.pack(e._ellipseGeometry,r,n)};var c=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new u,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return s.unpack=function(t,r,i){var f=o.unpack(t,r,c);return l.center=e.clone(f._center,l.center),l.ellipsoid=a.clone(f._ellipsoid,l.ellipsoid),l.height=f._height,l.extrudedHeight=f._extrudedHeight,l.granularity=f._granularity,l.vertexFormat=u.clone(f._vertexFormat,l.vertexFormat),l.stRotation=f._stRotation,l.shadowVolume=f._shadowVolume,n(i)?(l.semiMajorAxis=f._semiMajorAxis,l.semiMinorAxis=f._semiMinorAxis,i._ellipseGeometry=new o(l),i):(l.radius=f._semiMajorAxis,new s(l))},s.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},s.createShadowVolume=function(e,t,r){var n=e._ellipseGeometry._granularity,i=e._ellipseGeometry._ellipsoid,o=t(n,i),a=r(n,i);return new s({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:i,stRotation:e._ellipseGeometry._stRotation,granularity:n,extrudedHeight:o,height:a,vertexFormat:u.POSITION_ONLY,shadowVolume:!0})},i(s.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),s}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function i(i,o){return r(o)&&(i=t.unpack(i,o)),i._ellipseGeometry._center=e.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=n.clone(i._ellipseGeometry._ellipsoid),t.createGeometry(i)}return i})}();