/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2016 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 almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ /** @license when.js - https://github.com/cujojs/when MIT License (c) copyright B Cavalier & J Hann * A lightweight CommonJS Promises/A and when() implementation * when is part of the cujo.js family of libraries (http://cujojs.com/) * * Licensed under the MIT License at: * http://www.opensource.org/licenses/mit-license.php * * @version 1.7.1 */ /** @license mersenne-twister.js - https://gist.github.com/banksean/300494 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 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. * */ // Copyright 2012 Google Inc., Apache 2.0 license. /** @license tween.js - https://github.com/sole/tween.js Copyright (c) 2010-2012 Tween.js authors. Easing equations Copyright (c) 2001 Robert Penner http://robertpenner.com/easing/ 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 fontmetrics.js - https://github.com/Pomax/fontmetrics.js Copyright (C) 2011 by Mike "Pomax" Kamermans 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 topojson - https://github.com/mbostock/topojson Copyright (c) 2012, Michael Bostock All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name Michael Bostock 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 MICHAEL BOSTOCK 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. */ /*! * Autolinker.js * 0.17.1 * * Copyright(c) 2015 Gregory Jacobs * MIT Licensed. http://www.opensource.org/licenses/mit-license.php * * https://github.com/gregjacobs/Autolinker.js */ /** @license Copyright (c) 2013 Gildas Lormeau. 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 the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 JCRAFT, INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/ /** * @license * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. * * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED * *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA * OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT, OR * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY * OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ /** * @license * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the project nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Modifications made by Analytical Graphics, Inc. */ /*! * Knockout JavaScript library v3.4.0 * (c) Steven Sanderson - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ /** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license */ /** * @license * NoSleep.js v0.5.0 - git.io/vfn01 * Rich Tibbett * MIT license **/ !function(){var e,t,i;!function(r){function n(e,t){return w.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p,m=t&&t.split("/"),f=y.map,_=f&&f["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,y.nodeIdCompat&&E.test(e[a])&&(e[a]=e[a].replace(E,"")),"."===e[0].charAt(0)&&m&&(p=m.slice(0,m.length-1),e=p.concat(e)),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((m||_)&&f){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;h>0;h-=1)if(n=f[m.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&_&&_[r]&&(l=_[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=S.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),m.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){g[e]=t}}function u(e){if(n(v,e)){var t=v[e];delete v[e],C[e]=!0,p.apply(r,t)}if(!n(g,e)&&!n(C,e))throw new Error("No "+e);return g[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return e?c(e):[]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,m,f,_,g={},v={},y={},C={},w=Object.prototype.hasOwnProperty,S=[].slice,E=/\.js$/;f=function(e,t){var i,r=c(e),n=r[0],a=t[1];return e=r[1],n&&(n=o(n,a),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(a)):o(e,a):(e=o(e,a),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},_={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:d(e)}}},p=function(e,t,i,o){var s,c,d,p,m,y,w,S=[],E=typeof i;if(o=o||e,y=h(o),"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m>>0,u=Math.max(0,Math.min(i,v)),h=[],c=v-u+1,d=[],p=a(),u)for(_=p.progress,f=function(e){d.push(e),--c||(m=f=g,p.reject(d))},m=function(e){h.push(e),--u||(m=f=g,p.resolve(h))},y=0;y>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=p,e.any=u,e.some=l,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;ot)throw new i("Expected "+e+" to be at most "+t)},a.numeric.minimum=function(e,t){if(a.typeOf.number(e),a.typeOf.number(t),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 i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&e];for(;i>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return ei?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;nr.EPSILON12);return t(u)?(u.x=c*P,u.y=h*D,u.z=d*M,u):new e(c*P,h*D,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var m=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,_=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,_,u);if(i(g)){var v=e.multiplyComponents(g,f,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,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),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n=this._radii.z-n))return o},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0,p=e.length;d=0?m.longitude:m.longitude+s.TWO_PI;a=Math.min(a,f),u=Math.max(u,f)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),i(r)?(r.west=n,r.south=c,r.east=o,r.north=h,r):new l(n,c,o,h)},l.clone=function(e,t){if(i(e))return i(t)?(t.west=e.west, t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),n=p))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=p,r):new l(c,d,h,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),nn||s.equalsEpsilon(i,n,s.EPSILON14))&&(i=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,r,n,a){r=t(r,o.WGS84),n=t(n,0),i(a)||(a=[]);var c=0,h=e.north,d=e.south,p=e.east,m=e.west,f=u;f.height=n,f.longitude=m,f.latitude=h,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,h<0?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var _=1;_<8;++_)f.longitude=-Math.PI+_*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=r.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=a&&(p=a-1);var m=(o.north-t.latitude)/h|0;return m>=u&&(m=u-1),i(n)?(n.x=p,n.y=m,n):new e(p,m)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;d0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(i,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(r,0),this[7]=t(a,0),this[8]=t(u,0)}function l(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,i=0;i<3;++i){var r=e[s.getElementIndex(m[i],p[i])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var i=a.EPSILON15,r=0,n=1,o=0;o<3;++o){var l=Math.abs(e[s.getElementIndex(m[o],p[o])]);l>r&&(n=o,r=l)}var u=1,c=0,h=p[n],d=m[n];if(Math.abs(e[s.getElementIndex(d,h)])>i){var f,_=e[s.getElementIndex(d,d)],g=e[s.getElementIndex(h,h)],v=e[s.getElementIndex(d,h)],y=(_-g)/2/v;f=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+f*f),c=f*u}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(h,h)]=t[s.getElementIndex(d,d)]=u,t[s.getElementIndex(d,h)]=c,t[s.getElementIndex(h,d)]=-c,t}s.packedLength=9,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r++]=e[7],i[r++]=e[8],i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n[4]=e[r++],n[5]=e[r++],n[6]=e[r++],n[7]=e[r++],n[8]=e[r++],n},s.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],n[8]=e[r+8],n},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,l=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=r-l-h+p,f=2*(n-d),_=2*(o+c),g=2*(n+d),v=-r+l-h+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-r-l+h+p;return i(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new s(m,f,_,g,v,y,C,w,S)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),l=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,h=-o*l+u*a*n,d=u*l+o*a*n,p=r*l,m=o*n+u*a*l,f=-a*o+o*a*l,_=-a,g=u*r,v=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=h,t[4]=m,t[5]=g,t[6]=d,t[7]=f,t[8]=v,t):new s(c,h,d,p,m,f,_,g,v)},s.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new s(1,0,0,0,r,-n,0,n,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new s(r,0,n,0,1,0,-n,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-n,0,n,r,0,0,0,1)},s.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},s.setColumn=function(e,t,i,r){r=s.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},s.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},s.setRow=function(e,t,i,r){return r=s.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var h=new e;s.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),i};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},s.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},s.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},s.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},s.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},s.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var p=[1,0,0],m=[2,2,1],f=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,n=10,o=0,h=0;i(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),p=t.diagonal=s.clone(e,t.diagonal),m=r*l(p);hm;)c(p,f),s.transpose(f,_),s.multiply(p,f,p),s.multiply(_,p,p),s.multiply(d,f,d),++o>2&&(++h,o=0);return t},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},s.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},s.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=s.determinant(e);t[0]=a*h-c*l,t[1]=c*n-r*h,t[2]=r*l-a*n,t[3]=u*l-o*h,t[4]=i*h-u*n,t[5]=o*n-i*l,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/d;return s.multiplyByScalar(t,p,t)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,r(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,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},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}),i("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r,n){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0),this.w=e(n,0)}o.fromElements=function(e,i,r,n,a){return t(a)?(a.x=e,a.y=i,a.z=r,a.w=n,a):new o(e,i,r,n)},o.fromColor=function(e,i){return t(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,i){if(t(e))return t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w,i):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(t,i,r){return r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w,i},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r++],n.w=i[r],n},o.packArray=function(e,i){var r=e.length;t(i)?i.length=4*r:i=new Array(4*r);for(var n=0;nl.x&&e.clone(n,l),Au.y&&e.clone(n,u),Pc.z&&e.clone(n,c)}var D=e.magnitudeSquared(e.subtract(l,o,C)),M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=D;M>N&&(N=M,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),V=S;V.x=o.x,V.y=a.y,V.z=s.z;var k=E;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,C),.5,b),U=0;for(T=0;TU&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,C));if(W>B){var H=Math.sqrt(W);F=.5*(F+H),B=F*F;var q=H-F;L.x=(F*L.x+q*n.x)/H,L.y=(F*L.y+q*n.y)/H,L.z=(F*L.z+q*n.z)/H}}return Fh.x&&e.clone(s,h),MT.y&&e.clone(s,T),Ix.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(h,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=h,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var V=w;V.x=.5*(L.x+B.x),V.y=.5*(L.y+B.y),V.z=.5*(L.z+B.z);var k=e.magnitudeSquared(e.subtract(B,V,C)),z=Math.sqrt(k),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=h.x,G.y=T.y,G.z=x.z;var W=e.multiplyByScalar(e.add(U,G,C),.5,b),H=0;for(P=0;PH&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,C));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return zu.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Dh.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(h,l,C)),O=a,N=u,L=M;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=h);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),V=Math.sqrt(F),k=S;k.x=a.x,k.y=s.y,k.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,C),.5,b),G=0;for(x=0;xG&&(G=W);var H=e.magnitudeSquared(e.subtract(o,B,C));if(H>F){var q=Math.sqrt(H);V=.5*(V+q),F=V*V;var j=q-V;B.x=(V*B.x+j*o.x)/q,B.y=(V*B.y+j*o.y)/q,B.z=(V*B.z+j*o.z)/q}}return V=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(p,o,p),e.clone(p,n.center),n.radius=h,n};var F=new e;d.expand=function(t,i,r){r=d.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},d.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;hs&&s/a0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,p=l*l,m=a*l-d,f=a*u-s*l,_=s*u-p,g=4*m*_-f*f;if(g<0){var v,y,C;d*h>=c*p?(v=a,y=m,C=-2*s*m+a*f):(v=u,y=_,C=-u*f+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=m,A=-2*s*m+a*f,P=_,D=-u*f+2*l*_,M=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var V=-u,k=o+N<2*l?o+l:N+l,z=V/k,U=B*k,G=-L*k-B*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return F<=H?F<=z?H<=z?[F,H,z]:[F,z,H]:[z,F,H]:F<=z?[H,F,z]:H<=z?[H,z,F]:[z,H,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,p=h[h.length-1];if(Math.abs(p)=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[d-y,d-v,d+v,d+y]}if(_>=0&&g<0)return f=Math.sqrt(_),[d-f,d+f];if(_<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==b.length?(b[0]+=d,b[1]+=d,E[1]<=b[0]?[E[0],E[1],b[0],b[1]]:b[1]<=E[0]?[b[0],b[1],E[0],E[1]]:E[0]>=b[0]&&E[1]<=b[1]?[b[0],E[0],E[1],b[1]]:b[0]>=E[0]&&b[1]<=E[1]?[E[0],b[0],b[1],E[1]]:E[0]>b[0]&&E[0]0){var m,f,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s0?y.push(new e(n,u*B,u*-k)):0!==k?(y.push(new e(n,u*B,u*-k)),y.push(new e(n,u*B,u*k)),++N):y.push(new e(n,u*B,u*k))}return y}var m={};m.rayPlane=function(t,i,n){r(n)||(n=new e);var a=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)E)return;if(u=e.cross(l,C,y),h=e.dot(m,u),h<0||c+h>E)return;d=e.dot(w,u)/E}else{if(Math.abs(E)1)return;if(u=e.cross(l,C,y),h=e.dot(m,u)*b,h<0||c+h>1)return;d=e.dot(w,u)*b}return d},m.rayTriangle=function(t,i,n,o,a,s){var l=m.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new u;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var w={root0:0,root1:0};m.raySphere=function(e,t,i){if(i=h(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var S=new u;m.lineSegmentSphere=function(t,i,n,o){var a=S;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var E=new e,b=new e;m.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,E),c=e.multiplyComponents(l,t.direction,b),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,n=e.magnitudeSquared(c),o=n*r,po){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=r/s;return m=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,T),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,P),m=e.normalize(e.cross(d,h,x),x),f=e.normalize(e.cross(h,m,A),A),_=M;_[0]=h.x,_[1]=h.y,_[2]=h.z,_[3]=m.x,_[4]=m.y,_[5]=m.z,_[6]=f.x,_[7]=f.y,_[8]=f.z;var g=a.transpose(_,I),v=a.fromScale(i.radii,R),y=a.fromScale(i.oneOverRadii,O),C=N;C[0]=0,C[1]=-s.z,C[2]=s.y,C[3]=s.z,C[4]=0,C[5]=-s.x,C[6]=-s.y,C[7]=s.x,C[8]=0;var w,S,E=a.multiply(a.multiply(g,y,L),C,L),b=a.multiply(a.multiply(E,v,B),_,B),z=a.multiplyByVector(E,n,D),U=p(b,e.negate(z,T),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,V),H=Number.NEGATIVE_INFINITY,q=0;qH&&(H=Y,W=e.clone(w,W))}var X=i.cartesianToCartographic(W,k);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,P))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,i,n,a){r(a)||(a=new e);var s=e.subtract(i,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},m.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if(1!==c&&2!==c||(h=new e,d=new e),1===c){if(s)return m.lineSegmentPlane(t,i,n,h),m.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(i,r,n,h),m.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(r,t,n,h),m.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(i,t,n,h),m.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(r,i,n,h),m.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,r,n,h),m.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),i("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),i("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){t(n[i])||(n[i]=!0,console.log(e(r,i)))}var n={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),i("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var p,m,f,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),v,u,h,C,S);case"c":return s(String.fromCharCode(+g),v,u,h,C);case"b":return a(g,2,w,v,u,h,C);case"o":return a(g,8,w,v,u,h,C);case"x":return a(g,16,w,v,u,h,C);case"X":return a(g,16,w,v,u,h,C).toUpperCase();case"u":return a(g,10,w,v,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=p<0?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=p<0?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("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)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):o<=1?void 0:f.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function m(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&h(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;f.fromDate=function(e,t){var i=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,d=0,_=0,y=0,T=0,D=s[0],M=s[1];if(s=D.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=D.match(w),null!==s)i=+s[1],l=+s[2];else if(s=D.match(C),null!==s)i=+s[1];else{var I;if(s=D.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=D.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4)); I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(M)){s=M.match(P),null!==s?(d=+s[1],_=+s[2],y=+s[3],T=1e3*+(s[4]||0),L=5):(s=M.match(A),null!==s?(d=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=M.match(x),null!==s&&(d=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],V=+(s[L+2]||0);switch(B){case"+":d-=F,_-=V;break;case"-":d+=F,_+=V;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,d,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var k=60===y;for(k&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=m(i,l,c,d,_,y,T);return r(t)?(p(z[0],z[1],t),h(t)):t=new f(z[0],z[1],u.UTC),k&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var D=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,D);r(n)||(f.addSeconds(e,-1,D),n=d(D,D),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var p=80*u/2447|0,m=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+h+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=m,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,m,v,C,w,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI)},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36),new s(new f(2457754,43237,u.TAI),37)],f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),i("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o=300)return void u.reject(new n(m.status,m.response,m.getAllResponseHeaders()));var e=m.response,r=m.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(m.responseXML)&&m.responseXML.hasChildNodes()?u.resolve(m.responseXML):""!==r&&"text"!==r||!i(m.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(m.responseText);else u.resolve(e)},m.onerror=function(e){u.reject(new n)},m.send(s)},s.defaultLoad=s.load,s}),i("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))m(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function m(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||d<0||m<0||f<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;Ct.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,p=o*l,m=i[d+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-m;if(v>.5||v<-.5){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?m=g:g-=C-y)}return s.xPoleWander=_(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(h,m,g),s}return d.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],p=a.lessThanOrEquals(h,e),m=!r(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,p=[],m=h;m<=d;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,l<0&&(l=0));var d=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(p[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var m,f,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(m=0;m<=s;++m)g[m]=_-C[m];for(m=0;m<=s;++m){for(y[m]=1,f=0;f<=s;++f)f!==m&&(y[m]*=g[f]);y[m]*=v[m];var w=3*(l+m);i.x+=y[m]*p[w++],i.y+=y[m]*p[w++],i.s+=y[m]*p[w]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a0)r=Math.sqrt(f+1),u=.5*r,r=.5/r,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var _=c,g=0;p>d&&(g=1),m>d&&m>p&&(g=2);var v=_[g],y=_[v];r=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(v,v)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,v)]-e[s.getElementIndex(v,y)])*r,C[v]=(e[s.getElementIndex(v,g)]+e[s.getElementIndex(g,v)])*r,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*r,n=-C[0],o=-C[1],a=-C[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var d=new l;l.fromHeadingPitchRoll=function(t,i,r,n){var o=l.fromAxisAngle(e.UNIT_X,r,d),a=l.fromAxisAngle(e.UNIT_Y,-i,n);n=l.multiply(a,o,a);var s=l.fromAxisAngle(e.UNIT_Z,-t,d);return l.multiply(s,n,n)};var p=new e,m=new e,f=new l,_=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.x=e[r],n.y=e[r+1],n.z=e[r+2],n.w=e[r+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,g),l.conjugate(g,g);for(var n=0,o=i-t+1;n=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-D[h])*a,I[h]=(P[h]*c-D[h])*a;var d=n*i*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),p=s*(1+I[0]*(1+I[1]*(1+I[2]*(1+I[3]*(1+I[4]*(1+I[5]*(1+I[6]*(1+I[7])))))))),m=l.multiplyByScalar(e,p,x);return l.multiplyByScalar(t,d,r),l.add(m,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,b),s=l.fastSlerp(i,r,n,T); return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";var w={},S=new i,E=new i,b=new i;w.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-n,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(0,-n,0,e.x,1,0,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(l.x,u.x,s.x,e.x,l.y,u.y,s.y,e.y,l.z,u.z,s.z,e.z,0,0,0,1)};var T=new i,x=new i,A=new i;w.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,1,0,e.y,0,0,-n,e.z,0,0,0,1)}var s=T,l=x,u=A;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=-s.x,r[9]=-s.y,r[10]=-s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,l.x,-s.x,e.x,u.y,l.y,-s.y,e.y,u.z,l.z,-s.z,e.z,0,0,0,1)},w.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=n,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,0,1,e.y,0,n,0,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,s.x,l.x,e.x,u.y,s.y,l.y,e.y,u.z,s.z,l.z,e.z,0,0,0,1)},w.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,-1,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=-l.x,r[5]=-l.y,r[6]=-l.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,-l.x,s.x,e.x,u.y,-l.y,s.y,e.y,u.z,-l.z,s.z,e.z,0,0,0,1)};var P=new y,D=new i(1,1,1),M=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var l;"object"==typeof t?(o=r,a=n,l=t.heading,r=t.pitch,n=t.roll):(s("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),l=t);var u=y.fromHeadingPitchRoll(l,r,n,P),c=v.fromTranslationQuaternionRotationScale(i.ZERO,u,D,M);return a=w.eastNorthUpToFixedFrame(e,o,a),v.multiply(a,c,a)};var I=new d,R=new v,O=new g;w.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a;"object"==typeof t?(a=t,n=i,o=r):(s("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),I.heading=t,I.pitch=i,I.roll=r,a=I);var l=w.headingPitchRollToFixedFrame(e,a,n,R),u=v.getRotation(l,O);return y.fromRotationMatrix(u,o)};var N=24110.54841,L=8640184.812866,B=.093104,F=-62e-7,V=1.1772758384668e-19,k=72921158553e-15,z=_.TWO_PI/86400,U=new f;w.computeTemeToPseudoFixedMatrix=function(e,t){U=f.addSeconds(e,-f.computeTaiMinusUtc(e),U);var i,r=U.dayNumber,n=U.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var s=N+i*(L+i*(B+i*F)),l=s*z%_.TWO_PI,u=k+V*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,h=l+u*c,d=Math.cos(h),p=Math.sin(h);return a(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(d,p,0,-p,d,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=u.NONE;var G=32.184,W=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(a(i))return g.transpose(i,t)};var H=new m(0,0,0),q=new c(0,0,0,0,0,0),j=new g,Y=new g;w.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,q);if(a(i)){var r=e.dayNumber,n=e.secondsOfDay+G,o=w.iau2006XysData.computeXysRadians(r,n,H);if(a(o)){var s=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=j;c[0]=1-u*s*s,c[3]=-u*s*l,c[6]=s,c[1]=-u*s*l,c[4]=1-u*l*l,c[7]=l,c[2]=-s,c[5]=-l,c[8]=1-u*(s*s+l*l);var h=g.fromRotationZ(-o.s,Y),d=g.multiply(c,h,j),p=e.dayNumber,m=e.secondsOfDay-f.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=m/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,Y),b=g.multiply(d,E,j),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-W+n/C.SECONDS_PER_DAY;D/=36525;var M=-47e-6*D*_.RADIANS_PER_DEGREE/3600,I=Math.cos(M),R=Math.sin(M),O=Y;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var X=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){a(o)||(o=new t);var s=X;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),v.multiplyByVector(i,s,s),t.fromCartesian4(s,o)};var Z=new i,K=new i,Q=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var s=o(r,h.WGS84).geodeticSurfaceNormal(e,Z),l=i.cross(t,s,K);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.cross(t,u,l),i.negate(l,l),a(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new n,$=new i,ee=new i,te=new r,ie=new r,re=new r,ne=new r,oe=new r,ae=new v,se=new v;return w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,te),s=o.cartesianToCartographic(a,J),l=w.eastNorthUpToFixedFrame(a,o,ae),u=v.inverseTransformation(l,se),c=e.project(s,$),h=ie;h.x=c.z,h.y=c.x,h.z=c.y,h.w=1;var d=v.getColumn(t,0,ee),p=i.magnitude(d),m=v.multiplyByVector(u,d,re);r.fromElements(m.z,m.x,m.y,0,m);var f=v.getColumn(t,1,ee),_=i.magnitude(f),g=v.multiplyByVector(u,f,ne);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,ee),C=i.magnitude(y),S=oe;return i.cross(m,g,S),i.normalize(S,S),i.cross(g,S,m),i.normalize(m,m),i.cross(S,m,g),i.normalize(g,g),i.multiplyByScalar(m,p,m),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,m,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,h,n),n},w}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,f)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,f));var o=i.fromCartesian4(c.getColumn(r,2,f));this._plane=h.fromPointNormal(e,o)}var f=new r;a(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;m.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new m(r.center,i)};var g=new d,v=new i;m.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},m.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,d.latitude=f.latitude=g.latitude=e.north,w.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(D,M),c.projectPointsToNearestOnPlane(M,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=d.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(D,M);var N=Math.min(p.getPointDistance(h,M[0]),p.getPointDistance(h,M[2]),p.getPointDistance(h,M[4]),p.getPointDistance(h,M[6])),L=i;return _(c,T,x,R,O,N,L,o)},f.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes)},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return h<=-c?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,R),a=d.getColumn(n,1,O),s=d.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=L;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var p,m=0;return h.x<-l?(p=h.x+l,m+=p*p):h.x>l&&(p=h.x-l,m+=p*p),h.y<-u?(p=h.y+u,m+=p*p):h.y>u&&(p=h.y-u,m+=p*p),h.z<-c?(p=h.z+c,m+=p*p):h.z>c&&(p=h.z-c,m+=p*p),m};var B=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,R),p=d.getColumn(u,1,O),m=d.getColumn(u,2,N),f=i.add(h,p,B);i.add(f,m,f),i.add(f,l,f);var _=i.subtract(f,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var V=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,V);return!i.isBoundingSphereVisible(r)},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncodeInRange=function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),i("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,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};return e(t)}),i("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT: return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,d){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,h),E=r-t,b=Math.max(i.maximumComponent(S),E);_=bl.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new h,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,D=Math.exp,M=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),V=1/F.maximumRadius,k=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(k.west),S=I(k.south),E=I(k.east),b=I(k.north)):(u=k.west*V,S=M-2*P(D(-k.south*V)),E=k.east*V,b=M-2*P(D(-k.north*V)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var W,H,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(k)/(O-1),te=p.computeHeight(k)/(N-1),ie=F.radiiSquared,re=ie.x,ne=ie.y,oe=ie.z,ae=65536,se=-65536,le=f.eastNorthUpToFixedFrame(U,F),ue=h.inverseTransformation(le,y);j&&(W=_.geodeticLatitudeToMercatorAngle(S),H=1/(_.geodeticLatitudeToMercatorAngle(b)-W));var ce=C;ce.x=Number.POSITIVE_INFINITY,ce.y=Number.POSITIVE_INFINITY,ce.z=Number.POSITIVE_INFINITY;var he=w;he.x=Number.NEGATIVE_INFINITY,he.y=Number.NEGATIVE_INFINITY,he.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,pe=O+(L>0?2:0),me=N+(L>0?2:0),fe=pe*me,_e=new Array(fe),ge=new Array(fe),ve=new Array(fe),ye=j?new Array(fe):[],Ce=0,we=N,Se=0,Ee=O;L>0&&(--Ce,++we,--Se,++Ee);for(var be=0,Te=Ce;Te=N&&(xe=N-1);var Ae=k.north-te*xe;Ae=B?I(Ae):M-2*P(D(-Ae*V));var Pe=T(Ae),De=x(Ae),Me=oe*De,Ie=(Ae-S)/(b-S);Ie=c.clamp(Ie,0,1);var Re;j&&(Re=(_.geodeticLatitudeToMercatorAngle(Ae)-W)*H);for(var Oe=Se;Oe=O&&(Ne=O-1);var Le=k.west+ee*Ne;B?Le=I(Le):Le*=V;var Be,Fe=xe*(O*Q)+Ne*Q;if(1===K)Be=R[Fe];else{Be=0;var Ve;if($)for(Ve=0;Ve=0;--Ve)Be=Be*J+R[Fe+Ve]}Be=(Be*X+Z)*q,se=Math.max(se,Be),ae=Math.min(ae,Be),Oe===Ne&&Te===xe||(Be-=L);var ke=Pe*T(Le),ze=Pe*x(Le),Ue=re*ke,Ge=ne*ze,We=A(Ue*ke+Ge*ze+Me*De),He=1/We,qe=Ue*He,je=Ge*He,Ye=Me*He,Xe=new r;Xe.x=qe+ke*Be,Xe.y=je+ze*Be,Xe.z=Ye+De*Be,_e[be]=Xe,ge[be]=Be;var Ze=(Le-u)/(E-u);Ze=c.clamp(Ze,0,1),ve[be]=new i(Ze,Ie),j&&(ye[be]=Re),be++,h.multiplyByPoint(ue,Xe,v),r.minimumByComponent(v,ce,ce),r.maximumByComponent(v,he,he),de=Math.min(de,Be)}}var Ke,Qe=t.fromPoints(_e);o(z)&&z.width=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},f._defaultWorkerModulePrefix="Workers/",f._workerModulePrefix=f._defaultWorkerModulePrefix,f._loaderConfig=void 0,f._canTransferArrayBuffer=void 0,f}),i("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,h){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=h}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l=a&&(p=a-1,d=a-2);var m=0|h,f=m+1;f>=s&&(f=s-1,m=s-2);var v=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),w=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),E=g(e,t,i,r,n,f*a+p);return _(v,y,C,w,S,E)}function f(e,t,i,r,n,o,a,s,l,u,c){var h=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(h+=1,d+=1,a+=2,s+=2);var p=n>0?a-1:a,m=0|h,f=m+1;f>=p&&(f=a-1,m=a-2);var g=n>0?s-1:s,v=0|d,y=v+1;y>=g&&(y=s-1,v=s-2);var C=h-m,w=d-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+m)/c-i)/r,E=(t.decodeHeight(e,v*a+f)/c-i)/r,b=(t.decodeHeight(e,y*a+m)/c-i)/r,T=(t.decodeHeight(e,y*a+f)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,m=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(f)),g=this._structure,v=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<h.highestEncodedHeight?h.highestEncodedHeight:N,v(_,x,A,D,m,P,M*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=p.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),p=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(p+="&token="+this._token);var f=this._proxy;r(f)&&(p=f.getURL(p));var _=m(p,h);if(r(_)){var g=this;return e(_,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),i("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,p,m,f,_,g,v;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),p=t.subtract(r,n,s),m=t.dot(h,h),f=t.dot(h,d),_=t.dot(h,p),g=t.dot(d,d),v=t.dot(d,p)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),p=e.subtract(r,n,s),m=e.dot(h,h),f=e.dot(h,d),_=e.dot(h,p),g=e.dot(d,d),v=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*_-f*v)*y,c.z=(m*v-f*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AhiQlDaPOwKbStA_3nJIdimUj4PRYkp0yHwcNpvxVlLNPRo5ZJWY5oX_h6B_dMbm")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},l.fromPoints=function(e,t){if(r(t)||(t=new l),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;ui.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),i("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.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.binormal?1:0,i[r++]=t.tangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.binormal=1===i[r++],o.tangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.binormal=e.binormal,i.tangent=e.tangent,i.color=e.color,i},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,m=new t,f=new c,_={minimum:p,maximum:m,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,m),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum), o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(_)},h.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var h,p,m=new l;if(c.position&&(c.st||c.normal||c.binormal||c.tangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,m.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,m.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.binormal){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,m.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}h=new Uint16Array(36),h[0]=0,h[1]=1,h[2]=2,h[3]=0,h[4]=2,h[5]=3,h[6]=6,h[7]=5,h[8]=4,h[9]=7,h[10]=6,h[11]=4,h[12]=8,h[13]=9,h[14]=10,h[15]=8,h[16]=10,h[17]=11,h[18]=14,h[19]=13,h[20]=12,h[21]=15,h[22]=14,h[23]=12,h[24]=18,h[25]=17,h[26]=16,h[27]=19,h[28]=18,h[29]=16,h[30]=20,h[31]=21,h[32]=22,h[33]=20,h[34]=22,h[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h=new Uint16Array(36),h[0]=4,h[1]=5,h[2]=6,h[3]=4,h[4]=6,h[5]=7,h[6]=1,h[7]=0,h[8]=3,h[9]=1,h[10]=3,h[11]=2,h[12]=1,h[13]=6,h[14]=5,h[15]=1,h[16]=2,h[17]=6,h[18]=2,h[19]=3,h[20]=7,h[21]=2,h[22]=7,h[23]=6,h[24]=3,h[25]=0,h[26]=4,h[27]=3,h[28]=4,h[29]=7,h[30]=0,h[31]=1,h[32]=5,h[33]=0,h[34]=5,h[35]=4;var y=t.subtract(o,n,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:h,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var d=new t,p=new t,m={minimum:d,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(m)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,d=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var m=t.subtract(o,n,h),f=.5*t.magnitude(m);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})}},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r=r[i]){if(i+1=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o=r[o]&&t=0&&!(t>=r[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=f,s=m,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c2&&(r(a)||(a=m,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,p=new e,m=new e,f=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),i("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=re,l=n>e,u=o>e);var c,h,d,p,m,f,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(m=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):2===_?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),m=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(m)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,p=s-u,m=o-u,f=1/(p*h+d*m),_=r-u,g=i-l,v=(p*g+d*_)*f,y=(-m*g+h*_)*f,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,d._boundingSphere),h=n(e.orientedBoundingBox,d._orientedBoundingBox),f=d._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,u,c,f,_,h,g,s),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var w=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var p=this._mesh;if(o(this._mesh)){var m=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,d),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:m,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=m?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=m?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}_._availableTiles=t.available,!a(_._credit)&&a(t.attribution)&&null!==t.attribution&&(_._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?_._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(_._hasVertexNormals=!0,_._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(_._hasWaterMask=!0),_._ready=!0,_._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+d+".";m=w.handleError(m,_,_._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=f(d);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=y.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u;var h=i.credit;"string"==typeof h&&(h=new n(h)),this._credit=h,this._ready=!1,this._readyPromise=t.defer();var d=p(this._url,"layer.json");a(this._proxy)&&(d=this._proxy.getURL(d));var m,_=this;l()}function E(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function b(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function T(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*h,f=3,y=Uint16Array.BYTES_PER_ELEMENT*f,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var D=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=m;var M=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var I=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*I);u+=I*y,I>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var O,N=R.subarray(0,I),L=R.subarray(I,2*I),B=R.subarray(2*I,3*I),F=0,V=0,k=0;for(O=0;O=n.length)return 0;var a=n[o],s=0;return s|=A(a,2*i,2*r)?1:0,s|=A(a,2*i+1,2*r)?2:0,s|=A(a,2*i,2*r+1)?4:0,s|=A(a,2*i+1,2*r+1)?8:0}function A(e,t,i){for(var r=0,n=e.length;r=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return S.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return m(e,E(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var p,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(p=C(h,s),!a(p))return}else p=s(h);var _=this;return t(p,function(t){return a(_._heightmapStructure)?b(_,t,r,e,i,c):T(_,t,r,e,i,c)})}},s(S.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}}}),S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<=r.length)return!1;var n=r[i],o=this._tilingScheme.getNumberOfYTilesAtLevel(i),a=o-t-1;return A(n,e,a)}},S}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,p,m,f,_){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*v+h*y),w=C/m;return r.fromAxisAngle(a,w,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,_),e.normalize(_,_),e.multiplyByScalar(_,m,_),_}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,m=r?u:0,f=0;f1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*(A-1)+2,P=1;P=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];sn&&(n=l),++s,l=r[s]}for(var u=[],c=0;co&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||c===-1)&&(c=l,u=d)),++h}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],p=u;if(t(s))c=s+1;else{for(;hc&&(c=d),++h,d=a[h];if(c===-1)return 0;++c}for(var m=[],f=0;fl&&(y.timeStamp=v,++v),++h}g=n(a,l,w,m,v,S,c)}return b},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function x(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o=3){var i=6*(t-2),r=_.createTypedArray(t,i);T(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o0){for(var t=e.length-1,i=6*(t-1),r=_.createTypedArray(t,i),n=e[0],o=0,a=1;aD&&(D=M)}return new p({attributes:g,indices:v,primitiveType:f,boundingSphere:u(P)?new i(P,D):void 0})}function L(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;no?n>a?y.sign(e.y):y.sign(i.y):o>a?y.sign(t.y):y.sign(i.y);var s=r<0;G(e,s),G(t,s),G(i,s)}function H(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),i),n.clone(i,r),G(i,!0),G(r,!1)}function q(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){W(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=Te.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(H(e,t,we,Ee),H(e,i,Se,be),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(H(t,i,we,Ee),H(t,e,Se,be),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(H(i,e,we,Ee),H(i,t,Se,be),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(H(i,e,we,Ee),H(i,t,Se,be),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(H(t,i,we,Ee),H(t,e,Se,be),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(H(e,t,we,Ee),H(e,i,Se,be),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Te.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=we,l[4]=Se,l[5]=Ee,l[6]=be,l.length=7),Te}}function j(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function Y(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function X(e,t,i){var r=u(e.geometry.boundingSphere);t=j(t,r),i=j(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Z(e,i,o,a,s,l,c,h,d,p,m){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,xe),_=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),v=t(a,f,_,g,De);if(u(l)){var y=n.fromArray(l,3*e,xe),C=n.fromArray(l,3*i,Ae),w=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,v.x,y),n.multiplyByScalar(C,v.y,C),n.multiplyByScalar(w,v.z,w);var S=n.add(y,C,y);n.add(S,w,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var E=n.fromArray(c,3*e,xe),b=n.fromArray(c,3*i,Ae),T=n.fromArray(c,3*o,Pe);n.multiplyByScalar(E,v.x,E),n.multiplyByScalar(b,v.y,b),n.multiplyByScalar(T,v.z,T);var x=n.add(E,b,E);n.add(x,T,x),n.normalize(x,x),n.pack(x,p.binormal.values,3*m)}if(u(h)){var A=n.fromArray(h,3*e,xe),P=n.fromArray(h,3*i,Ae),D=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,v.x,A),n.multiplyByScalar(P,v.y,P),n.multiplyByScalar(D,v.z,D);var M=n.add(A,P,A);n.add(M,D,M),n.normalize(M,M),n.pack(M,p.tangent.values,3*m)}if(u(d)){var I=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,Ie),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(I,v.x,I),r.multiplyByScalar(R,v.y,R),r.multiplyByScalar(O,v.z,O);var N=r.add(I,R,I);r.add(N,O,N),r.pack(N,p.st.values,2*m)}}}function K(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function Q(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.binormal)?l.binormal.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,m=u(l.st)?l.st.values:void 0,f=s.indices,_=Y(s),g=Y(s),v=[];v.length=c.length/3;var y=[];for(y.length=c.length/3,a=0;a3)for(var P=A.positions,D=A.indices,M=D.length,I=0;I0)){var u=n.unpack(r,s,ke);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3n&&(n=i[o]);e.indices=b.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=y.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?r=3:e.primitiveType===E.LINES?r=2:e.primitiveType===E.POINTS&&(r=1);for(var h=0;h=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,c=a.values,h=new Float64Array(c.length),p=0,f=0;f0&&a.push(N(t,"geometry")),i.length>0&&(a.push(N(i,"westHemisphereGeometry")),a.push(N(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,he=new n,de=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;h0){for(n.clone(n.ZERO,ue),d=0;d0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==f.NONE)switch(t.geometryType){case f.POLYLINES:ee(e);break;case f.TRIANGLES:Q(e);break;case f.LINES:J(e)}else U(t),t.primitiveType===E.TRIANGLES?Q(e):t.primitiveType===E.LINES&&J(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,d=r.ellipsoid,f=r.stRotation,_=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*_):void 0,v=a.normal?new Float32Array(3*_):void 0,C=a.tangent?new Float32Array(3*_):void 0,w=a.binormal?new Float32Array(3*_):void 0,E=0,b=U,T=G,x=W,A=new h(d),P=A.project(d.cartesianToCartographic(s,H),q),D=d.scaleToGeodeticSurface(s,N);d.geodeticSurfaceNormal(D,D);for(var M=S.fromAxisAngle(D,f,z),I=y.fromQuaternion(M,k),R=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),O=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),F=e.length,X=o?F:0,Z=X/3*2,K=0;K1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(h,u),this._extrude=d,this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,V=new t,k=new y,z=new S,U=new i,G=new i,W=new i,H=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+8,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r]=e._extrude?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t++],v=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=h,r._semiMinorAxis=d,r._rotation=p,r._stRotation=m,r._height=f,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._rectangle=E.clone(u),r):(ae.height=f,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=m,ae.rotation=p,ae.semiMajorAxis=h,ae.semiMinorAxis=d,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=I(i)):t=P(i),new d({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new o(r),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return l.unpack=function(t,r,n){var h=o.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=a.clone(h._ellipsoid,c.ellipsoid),c.height=h._height,c.extrudedHeight=h._extrudedHeight,c.granularity=h._granularity,c.vertexFormat=s.clone(h._vertexFormat,c.vertexFormat),c.stRotation=h._stRotation,i(n)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY})},r(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,p=h.createTypedArray(d,2*d),m=0,f=0;f0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=p,o._extrudedHeight=m?f:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=d,E.extrudedHeight=m?f:void 0,E.granularity=p,E.rotation=h,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=m(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),i("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,h=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,h)&&(r=l.clone(h,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,h);)r=l.addSeconds(c,l.secondsDifference(r,h),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,h=n;if(0!==r){var d;d=n<.5?n*(1+r):n+r-n*r;var p=2*n-d;u=a(p,d,i+1/3),c=a(p,d,i),h=a(p,d,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=h,l.alpha=o,l):new s(u,c,h,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var p=e(i.minimumBlue,0),m=e(i.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}var f=i.alpha;if(!t(f)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=h.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=d.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=m.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},s.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},s.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},s.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},s.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},s.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},s.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,p=1-d,m=Math.sqrt(p),f=t/4,_=f*f,g=_*f,v=_*_,y=1+f-3*_/4+5*g/4-175*v/64,C=1-f+15*_/8-35*g/8,w=1-3*f+35*_/4,S=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=h,b.sineSquaredAlpha=d,b.cosineSquaredAlpha=p,b.cosineAlpha=m,b.u2Over4=f,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,p,m=(t-i)/t,f=o-r,_=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=f,A=s.TWO_PI,P=Math.cos(x),D=Math.sin(x);do{P=Math.cos(x),D=Math.sin(x);var M=E-T*P;h=Math.sqrt(C*C*D*D+M*M),u=b+S*P,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=S*D/h,d=1-I*I),A=x,p=u-2*b/d,isNaN(p)&&(p=0),x=f+c(m,I,d,l,h,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),F=i*O*(l-B),V=Math.atan2(C*D,E-T*P),k=Math.atan2(v*D,E*P-T);e._distance=F,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),m),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&d(this,e,n,s)}var m=new e,f=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),p=Math.sin(8*o),m=o*o,f=o*m,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*f*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*h-m*((v-11*_/2)*u+5*_*h/2)+(29*v/96-29*_/16)*d+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),D=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+D,i.latitude=S,i.height=0,i):new t(this._start.longitude+D,S,0)},p}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,p=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=m(d,i,e,o);F=s.fromRotationZ(f,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=V;_[0]=u;for(var g=0;g0)for(var w=m?2:1,S=0;S=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],V=s?[]:void 0,k=w,z=S,U=E,G=b,W=T,H=x,q=A,j=P,Y=D,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;ie80*n){c=d=e[0],h=p=e[1];for(var g=n;gd&&(d=m),f>p&&(p=f);_=Math.max(d-c,p-h)}return r(s,u,n,c,h,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,h,p){if(e){!p&&h&&d(e,u,c,h);for(var m,f,_=e;e.prev!==e.next;)if(m=e.prev,f=e.next,h?o(e,u,c,h):n(e))t.push(m.i/l),t.push(e.i/l),t.push(f.i/l),x(e),e=f.next,_=f.next;else if(e=f,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,h,2)):2===p&&s(e,t,l,u,c,h):r(i(e),t,l,u,c,h,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=m(s,l,t,i,r),d=m(u,c,t,i,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,h,d,p=[];for(a=0,s=r.length;a=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=c&&_(oi.x)&&S(r,e)&&(i=r,d=l)),r=r.next;return i}function d(e,t,i,r){var n=e;do null===n.z&&(n.z=m(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function m(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function f(e){var t=e,i=e;do t.x=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,i,r){for(var n=0,o=t,a=i-r;o0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),i("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),i("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";var p=new i,m=new i,f={};f.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},f.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return f.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var d,p=a.slice(0),m=t.length,f=new Array(3*m),E=0;for(d=0;d0;){var M,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(f,3*N,_),B=i.fromArray(f,3*O,g),F=i.fromArray(f,3*R,v),V=i.multiplyByScalar(i.normalize(L,y),A,y),k=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(V,k,S)),G=i.magnitudeSquared(i.subtract(k,z,S)),W=i.magnitudeSquared(i.subtract(z,V,S)),H=Math.max(U,G,W);H>D?U===H?(M=Math.min(N,O)+" "+Math.max(N,O),d=x[M],o(d)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(N,d,R),p.push(d,O,R)):G===H?(M=Math.min(O,R)+" "+Math.max(O,R),d=x[M],o(d)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(O,d,N),p.push(d,R,N)):W===H&&(M=Math.min(R,N)+" "+Math.max(R,N),d=x[M],o(d)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(R,d,O),p.push(d,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:T,primitiveType:h.TRIANGLES})},f.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=m;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,h=0;hwe;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.binormal&&(y.binormal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,p=t.binormal?new Float32Array(6*u):void 0,m=t.tangent?new Float32Array(6*u):void 0,f=D,_=M,g=I,v=R,y=O,C=N,w=h;for(s=0;s0){var w=Math.min(_,f);g=Math.round(f/w),C+=w}for(var S=h.createTypedArray(v,2*C),E=0,b=0;b0)for(b=0;b1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var b=0,T=f.length;b1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=m.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new m,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=m.unpack(e,t,T);t+=m.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=m.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new f(x))},f.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,m,f=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),D=h.createTypedArray(x,P),M=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.binormal?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0;for(a=0;aA.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),w.tangent||w.binormal){var Q=v;if(ax-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),w.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,m=0;mN-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0){for(l=0;l=h||t(f,_,i)<=0)?(e[m]=f,++l):u=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,m),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r0?(o=Math.sqrt(o)+this._horizonDistance,s-r?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,f),f),u=-t.dot(l,o),h=c._anyRotationVector(o,l,u),d=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[0]);if(d){for(var p,m=1;mn.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),h=l*l;if(c"+i,document.body.appendChild(h),o.leading=1.2*s;var d=e(h,"height");if(d=d.replace("px",""),d>=2*s&&(o.leading=d/2|0),document.body.removeChild(h),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),m=100;p.width=o.width+m,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var f=p.getContext("2d");f.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;f.fillStyle="white",f.fillRect(-1,-1,_+2,g+2),r&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(i,m/2,v)),n&&(f.fillStyle="black",f.fillText(i,m/2,v));for(var y=f.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C0&&255===y[C];);var b=C/w|0;for(C=0;C=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-m/2,maxx:A-m/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=i(o.backgroundColor,t.TRANSPARENT),d=i(o.padding,0),p=2*d,m=document.createElement("canvas");m.width=1,m.height=1,m.style.font=s;var f=m.getContext("2d");r(a)||(r(f.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(f.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(f.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(f.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,f.textBaseline=i(o.textBaseline,"bottom"),m.style.visibility="hidden",document.body.appendChild(m);var _=e(f,n,l,u);m.dimensions=_,document.body.removeChild(m),m.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(m.width=v,m.height=y,f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,h!==t.TRANSPARENT&&(f.fillStyle=h.toCssColorString(),f.fillRect(0,0,m.width,m.height)),l){var S=i(o.strokeColor,t.BLACK);f.strokeStyle=S.toCssColorString(),f.strokeText(n,g+d,w)}if(u){var E=i(o.fillColor,t.WHITE);f.fillStyle=E.toCssColorString(),f.fillText(n,g+d,w)}return m}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c0?new Array(n):void 0,s=0;s0?new Array(u):void 0;for(s=0;sw?(h=o.TWO_PI-S+w,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)):(h=w-S,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,f);0===v&&0===y||(x.longitude1||v>1))for(var w=0;w0;t-=c)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=c-1;t>=0;t--)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);var Z=A(H,r,d);r.st&&(Z.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=f.createTypedArray(U,6*z);C=H.length/3;var te=0;for(t=0;t=0;t--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,d=n-2;d>0;d--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),v=0,y=0;yI.mouseEmulationIgnoreMilliseconds}function v(e,i){if(g(e)){var n=i.button;e._buttonDown=n;var o;if(n===R.LEFT)o=u.LEFT_DOWN;else if(n===R.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==R.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=d(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,O.position),l(O),i.preventDefault())}}function y(e,i){if(g(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===R.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===R.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==R.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=d(i),l=e.getInputAction(o,s),h=e.getInputAction(a,s);if(r(l)||r(h)){var p=c(e,i,e._primaryPosition);if(r(l)&&(t.clone(p,N.position),l(N)),r(h)){var m=e._primaryStartPosition,f=m.x-p.x,_=m.y-p.y,v=Math.sqrt(f*f+_*_);v0?t.detail*-120:t.wheelDelta;if(r(i)){var o=d(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function E(e,i){_(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;rD;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function m(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function f(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),h=Math.sin(r);return t(n)?(n[0]=c*a-h*s*l,n[1]=h*a+c*s*l,n[2]=s*u,n[3]=-c*s-h*a*l,n[4]=-h*s+c*a*l,n[5]=a*u,n[6]=h*u,n[7]=-c*u,n[8]=l):n=new o(c*a-h*s*l,-c*s-h*a*l,h*u,h*a+c*s*l,-h*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=M+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+he*Math.cos(re*n)+ye*Math.sin(re*n)+de*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*T*r,d=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,d,h,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,M=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),h+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(M-O)-914e-6*Math.cos(M-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(M-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(M)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(D-L)-40.13*Math.cos(D)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(D-A-L),f+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(M-O)+7505*Math.sin(M-R)+5318*Math.sin(D+x)+3484*Math.sin(M-N)-3417*Math.sin(D-A-x)-2530*Math.sin(I-N)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(D-L)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-L+P)*r+.614*Math.cos(D-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(P)*r-.111*Math.sin(D-L-P)*r-.0015*Math.sin(P)*n;f+=V,y+=V,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-L+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(D-L+B)*n-.015*Math.sin(D-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var k=d+p*T,z=m+f*T,U=v+y*T,G=_+g*T;return c(l,h,k,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,D=n.EPSILON8,M=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,V=16368,k=15318,z=32794,U=64e-7*x,G=-152e-7*x,W=62e-7*x,H=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,he=-325e-7,de=-322e-7,pe=1e-7*-79,me=232*1e-7,fe=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,De=Pe/(Pe+1)*-1,Me=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Me,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Me,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,m=r.alpha,f=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l0?new Array(u):void 0;for(l=0;l0&&(t.pack(j,s,H),H+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),D&&a===M-1)break;t.pack(j,s,H),H+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=h.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},_}),i("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),i("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),i("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){this.clock=e(t,0),this.cone=e(i,0),this.magnitude=e(r,1)}return r.fromCartesian3=function(e,i){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return t(i)||(i=new r),i.clock=Math.atan2(o,n),i.cone=Math.atan2(Math.sqrt(s),a),i.magnitude=Math.sqrt(s+a*a),i},r.clone=function(e,i){if(t(e))return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude)},r.normalize=function(e,i){return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=1,i):new r(e.clock,e.cone,1)},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.clock===i.clock&&e.cone===i.cone&&e.magnitude===i.magnitude},r.equalsEpsilon=function(i,r,n){return n=e(n,0),i===r||t(i)&&t(r)&&Math.abs(i.clock-r.clock)<=n&&Math.abs(i.cone-r.cone)<=n&&Math.abs(i.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){ return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-10&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var m=r[n];for(nd?d:h<0?0:h;var m=s?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},a}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var h,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(h,e.maximumRadius),b=m;if(b.minDistance=E,b.ellipsoid=e,f){var T,x=0;for(T=0;T0)for(c=new Array(l),s=0;s0)for(h=new Array(l),s=0;s0)for(c=new Array(l),s=0;s0)for(h=new Array(l),s=0;s=s&&(g=s-1);var v=_/d|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError }}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new f(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new f(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):v.texImage2D(e,0,m,m,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var p=n,m=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,_,g),this.sampler=t(i.sampler)?i.sampler:new h}return i(m.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},m}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,h.UNSIGNED_BYTE),m=c;n.webgl2&&(c===s.DEPTH_STENCIL?m=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===h.UNSIGNED_SHORT?m=l.DEPTH_COMPONENT16:p===h.UNSIGNED_INT&&(m=l.DEPTH_COMPONENT24)));var f=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,_=t(r.flipY,!0),g=n._gl,v=g.TEXTURE_2D,y=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(v,y),i(u)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,_),i(u.arrayBufferView)?g.texImage2D(v,0,m,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),g.copyTexImage2D(v,0,m,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):g.texImage2D(v,0,m,c,p,u)):g.texImage2D(v,0,m,o,a,0,c,p,null),g.bindTexture(v,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=v,this._texture=y,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=f,this._flipY=_,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new d}return f.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new f({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(f.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===m.NEAREST_MIPMAP_NEAREST||t===m.NEAREST_MIPMAP_LINEAR||t===m.LINEAR_MIPMAP_NEAREST||t===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===h.FLOAT&&(t=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),f.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},f.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},f.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"; }),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,I(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function I(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),B(i),k(i),G(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){}function N(e,t){}function L(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;R(t,q,O,!0),R(n,j,O,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);R(i,o,N,!1)}function B(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function F(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new _({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof _&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?D(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];D.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=U(n);if("channels"===o)i=W(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";H(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},z(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=W(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(F(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(o.indexOf("mat")!==-1){var c=new Y[o];e._uniforms[u]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";W(e,n,l)}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r0&&console.log(C+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(C+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(C+"Shader program link log: "+h)),l}function m(e,t,i){for(var r={},n=0;n=0){if(f=r[d.slice(0,y)],!t(f))continue;_=f._locations,_.length<=1&&(g=f.value,v=e.getUniformLocation(i,d),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded)\n{\nencoded = encoded / 255.0 * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),i("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le){ "use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_passCompute:d,czm_passEnvironment:p,czm_passGlobe:m,czm_passGround:f,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:D,czm_threePiOver2:M,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:V,czm_shadowParameters:k,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:W,czm_cascadeMatrix:H,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:he,czm_isFull:de,czm_latitudeToWebMercatorFraction:pe,czm_luminance:me,czm_metersPerPixel:fe,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:De,czm_translateRelativeToEye:Me,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function m(e,t,r){for(var n=0;n0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),m=h%p;0!==m&&(h+=p-m);var f=s*h,v=new ArrayBuffer(f),y={};for(r=0;r0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,p=t(r.geometry,t.EMPTY_OBJECT),m=t(r.bufferUsage,h.DYNAMIC_DRAW),_=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],w=p.attributes;if(g){var S=v(w);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var E=S.offsetsInBytes,b=S.vertexSizeInBytes;for(n in w)w.hasOwnProperty(n)&&i(w[n])&&(o=w[n],i(o.values)?C.push({index:_[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:E[n],strideInBytes:b}):C.push({index:_[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in w)if(w.hasOwnProperty(n)&&i(w[n])){o=w[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(T,o.values),usage:m})),C.push({index:_[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,A=p.indices;return i(A)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:m,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:m,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:x})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):m(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r=U)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*V;return n+=r*e.y*k,n+=r*e.z*z,n*Math.pow(10,i)}function b(e,t,r){var n=i.unpack(e,t,N),o=E(n);n=i.unpack(e,t+4,N);var a=E(n);n=i.unpack(e,t+8,N);var s=E(n);n=i.unpack(e,t+12,N);var l=E(n);return i.fromElements(o,a,s,l,r)}function T(e,t){if(G[0]=e,e=G[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(u.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=U);var o=e*L;return t.x=Math.floor(o),o=(o-t.x)*L,t.y=Math.floor(o),o=(o-t.y)*L,t.z=Math.floor(o),t.w=2*(r+U)+n,t}function x(e,t,r){var n=T(e.x,N);i.pack(n,t,r),n=T(e.y,n),i.pack(n,t,r+4),n=T(e.z,n),i.pack(n,t,r+8),n=T(e.w,n),i.pack(n,t,r+12)}function A(e,t){var i=e._textureDimensions;e._texture=new f({context:t,pixelFormat:c.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new m({minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function M(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+U+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+V+"); \n unpacked += sign * value.y * float("+k+"); \n unpacked += sign * value.z * float("+z+"); \n return unpacked * pow(10.0, exponent); \n} \n":""}function I(e){return 1===e?"float":"vec"+e}function R(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function O(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=I(o),l=R(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===p.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(v.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new i,L=256,B=65536,F=16777216,V=1/L,k=1/B,z=1/F,U=38,G=new Float32Array(1),W=new i;v.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?b(this._batchValues,u,W):i.unpack(this._batchValues,u,W);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var H=[void 0,void 0,new e,new t,new i],q=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=H[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=q;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var h=this._offsets[t],d=this._stride,m=4*d*e+4*h;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,m):i.pack(c,this._batchValues,m),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||A(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=M(this)+"\n";for(var i=e.length,r=0;r1){var s=e[0].modelMatrix;for(n=1;n=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,h=0;ha&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:m}),o+=m}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),h=0;h0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,d=1;d0){var M=w.length/S;for(D=h.createTypedArray(M,C),r=0;r1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, binormal);\n"):(i&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+=" binormal = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+binormal;/g,""),p=M.replaceMain(p,"czm_non_compressed_main");var m="void main() \n{ \n"+h+" czm_non_compressed_main(); \n}";return[u,c,p,m].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],h=[];for(n=0;n0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r||!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,h=i.mapProjection,d=h.ellipsoid,p=t._batchTable,f=t._instanceBoundingSpheres,_=f.length,g=0;g<_;++g){var v=f[g];if(c(v)){var y=t.modelMatrix;if(c(y)&&(v=e.transform(v,y,v)),r){var C=v.center,w=v.radius,S=m.fromCartesian(C,fe);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=d.cartesianToCartographic(C,_e),b=h.project(E,ge);S=m.fromCartesian(b,fe),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u0){if(0===T.maximumVertexTextureImageUnits)throw new w("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var h=u(this._createShaderProgramFunction,ee);h(this,e,i)}if(n||o){var d=u(this._createCommandsFunction,te);d(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},k.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(m.id=r.id,S=new o(m)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i=0;d--)p=n[d].getById(C),t(p)&&(t(f)||(f=c.getById(C),s(f)),f.merge(p));t(f)||c.removeById(C),f=void 0}var w=i.length;for(h=0;h=0;d--)p=n[d].getById(E),t(p)&&(t(f)||(f=c.getById(E),t(f)?s(f):(m.id=E,f=new o(m),c.add(f))),f.merge(p));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,p=s-1;p>=0;p--){var m=o[p].getById(e.id);if(t(m)){var f=m[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l1&&(t=X),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:s(e.vertexCacheOptimize,!1),interleave:s(e.interleave,!1),releaseGeometryInstances:s(e.releaseGeometryInstances,!0),allowPicking:s(e.allowPicking,!0),asynchronous:s(e.asynchronous,!0),compressVertices:s(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function L(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function B(e){return function(t,i){return e._minHeight}}function F(e,t){var i=e.mapProjection.ellipsoid;{if(l(t.attributes)&&l(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=0;da?a:s-1}}function k(e,t,i){var n=V(t),o=N._defaultMinTerrainHeight,a=N._defaultMaxTerrainHeight;if(l(n)){var s=n.level+"-"+n.x+"-"+n.y,u=N._terrainHeights[s];l(u)&&(o=u[0],a=u[1]),i.cartographicToCartesian(v.northeast(t,ue),se),i.cartographicToCartesian(v.southwest(t,ue),le),r.subtract(le,se,ce),r.add(se,r.multiplyByScalar(ce,.5,ce),ce);var c=i.scaleToGeodeticSurface(ce,he);if(l(c)){var h=r.distance(ce,c);o=Math.min(o,-h)}else o=N._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(N._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function z(t,i){var r=V(t),n=N._defaultMaxTerrainHeight;if(l(r)){var o=r.level+"-"+r.x+"-"+r.y,a=N._terrainHeights[o];l(a)&&(n=a[1])}var s=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,de),e.union(s,de,s)}function U(t,i,n){var o=i.mapProjection.ellipsoid,a=F(i,n);if(a.width<_.PI){var s=g.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,h=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);r.fromElements(h.center.z,h.center.x,h.center.y,h.center),t._boundingVolumes2D.push(h)}}function G(e,t,i,r){l(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=w.fromCache(Z),e._rsStencilDepthPass=w.fromCache(K),e._rsColorPass=w.fromCache(Q),e._rsPickPass=w.fromCache(J))}function W(e,t,i){if(!l(e._sp)){var r=t.context,n=T;n=e._primitive._batchTable.getVertexShaderCallback()(n),n=M._appendShowToShader(e._primitive,n),n=M._appendDistanceDisplayConditionToShader(e._primitive,n),n=M._modifyShaderPosition(e,n,t.scene3DOnly),n=M._updateColorAttribute(e._primitive,n);var o=b,a=e._primitive._attributeLocations;if(e._sp=S.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),e._primitive.allowPicking){var s=E.createPickVertexShaderSource(n);s=M._updatePickColorAttribute(s);var u=new E({sources:[o],pickColorQualifier:"varying"});e._spPick=S.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:s,fragmentShaderSource:u,attributeLocations:a})}else e._spPick=S.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a})}}function H(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,o=i._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a=E.clientWidth)x=!0;else{if(B.x>.5*E.clientWidth){b.width=B.x,T.frustum.right=D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x+=B.x,T.position.x=-T.position.x;var F=T.frustum.right;T.frustum.right=-T.frustum.left,T.frustum.left=-F,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}else{b.x+=B.x,b.width-=B.x,T.frustum.left=-D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x=b.x-b.width,T.position.x=-T.position.x;var V=T.frustum.left;T.frustum.left=-T.frustum.right,T.frustum.right=-V,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}i.clone(M,T.position),T.frustum=I.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=g.x)}}if(v.mode!==c.SCENE2D||x){if(m=h(y,n,T,m),m.z<0&&v.mode!==c.SCENE2D)return;a=d.clipToGLWindowCoordinates(b,m,a)}return a.y=E.clientHeight-a.y,a}},d.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=d.wgs84ToWindowCoordinates(e,t,i),o(i))return d.transformWindowToDrawingBuffer(e,i,i)};var E=new i,b=new n;d.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===c.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,b);if(o(l)){if(a.project(l,E),n===c.COLUMBUS_VIEW)return i.fromElements(E.z,E.x,E.y,r);if(n===c.SCENE2D)return i.fromElements(0,E.x,E.y,r);var u=e.morphTime;return i.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),r)}};var T=new i,x=new i,A=new l;d.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.clipToDrawingBufferCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var P=new r,D=new r;return d.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,P);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,D),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},d}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,f.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,M=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,M))}},alignedAxis:{ get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){h.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=h.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=d.height,s.cartographicToCartesian(r,e)}else e.x+=d.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,h=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||h)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var d=s.cartesianToCartographic(t._position);if(l(d)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(d,r),n.clone(d,B);var p=a.getHeight(d);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var V=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(d.multiplyByPoint(r,t,V),g.computeActualWgs84Position(i,V))};var k=new i;y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=d.multiplyByPoint(e,i,k),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._getActualPosition(),a=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return a},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===f.RIGHT?s-=n:t.horizontalOrigin===f.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&h.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),i("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,h,d=[],p={},m=l.length,f=0;f0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;u0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),f=l/c,_=u/p,g=new m(new t(l+s,s),new t(c,u)),v=new m(new t,new t(c,u),e._root,g),y=new m(new t(s,u+s),new t(c,p)),C=new m(new t,new t(c,p),v,y),w=0;wl){i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u0){this._vaf=k(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var P=0;P0){var R=Re;R.length=0,(h[ee]||h[le]||h[oe])&&R.push(z),(h[ae]||h[te]||h[re]||h[ne]||h[$])&&(R.push(U),this._instanced&&R.push(H)),(h[ae]||h[ue]||h[he])&&(R.push(G),R.push(W)),(h[ae]||h[se])&&R.push(W),h[ie]&&R.push(H),h[ce]&&R.push(q),h[de]&&R.push(j),h[pe]&&R.push(Y);var O=R.length;if(_=this._vaf.writers,c/r>.1){for(var N=0;N1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var we,Se=m.IDENTITY;e.mode===M.SCENE3D?(Se=this.modelMatrix,we=t.clone(this._baseVolumeWC,this._boundingVolume)):we=t.clone(this._baseVolume2D,this._boundingVolume),Q(this,e,we);var Ee,be,Te,xe,Ae,Pe,De=e.commandList;if(g.render){var Me=this._colorCommands;for(s(this._rs)||(this._rs=C.fromCache({depthTest:{enabled:!0,func:f.LEQUAL},blending:A.ALPHA_BLEND})),s(this._sp)&&this._shaderRotation===this._compiledShaderRotation&&this._shaderAlignedAxis===this._compiledShaderAlignedAxis&&this._shaderScaleByDistance===this._compiledShaderScaleByDistance&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistance&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistance&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayCondition||(xe=new S({sources:[T]}),this._instanced&&xe.defines.push("INSTANCED"),this._shaderRotation&&xe.defines.push("ROTATION"),this._shaderAlignedAxis&&xe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&xe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&xe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&xe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&xe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:xe,fragmentShaderSource:b,attributeLocations:J}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),Ee=this._vaf.va,be=Ee.length,Me.length=be,Pe=0;Pe0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(n(d)||(d=p.add({collection:e,image:P,imageSubRegion:M}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=h.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t._scale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition):n(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);var m=e._glyphTextureCache;for(o=0;o0&&I.height>0&&w(e._textureAtlas,A,I,D)}if(i=l[o],n(i)?D.index===-1?C(e,i):n(i.textureInfo)&&(i.textureInfo=void 0):(i=new _,l[o]=i),i.textureInfo=D,i.dimensions=D.dimensions,D.index!==-1){var R=i.billboard,O=e._spareBillboards;n(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=h.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function E(e,t,i){return t===h.CENTER?-e/2:t===h.RIGHT?-(e+i.x):i.x}function b(e,i){var r,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],d=Number.NEGATIVE_INFINITY,p=0,m=1,_=0,g=a.length,v=e._backgroundBillboard,y=O;for(t.clone(n(v)?e._backgroundPadding:t.ZERO,y),_=0;_0&&(P=S===h.CENTER?-u/2-y.x:S===h.RIGHT?-(u+2*y.x):0,R.x=P*w*i,b===f.TOP?R.y=C-p-d:b===f.CENTER?R.y=(C-p)/2-d:b===f.BASELINE?R.y=-y.y-d:R.y=0,R.y=R.y*w*i,v.width=u+2*y.x,v.height=C+M+2*y.y,v._setTranslate(R))}function T(e,t){for(var i=t._glyphs,r=0,o=i.length;r farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(X),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this._mode=T.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function A(e){for(var t=e.length,i=0;i0){this._vaf=D(p,o,this._buffersUsage),i=this._vaf.writers;for(var A=0;A0){var K=$;K.length=0,(l[z]||l[W]||l[H])&&K.push(M),(l[U]||l[G])&&K.push(I),(l[k]||l[j])&&K.push(R),l[q]&&K.push(O),l[Y]&&K.push(N);var Q=K.length;if(i=this._vaf.writers,s/o>.1){for(var J=0;J1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var oe,ae=c.IDENTITY;t.mode===T.SCENE3D?(ae=this.modelMatrix,oe=e.clone(this._baseVolumeWC,this._boundingVolume)):oe=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,oe);var se,le,ue,ce,he,de,pe=t.commandList;if(C.render){var me=this._colorCommands;for(n(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0,func:d.LEQUAL},blending:E.ALPHA_BLEND})),(!n(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(he=new y({sources:[S]}),this._shaderScaleByDistance&&he.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&he.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&he.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:he,fragmentShaderSource:w,attributeLocations:Z}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),se=this._vaf.va,le=se.length,me.length=le,ce=0;ce=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);else{var f=Math.floor((p+d)/2);s=t[2*f],l=t[2*f+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);var _=(h+1)%2;(0===h?i<=s:r<=l)&&(u.push(p),u.push(f-1),u.push(_)),(0===h?n>=s:o>=l)&&(u.push(f+1),u.push(d),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*h/l+d)),m=Math.min(n,Math.floor(i+(l-u)*h/l+d));a(e,t,i,p,m,o)}var f=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>f&&s(e,t,r,n);_f;)g--}t[2*r+o]===f?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),h=a.pop(),d=a.pop();if(h-d<=o)for(var p=d;p<=h;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var m=Math.floor((d+h)/2),f=t[2*m],_=t[2*m+1];c(f,_,i,r)<=l&&s.push(e[m]);var g=(u+1)%2;(0===u?i-n<=f:r-n<=_)&&(a.push(d),a.push(m-1),a.push(g)),(0===u?i+n>=f:r+n>=_)&&(a.push(m+1),a.push(h),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),i("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function g(e){return e.coord.x}function v(e){return e.coord.y}function y(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=h.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),y(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=h.getScreenSpaceBoundingBox(l,i,M);y(c,r),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function S(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function b(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s=A)for(S(J.position,X,Y,r),D.push(J),z=0;z=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function A(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function P(e){if(n(e))for(var t=e.length,i=0;i0&&0===this._labelCollection.get(0)._glyphs.length){var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,D(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e), n(this._pointCollection)&&this._pointCollection.update(e)},_.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},_}),i("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),i("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new m(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=this._distanceDisplayConditionProperty.getValue(r),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new d({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.length,m=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(h)||!o(d)||!o(m)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,D),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&d.isConstant&&m.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.length=d.getValue(p.MINIMUM_VALUE),x.topRadius=m.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(m)&&o(v)&&o(y)){h.length=m,h.topRadius=v,h.bottomRadius=y,h.slices=E.getValueOrUndefined(u.slices,n),h.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new f({material:x,translucent:x.isTranslucent(),closed:!0});h.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:new i(h),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=E.getValueOrDefault(u.outlineWidth,n,1),M=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:new r(h),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r=t;r--)e[r]=e[s--]}for(r=0;r=0||i(g)&&s.compare(_,g)>=0));){for(m[y++]=_,v+=1,l=0;l0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;ll)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var p=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var m=this._xTable,f=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=h-(C/2|0)-1;bS&&(T=S,b=T-C,b0){n=new Array(r);for(var s=0;sh);var g="function"==typeof e.unpack&&e!==we;if(!d&&!_)return void(f?t[i]=Me(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),d&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void Ge(r,y);var E;if(!d&&_)return s=s.clone(),f?s.data=Me(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=f?new Y:new Ae,t[i]=y),void(!f&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),Ge(r,E.data)}function He(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s_),!m&&!v)return void(g?e[t]=Me(a,r.reference):e[t]=new X(i.unpack(d),h));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),m&&!v)return S instanceof Se&&(!c(h)||S.referenceFrame===h)||(S=new Se(h,f),e[t]=S),S.addSamplesPackedArray(d,y),void Ge(r,S);var b;if(!m&&v)return s=s.clone(),g?s.data=Me(a,r.reference):s.data=i.unpack(d),c(S)||(S=g?new j(h):new xe(h),e[t]=S),void(!g&&S instanceof xe&&c(h)&&S.referenceFrame===h?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(h),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(h)||b.data.referenceFrame===h)||(b=s.clone(),b.data=new Se(h,f),T.addInterval(b)),b.data.addSamplesPackedArray(d,y),Ge(r,b.data)}function je(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a. version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ht(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),He(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function dt(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"radii",o.radii,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(Number,u,"stackPartitions",o.stackPartitions,s,n,r),He(Number,u,"slicePartitions",o.slicePartitions,s,n,r),He(Number,u,"subdivisions",o.subdivisions,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function pt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Nt.iso8601=u,l=R.fromIso8601(Nt));var h=e.label;c(h)||(e.label=h=new ae),He(Boolean,h,"show",s.show,l,o,n),He(String,h,"text",s.text,l,o,n),He(String,h,"font",s.font,l,o,n),He(F,h,"style",s.style,l,o,n),He(Number,h,"scale",s.scale,l,o,n),He(Boolean,h,"showBackground",s.showBackground,l,o,n),He(a,h,"backgroundColor",s.backgroundColor,l,o,n),He(t,h,"backgroundPadding",s.backgroundPadding,l,o,n),He(t,h,"pixelOffset",s.pixelOffset,l,o,n),He(i,h,"eyeOffset",s.eyeOffset,l,o,n),He(B,h,"horizontalOrigin",s.horizontalOrigin,l,o,n),He(k,h,"verticalOrigin",s.verticalOrigin,l,o,n),He(L,h,"heightReference",s.heightReference,l,o,n),He(a,h,"fillColor",s.fillColor,l,o,n),He(a,h,"outlineColor",s.outlineColor,l,o,n),He(Number,h,"outlineWidth",s.outlineWidth,l,o,n),He(x,h,"translucencyByDistance",s.translucencyByDistance,l,o,n),He(x,h,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function mt(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.model;c(l)||(e.model=l=new se),He(Boolean,l,"show",n.show,o,r,i),He(z,l,"uri",n.gltf,o,r,i),He(Number,l,"scale",n.scale,o,r,i),He(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),He(Number,l,"maximumScale",n.maximumScale,o,r,i),He(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),He(Boolean,l,"runAnimations",n.runAnimations,o,r,i),He(V,l,"shadows",n.shadows,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),He(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),He(a,l,"color",n.color,o,r,i),He(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),He(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var h=0,d=u.length;h-1;u--)i[u](a,e,t,r)}Pt=void 0}function Et(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),h=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=h,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Nt.iso8601=i.interval;var d=R.fromIso8601(Nt);t.startTime=d.start,t.stopTime=d.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function bt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return Tt(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function Tt(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new xt,n.removeAll()),At._processCzml(t,n,i,void 0,e);var o=Et(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function xt(){this.name=void 0, this.clock=void 0}function At(e){this._name=e,this._changed=new m,this._error=new m,this._isLoading=!1,this._loading=new m,this._clock=void 0,this._documentPacket=new xt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Pt,Dt=new i,Mt=new I,It=new r,Rt=new R,Ot={HERMITE:v,LAGRANGE:S,LINEAR:E},Nt={iso8601:void 0};return At.load=function(e,t){return(new At).load(e,t)},h(At.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),At.updaters=[at,st,lt,ut,ht,dt,pt,mt,Ze,Ke,_t,gt,vt,yt,Ct,Qe,Je,wt,$e,nt],At.prototype.process=function(e,t){return bt(this,e,t,!1)},At.prototype.load=function(e,t){return bt(this,e,t,!0)},At.processPacketData=He,At.processPositionPacketData=je,At.processMaterialPacketData=Xe,At._processCzml=function(e,t,i,r,n){if(r=c(r)?r:At.updaters,y(e))for(var o=0,a=e.length;o0){for(r(f)&&(r(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),c=0;c0)for(t=0;t0)for(t=0;t0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},h.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},h.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},h}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var h=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,d=this.primitive,p=this.primitives,m=this.geometry.values;if(this.createPrimitive){var f=m.length;if(f>0){for(t(d)&&(t(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),u=0;u=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s0){for(i(f)&&(i(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),u=0;u0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),h=0;h0)for(h=!0,t=0;t0)for(h=!0,t=0;t-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),m(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),m(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(f._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,d=this._batches,_=d.length;for(t=0;t<_;t++)h=d[t].update(e)&&h;return h};var g=[],v=new t;return f.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},f}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=d.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,D=i.ZERO,M=c.NONE,I=h.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,V=new i,k=new t,z=new u,U=new u,G=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function m(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),d(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&m.push(_))}n=m.length;for(var P=0;P0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(m,"technique",c),b=o(f,"vertexShader",h),T=o(f,"fragmentShader",d),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var D,M=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);D=I.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[D]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var V="";y&&(V+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",V+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+=" v_positionEC = pos.xyz;\n",V+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",V+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",V+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+=" "+K+" = u_"+X+"Transform[3].xyz;\n",H+=" vec3 VP = "+K+" - v_positionEC;\n",H+=" vec3 l = normalize(VP);\n",H+=" float range = length(VP);\n",H+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+=" float attenuation = 1.0;\n","spot"===Y&&(H+=" float spotDot = dot(l, normalize("+Z+"));\n",H+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+=" {\n",H+=" attenuation = 0.0;\n",H+=" }\n",H+=" else\n",H+=" {\n",H+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+=" }\n"),H+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+=" specularLight += "+Q+" * specularIntensity;\n")),H+=" }\n"}W||(H+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+=" vec3 l = normalize(czm_sunDirectionEC);\n",H+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=V,w+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},m[E]={attributes:k,parameters:P,program:x,states:ee,uniforms:N},f[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},f[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a0;){d=s.pop();var p=d._transformToRoot,m=d.meshes;if(u(m))for(var f=m.length,_=0;_0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=N.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var h=l[c];if(r=n[h.bufferView],r.target===O.ELEMENT_ARRAY_BUFFER&&!u(o[h.bufferView])){var d=N.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}}}function Be(e,t){var i,r={},n=t.length;for(i=1;i2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+h+";\n"+e,e="uniform vec4 "+d+";\n"+e,w="\nvoid main() {\n "+v+" = "+h+" * "+f+" + "+d+";\n "+g+"();\n}\n",n[h]={mat:4},n[d]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n "+v+" = "+C+"("+c+" * vec"+y+"("+f+",1.0));\n "+g+"();\n}\n",n[c]={mat:y}),e=U.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function We(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function He(e,t){return e=U.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function qe(e,t,i){return u(i)&&(e=i(e,t)),e}function je(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=Be(t,o.attributes),s=Fe(t,n[o.vertexShader]),l=Fe(t,n[o.fragmentShader]),c=o.attributes.length,h=t._precreatedAttributes;if(u(h))for(var d in h)h.hasOwnProperty(d)&&(a[d]=c++);Ne(t,"WEB3D_quantized_attributes")&&(s=Ge(s,e,t,i));var p=We(t),m=He(l,p),f=qe(s,e,t._vertexShaderLoaded),_=qe(m,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=z.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=qe(s,e,t._pickVertexShaderLoaded),v=qe(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=U.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=z.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Ye(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),je(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),je(i,e,t)}function Xe(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Ze(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=Xe(t,i),a=Ce(e,"image","id: "+i.id+", bufferView: "+i.bufferView);S(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Ke(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new k({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Qe(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===W.NEAREST_MIPMAP_NEAREST||a.minificationFilter===W.NEAREST_MIPMAP_LINEAR||a.minificationFilter===W.LINEAR_MIPMAP_NEAREST||a.minificationFilter===W.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===H.REPEAT||a.wrapS===H.MIRRORED_REPEAT||a.wrapT===H.REPEAT||a.wrapT===H.MIRRORED_REPEAT,u=e.image,c=!b.isPowerOfTwo(u.width)||!b.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=b.nextPowerOfTwo(u.width),h.height=b.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var p;n.target===O.TEXTURE_2D&&(p=new G({context:i,source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1})),s&&p.generateMipmap(),t._rendererResources.textures[e.id]=p}function Je(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Qe(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Qe(i,e,t)}function $e(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=l[h],p=c[h].index;if(u(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function et(e,t,i){for(var r=e.length,n=0;n0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c0;){var f=p.pop(),_=f.parentRuntimeNode,g=f.gltfNode,v=a[f.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=A.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=D.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Dt(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S0;){m=h.pop();var f=m.transformToRoot,_=m.commands;if(m.dirtyNumber===a||r||n){var g=A.multiplyTransformation(d,f,m.computedMatrix),v=_.length;if(v>0)for(var y=0;y0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function jt(e){for(var t=e._nodeCommands,i=t.length,r=0;r0&&e.color.alpha<1}function Xt(e){return 0===e.color.alpha}function Zt(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function Kt(e,t){for(var i=++xi%255,r=jt(e)||Yt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,h=0;h=o&&r<=a}if(!m.supportsTypedArrays())return{};var li=A.fromRotationTranslation(x.fromRotationX(b.PI_OVER_TWO)),ui=new i,ci={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},hi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";le.prototype.getBuffer=function(e){return me(this.buffers[e.buffer],e.byteOffset,e.byteLength)},le.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},le.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},le.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},le.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},le.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},le.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(ce.prototype,{gltf:{set:function(e){this._gltf=re(j(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),ce.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;nL||M.center.y-M.radiusL||M.center.y-M.radiusL||M.center.y-M.radius-1;r--)f(this,e[r],t,i);return n(this)},m.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return d.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return d.FAILED;if(!o.ready)return d.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return d.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return d.DONE},m.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(f(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],f(this,a,l,u),s.remove(a.id)},m}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=h.fromType(h.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var d;o(s)&&(d=u.clone(s.modelMatrix)),this._modelMatrix=d,this._segments=c.wrapLongitude(this._actualPositions,d),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var m=d.POSITION_INDEX=0,f=d.SHOW_INDEX=1,_=d.WIDTH_INDEX=2,g=d.MATERIAL_INDEX=3,v=d.POSITION_SIZE_INDEX=4,y=d.DISTANCE_DISPLAY_CONDITION=5,C=d.NUMBER_OF_PROPERTIES=6;return a(d.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,f))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),d.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,h=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var V=N._locatorBuckets,k=V.length,z=0;z0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,h=!0,s.push(x)),b=void 0}r.length=c}function k(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],h=0,d=[[]],m=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),m+=n.lengthOfPositions);if(m>0){var g,v=e._mode,w=new Float32Array(6*m*3),S=new Float32Array(4*m),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*m*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,h=n.updateIndices(o,c,d,h)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var M;l(g)&&(M=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:D});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B0){var F=new Uint16Array(s),V=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var k,z,U,W,H=6*(B*(I*f.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+H,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*f.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(k=e._positionBuffer,z="vertexBuffer",U=ce,W="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(k=ce,z="value",U=e._positionBuffer,W="vertexBuffer"):(k=M,z="vertexBuffer",U=e._positionBuffer,W="vertexBuffer"),$[0][z]=k,$[1][z]=k,$[2][W]=U,$[3][W]=U,$[4][z]=k,$[5][z]=k,$[6][W]=U,$[7][W]=U,$[8][z]=k,$[9][z]=k,$[10][W]=U,$[11][W]=U;var ee=new A({context:t,attributes:$,indexBuffer:V});e._vertexArrays.push({va:ee,buckets:d[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;he.length=2*i;for(var r=0,n=0;n1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function W(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function H(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=d.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A0,E=C._index,b=this.getSegments(C,h),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,D=0,M=0,I=0;I0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var B=O?2:0,F=N?2:4,V=B;V2&&(u.setBatchedAttribute(E,2,H),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;h0))continue;p[0]=m}else p=d._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C=f.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var d=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(d.z,d.x,d.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*f.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.lengthc&&(u=new Float32Array(u.buffer,0,c));var h,p=this.getSegments(t,n),m=p.positions,_=p.lengths,g=0,v=0,y=0;s=m.length;for(var C=0;C0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var b=S?2:0,T=E?2:4,x=b;x0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),m=0,f=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&m0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function d(t,i){i.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function m(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var f=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return d.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)),P){s.color=i.clone(D,s.color),s.outlineColor=i.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=D.alpha,N=D.toCssColorString(),L=M.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,m(O,N,L,I,R))}}}else p(s,u,n)}return!0},d.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},d}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),V=new e;return n(D,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new m(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(d.MINIMUM_VALUE)),m=a.outline,_=r(m);if(_&&m.isConstant&&(_=m.getValue(d.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(d.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,D=a.stRotation,M=a.outlineWidth,V=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&V&&(p(p.geometryOutlines),_=!1);var k=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=V,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(D)&&A.isConstant(M)&&A.isConstant(u)&&A.isConstant(k)&&A.isConstant(z)&&A.isConstant(U)&&(!V||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var W=g.getValue(d.MINIMUM_VALUE);h(W)&&(W=new f(W));var H=A.getValueOrUndefined(T,d.MINIMUM_VALUE),q=A.getValueOrDefault(z,d.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,d.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,d.MINIMUM_VALUE);G.polygonHierarchy=W,G.height=H,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,d.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(D,d.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(k,d.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(M,d.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==H&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new M(e,t,this)},M.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var d=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){h(p)?d.polygonHierarchy=new f(p):d.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);d.height=A.getValueOrUndefined(u.height,i),d.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),d.granularity=A.getValueOrUndefined(u.granularity,i),d.stRotation=A.getValueOrUndefined(u.stRotation,i),d.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),d.closeTop=g,d.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new m(d),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:r(d.extrudedHeight)&&d.extrudedHeight!==d.height&&g&&S});d.vertexFormat=D.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new m(d)}),appearance:D,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=C.VERTEX_FORMAT;var M=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,V),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==M.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(d),attributes:{color:t.fromColor(M)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},M.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},D=new w(t.WHITE),M=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new f(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),r=i.fromColor(m),o={show:l,distanceDisplayCondition:d,color:r}}else o={show:l,distanceDisplayCondition:d};return new h({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(d.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,D),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,M),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var h=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&b.isConstant(h)&&b.isConstant(p)&&b.isConstant(m)){var f=this._options,_=s.getValue(d.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,f.positions=_,f.width=n(h)?h.getValue(d.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(d.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=m.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=m.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){ "use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new d(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.shape,m=a.show;if(!r(d)||!r(p)||r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,D),this._showProperty=i(m,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=d.getValue(h.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(h.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),h=E.getValueOrUndefined(s.shape,i);if(r(u)&&r(h)){l.polylinePositions=u,l.shapePositions=h,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new f({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new d(l)}),appearance:y,asynchronous:!1,shadows:m}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:m}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,m=a.show;if(r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=i(s,I),this._showProperty=i(m,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(d(d.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(f))){var V=this._options;V.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,V.rectangle=p.getValue(h.MINIMUM_VALUE,V.rectangle),V.height=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,V.extrudedHeight=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,V.granularity=r(E)?E.getValue(h.MINIMUM_VALUE):void 0,V.stRotation=r(b)?b.getValue(h.MINIMUM_VALUE):void 0,V.rotation=r(x)?x.getValue(h.MINIMUM_VALUE):void 0,V.closeBottom=r(P)?P.getValue(h.MINIMUM_VALUE):void 0,V.closeTop=r(B)?B.getValue(h.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(V.closeTop)&&r(V.closeBottom)&&V.closeTop&&V.closeBottom,this._outlineWidth=r(A)?A.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var h=this._options,d=T.getValueOrUndefined(u.coordinates,i,h.rectangle);if(r(d)){h.rectangle=d,h.height=T.getValueOrUndefined(u.height,i),h.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),h.granularity=T.getValueOrUndefined(u.granularity,i),h.stRotation=T.getValueOrUndefined(u.stRotation,i),h.rotation=T.getValueOrUndefined(u.rotation,i),h.closeBottom=T.getValueOrUndefined(u.closeBottom,i),h.closeTop=T.getValueOrUndefined(u.closeTop,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(h),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:f}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(h)}),appearance:E,asynchronous:!1,shadows:f}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new m(h),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:f}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),m=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:m,color:o}}else n={show:u,distanceDisplayCondition:m};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,A),g=m instanceof y;this._materialProperty=m,this._fillProperty=i(s,D),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.positions=d.getValue(h.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(h.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(h.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var h=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var d=S.getValue(i,o.fillMaterialProperty,this._material);this._material=d;var v=new f({material:d,translucent:d.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:h}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new m(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:h}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;nx*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),M=e.clone(e.UNIT_Z,w),D=e.cross(M,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),M=e.cross(P,D,w),e.normalize(M,M),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(M=C,e.normalize(B,M),e.normalize(F,F),D=e.cross(M,F,w),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,M,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,D,D),u.multiplyByVector(O,M,M),e.normalize(P,P),e.normalize(D,D),e.normalize(M,M),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,W;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),W=e.clone(r.up,b));var H=v;I?(H[0]=P.x,H[1]=P.y,H[2]=P.z,H[3]=0,H[4]=D.x,H[5]=D.y,H[6]=D.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=A.x,H[13]=A.y,H[14]=A.z,H[15]=0):h.eastNorthUpToFixedFrame(A,p,H),r._setTransform(H),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(W,r.up),e.cross(G,W,r.right))}if(n){var q=m===d.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function m(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var f=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(m,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),m.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return m.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==d.MORPHING){var u=o.position,c=o!==this._lastEntity,h=s!==this._mode,f=this._offset3D,_=n.camera,g=c||h,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,f))||e.clone(m._defaultOffset3D,f)}else h||n.mode===d.MORPHING||this._mode===d.SCENE2D||e.clone(_.position,f);this._lastEntity=o,this._mode=n.mode!==d.MORPHING?n.mode:this._mode,n.mode!==d.MORPHING&&p(this,_,g,v,u,t,a)}},m}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e), t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=t.arcs.length;d0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;u>>1;e[n]0;){var i=(t+1>>1)-1,n=r[i];if(m(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(m(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function _(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function v(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?""+r+""+D(o)+"":""+r+""+o+"")}return i.length>0&&(i=''+i+"
"),i}function M(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(M(D,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.addProperty("properties"),l.properties=u;var c,h=u.title;if(n(h))l.name=h,c="title";else{var d=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var m=p.toLowerCase();if(d>1&&"title"===m){d=1,c=p;break}d>2&&"name"===m?(d=2,c=p):d>3&&/title/i.test(p)?(d=3,c=p):d>4&&/name/i.test(p)&&(d=4,c=p)}n(c)&&(l.name=u[c])}var f=u.description;null!==f&&(l.description=n(f)?new w(f):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function H(e,t,i,r,n){W(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;at&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;a2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function m(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(m)}function h(e){ var t=e.data,r=t.data;t.onappend&&(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*F,p127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}function E(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(D):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,h):d=_(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(D):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;r>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function oe(e){var t=F.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function ae(e,t,i,r){t.getData(new V.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new V.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new M;return n.addInterval(new D({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new M,i.addInterval(new D({start:n,stop:a}))}else c(n)?(i=new M,i.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new M,i.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new k;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function De(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function Me(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var h=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+h+".png"}if(o=Se(o,t._proxy,i,r),n){var d=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===d||"onExpire"===d?console.log("KML - Unsupported Icon refreshMode: "+d):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var m=u(Ce(e,"viewBoundScale",At.kml),1),f="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),f),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,m,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),h=ye(n,"heading",At.kml),d=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),m=Me(p,e,a,s,!1),f=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=me(y,"x"),w=me(y,"y"),S=fe(y,"xunits"),b=fe(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=m,T.scale=l,T.color=d,(c(f)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(f,_,g,v)),c(h)&&0!==h&&(T.rotation=E.toRadians(-h),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o:clampToSeaFloor is currently not supported, using :clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):console.log("KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function Ve(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function ke(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var d=Math.min(s.length,u.length),p=[],m=[],f=0;f0&&r.availability.addInterval(new D({start:m[0],stop:m[m.length-1]})),h&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new ee;h.addSamples(e,t),i.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Ve(h,a,s)})),r.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),h=!1,d=new ie,p=new M,m=new z,f=0,_=u.length;f<_;f++){var g=u[f],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=he(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A0)){for(_='',n=0;n";_+="
"+u(g.displayName,o)+""+u(g.value,"")+"
"}if(c(_)){_=vt.link(_),Dt.innerHTML=_;var S=Dt.querySelectorAll("a");for(n=0;n1&&(le(Dt,"a","href",r),le(Dt,"img","src",r));var E='
",Dt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function h(e){return!e||e.show&&h(e.parent)}var d=ce(i,r,l),p=d.kml,m=Oe(d,e,i,n,o,a),f=Ce(i,"name",At.kml);d.name=f,d.parent=t;var _=xe(i);c(_)||(_=Te(i)),d.availability=_,pt(d);var g=we(i,"visibility",At.kml);d.show=h(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=fe(C,"href"),w.hreflang=fe(C,"hreflang"),w.rel=fe(C,"rel"),w.type=fe(C,"type"),w.title=fe(C,"title"),w.length=fe(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,d),Qe(i,d,m,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:d,styleEntity:m}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,h=0;h0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,h,d=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,d,Lt)),c(l)?h=d.cartesianToCartographic(l,Ot):(h=A.center(o,Ot),l=d.cartographicToCartesian(h)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var m=o.width*n*.5,f=o.height*n*.5;o=new A(s(h.longitude-m),a(h.latitude-f),s(h.longitude+m),a(h.latitude+f))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(h.longitude).toString(),g=E.toDegrees(h.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",h.height.toString()),d.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"), i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,h){var d=Je(e,t,i,r,n,o,a,s,h),p=d.entity,m=_e(i,"Link",At.kml);if(c(m)||(m=_e(i,"Url",At.kml)),c(m)){var _=Ce(m,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=f(g,o));else{g=_;var w=Ce(m,"viewRefreshMode",At.kml),S=u(Ce(m,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(m,"viewFormat",At.kml),E),T=Ce(m,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,D=ht(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n0||"onExpire"===a||"onStop"===w){var h=_e(t,"NetworkLinkControl",At.kml),d=c(h),f=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:f,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:f},v=0;if(d&&(g.cookie=u(Ce(h,"cookie",At.kml),""),v=u(ye(h,"minRefreshPeriod",At.kml),0)),"onInterval"===a)d&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(d&&(y=Ce(h,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,f);b>0&&b0&&ge.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),ht(a,n,u,{context:t.id}).then(mt(a,e,n,h,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),d=!0}}h.set(e.id,e)}}),d&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},dt}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(h.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var d=new e,p=new e,m=new a;return h.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,d);if(i(r))return l.rotationMatrixFromPositionVelocity(d,r,this._ellipsoid,m),s.fromRotationMatrix(m,t)},h.prototype.equals=function(e){return this===e||e instanceof h&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},h}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function f(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES}),v=new s({color:new t(0,0,0,0)});return d.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:m(o,e.fragmentShaderSource),l=p(o,t),u=f(r,n),c=e.uniformMap,h=v;h.framebuffer=l,h.renderState=u,h.execute(o);var d=g;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this)},d}),i("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),p=0,m=0,f=0,_=-1,g=0;g0&&p===1-m){var C=f;f=-_,_=C}p+=f,m+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o);if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function _(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function w(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function E(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==p.SCENE2D&&e._mode!==p.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function b(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function T(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function D(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function I(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function B(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function F(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var m=j;m.x=e.y,m.y=e.z,m.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var _=X;_.x=n.y,_.y=n.z,_.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===p.SCENE2D&&(m.z=.5*a);var v=u.unproject(m,K);v.longitude=l.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=l.clamp(v.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(v,Q),w=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(w,f,f),c.multiplyByPointAsVector(w,_,_),c.multiplyByPointAsVector(w,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=_.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=_.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=_.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(_,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===p.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(m.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return w(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return w(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return E(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return b(this),this._modelView}},modelView3D:{get:function(){return T(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return I(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView; }},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return D(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return B(this),this._normal3D}},inverseNormal:{get:function(){return F(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},pass:{get:function(){return this._pass}}});var W=new u,H=new n;m.prototype.updateCamera=function(e){f(this,e.viewMatrix),_(this,e.inverseViewMatrix),y(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum)},m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},m.prototype.updatePass=function(e){this._pass=e},m.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;this.updateCamera(i),e.mode===p.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed)};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return m}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function M(e,t,i,r){for(var n=D(e,r)+": "+t.name+"(",o=0;o=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=O(this._originalGLContext,e?I:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var H=new g;L.prototype.clear=function(e,i){e=n(e,H),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var h=n(e.framebuffer,i.framebuffer);V(this,h),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);k(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=W;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"":"")}return r+="
"+n+""+i(o)+"
"+n+""+o+"
"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n):o(i,r)},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,h=n.fullExtent,m=l.unproject(new t(Math.max(h.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(h.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(h.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(h.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(m.longitude,m.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),f.handleSuccess(d)}function s(e){var t="An error occurred while accessing "+C._url+".";d=f.handleError(d,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new m(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=h(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var d,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,h,p,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=d.toDegrees(a),h=d.toDegrees(s),p="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,h=f.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+h,g+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a=p.zoomMin&&t<=p.zoomMax){var m=c.intersection(i,p.bbox,S);n(m)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==", v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<=0;--n){var o=1<e+Math.PI?e+=s.TWO_PI:ts.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,_.height,C.height,u);return c}function _(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(m,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,m=t.clone(h.position,S),f=p(h.heading,o),_=h.frustum.right-h.frustum.left,g=d(h,n,_,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function v(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,w=new t,S=new t,E=new i,b=new i,T=new i,x=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,p=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,T),l=d.project(T,x));var w=i.camera,S=o.endTransform;n(S)&&w._setTransform(S);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var b=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),D=i.screenSpaceCameraController;D.enableInputs=!1;var M=v(D,o.complete),I=v(D,o.cancel),R=w.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(w.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(b),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(w.roll),s.EPSILON10))return g(M,I);var N=new Array(4);if(N[c.SCENE2D]=_,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,E<=0){var L=function(){var e=N[u](i,1,l,b,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,I)}var B=N[u](i,E,l,b,A,P,y);if(!n(C)){var F=w.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=F>V&&F>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:C,startObject:{time:0},stopObject:{time:E},update:B,complete:M,cancel:I}},y}),i("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),i("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=_.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new d,this._moveEnd=new d,this._changed=new d,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new v,this._invViewMatrix=new v,P(this),this._mode=x.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,_.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,j(this,A.DEFAULT_VIEW_RECTANGLE,this.position,!0);var r=i.magnitude(this.position);r+=r*A.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function P(e){v.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),v.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function D(e){S.basisTo2D(e._projection,e._transform,e._actualTransform)}function M(e){var t=e._projection,n=t.ellipsoid,o=v.getColumn(e._transform,3,de),a=n.cartesianToCartographic(o,ue),s=t.project(a,ce),l=pe;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,_e),c=r.add(v.getColumn(e._transform,0,he),o,he);n.cartesianToCartographic(c,a),t.project(a,s);var h=me;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0;var d=fe;if(i.magnitudeSquared(h)>_.EPSILON10)i.cross(u,h,d);else{var p=r.add(v.getColumn(e._transform,1,he),o,he);n.cartesianToCartographic(p,a),t.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0,i.magnitudeSquared(d)<_.EPSILON10&&(r.clone(r.UNIT_Y,h),r.clone(r.UNIT_Z,d))}i.cross(d,u,h),i.normalize(h,h),i.cross(u,h,d),i.normalize(d,d),v.setColumn(e._actualTransform,0,h,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,u,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function I(e){var t=e._mode,r=!1,n=0;t===x.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!i.equals(o,e.position)||r;a&&(o=i.clone(e.position,e._position));var s=e._direction,l=!i.equals(s,e.direction);l&&(i.normalize(e.direction,e.direction),s=i.clone(e.direction,e._direction));var u=e._up,c=!i.equals(u,e.up);c&&(i.normalize(e.up,e.up),u=i.clone(e.up,e._up));var h=e._right,d=!i.equals(h,e.right);d&&(i.normalize(e.right,e.right),h=i.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===x.COLUMBUS_VIEW||e._mode===x.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(A.TRANSFORM_2D,e._actualTransform):e._mode===x.COLUMBUS_VIEW?D(e):M(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var m=e._actualTransform;if(a||p)if(e._positionWC=v.multiplyByPoint(m,o,e._positionWC),t===x.SCENE3D||t===x.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=ge;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===x.SCENE2D&&(f.z=n),e._projection.unproject(f,e._positionCartographic)}if(l||c||d){var g=i.dot(s,i.cross(u,h,ge));if(Math.abs(1-g)>_.EPSILON2){var y=1/i.magnitudeSquared(u),C=i.dot(u,s)*y,w=i.multiplyByScalar(s,C,ge);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),h=i.cross(s,u,e._right),i.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(m,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(m,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(m,h,e._rightWC)),(a||l||c||d||p)&&P(e)}function R(e,t){var i;return i=_.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)?Math.atan2(t.y,t.x)-_.PI_OVER_TWO:Math.atan2(e.y,e.x)-_.PI_OVER_TWO,_.TWO_PI-_.zeroToTwoPi(i)}function O(e){return _.PI_OVER_TWO-_.acosClamped(e.z)}function N(e,t,i){var r=0;return _.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=_.zeroToTwoPi(r+_.TWO_PI)),r}function L(e,t,r,n,o){var a=v.clone(e.transform,be),s=S.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Te);e._setTransform(s),i.clone(i.ZERO,e.position);var l=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),u=g.fromQuaternion(l,Ae);g.getColumn(u,0,e.direction),g.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(a)}function B(e,t,r,n,o,a){var s=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(t,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Pe);t=l.project(u,Ee)}i.clone(t,e.position)}var c=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),h=g.fromQuaternion(c,Ae);g.getColumn(h,0,e.direction),g.getColumn(h,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(s)}function F(e,r,n,o){var a=-_.PI_OVER_TWO,s=0,l=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(r,e.positionWC)){if(o){var u=e._projection,c=u.ellipsoid.cartesianToCartographic(r,Pe);r=u.project(c,Ee)}t.clone(r,e.position);var h=.5*-r.z,d=-h,p=e.frustum;if(d>h){var m=p.top/p.right;p.right=d,p.left=h,p.top=p.right*m,p.bottom=-p.top}}if(e._scene.mapMode2D===b.ROTATE){var f=y.fromHeadingPitchRoll(n-_.PI_OVER_TWO,a,s,xe),C=g.fromQuaternion(f,Ae);g.getColumn(C,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(l)}function V(e,t,r,n){var o=i.clone(r.direction,De),a=i.clone(r.up,Me);if(e._scene.mode===x.SCENE3D){var s=e._projection.ellipsoid,l=S.eastNorthUpToFixedFrame(t,s,ve),u=v.inverseTransformation(l,ye);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Ie);return n.heading=R(o,a),n.pitch=O(o),n.roll=N(o,a,c),n}function k(e,t){var i,r,n=e._scene.mapMode2D===b.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function z(e,t){var r=e.position,n=i.normalize(r,ke);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,_.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Ge),_.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,ze),u=i.dot(n,l),c=_.acosClamped(u);t>0&&t>c&&(t=c-_.EPSILON4),u=i.dot(n,i.negate(l,Ge)),c=_.acosClamped(u),t<0&&-t>c&&(t=-c+_.EPSILON4);var h=i.cross(l,n,Ue);e.rotate(h,t)}}else e.rotate(e.right,t)}function U(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function G(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===b.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function W(e,t){e.move(e.direction,t)}function H(e,t,r){t=_.clamp(t,-_.PI_OVER_TWO,_.PI_OVER_TWO),e=_.zeroToTwoPi(e)-_.PI_OVER_TWO;var n=y.fromAxisAngle(i.UNIT_Y,-t,qe),o=y.fromAxisAngle(i.UNIT_Z,-e,je),a=y.multiply(o,n,o),s=g.fromQuaternion(a,Ye),l=i.clone(i.UNIT_X,He);return g.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function q(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function j(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:ot,l=t.north,u=t.south,c=t.east,d=t.west;d>c&&(c+=_.TWO_PI);var p,m=.5*(d+c);if(u<-_.PI_OVER_TWO+_.RADIANS_PER_DEGREE&&l>_.PI_OVER_TWO-_.RADIANS_PER_DEGREE)p=0;else{var f=Ze;f.longitude=m,f.latitude=l,f.height=0;var g=Ke;g.longitude=m,g.latitude=u,g.height=0;var v=Xe;a(v)&&v.ellipsoid===o||(Xe=v=new h(void 0,void 0,o)),v.setEndPoints(f,g),p=v.interpolateUsingFraction(.5,Ze).latitude}var y=Ze;y.longitude=m,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,rt),w=Ze;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,Qe);w.longitude=d;var E=o.cartographicToCartesian(w,$e);w.longitude=m;var b=o.cartographicToCartesian(w,tt);w.latitude=u;var T=o.cartographicToCartesian(w,it);w.longitude=c;var x=o.cartographicToCartesian(w,et);w.longitude=d;var A=o.cartographicToCartesian(w,Je);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(S,C,S),i.subtract(A,C,A),i.subtract(b,C,b),i.subtract(T,C,T);var P=o.geodeticSurfaceNormal(C,s.direction);i.negate(P,P);var D=i.cross(P,i.UNIT_Z,s.right);i.normalize(D,D);var M=i.cross(D,P,s.up),I=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*I,O=Math.max(q(P,M,E,I),q(P,M,x,I),q(P,M,S,I),q(P,M,A,I),q(P,M,b,I),q(P,M,T,I),q(P,D,E,R),q(P,D,x,R),q(P,D,S,R),q(P,D,A,R),q(P,D,b,R),q(P,D,T,R));if(u<0&&l>0){var N=Ze;N.longitude=d,N.latitude=0,N.height=0;var L=o.cartographicToCartesian(N,nt);i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R)),N.longitude=c,L=o.cartographicToCartesian(N,nt),i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R))}return i.add(C,i.multiplyByScalar(P,-O,nt),r)}function Y(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=at;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,st);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,lt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function X(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=ut;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ct);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,ht),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function Z(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,dt),a=f.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return C.getPoint(n,s,r)}}function K(e,t,i,r){var n=e.getPickRay(t,pt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-_.PI_OVER_TWO||a.latitude>_.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function Q(e,t,r,n){var o=e.getPickRay(t,mt),a=-o.origin.x/o.direction.x;C.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-_.PI_OVER_TWO||s.latitude>_.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function J(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,h=2/a*(a-t.y)-1,d=e.positionWC;i.clone(d,r.origin);var p=i.multiplyByScalar(e.directionWC,u,ft);i.add(d,p,p);var m=i.multiplyByScalar(e.rightWC,c*u*l,_t),f=i.multiplyByScalar(e.upWC,h*u*s,gt),_=i.add(p,m,r.direction);return i.add(_,f,_),i.subtract(_,d,_),i.normalize(_,_),r}function $(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*t.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-t.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return i.clone(e.position,u),i.multiplyByScalar(e.right,s,vt),i.add(vt,u,u),i.multiplyByScalar(e.up,l,vt),i.add(vt,u,u),i.clone(e.directionWC,r.direction),r}function ee(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function te(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,St),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Et),Et);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,bt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Tt)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),_=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-_||r.y>_){var g=s.y<-f||s.y>f,v=s.z<-_||s.z>_;if(g||v)return ee(e,r,s,f,_,t)}}function ie(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function re(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ne(e,t,i){a(i)||(i=p.clone(Pt));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=Dt:i.range=e._mode===x.SCENE2D?re(e,n):ie(e,n)}return i}function oe(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,Vt),l=i.magnitude(s),u=i.normalize(s,kt);i.equalsEpsilon(u,i.UNIT_Z,_.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,zt),zt),n=i.normalize(i.cross(u,r,Ut),Ut));var c=Math.sqrt(i.magnitudeSquared(s)-1),h=i.multiplyByScalar(u,1/l,Vt),d=c/l,p=i.multiplyByScalar(r,d,kt),m=i.multiplyByScalar(n,d,zt),f=i.add(h,m,Gt[0]);i.subtract(f,p,f),i.multiplyComponents(o,f,f);var g=i.subtract(h,m,Gt[1]);i.subtract(g,p,g),i.multiplyComponents(o,g,g);var v=i.subtract(h,m,Gt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(h,m,Gt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Gt}function ae(e,t,i,r,n,o){Wt.x=e,Wt.y=t;var s=r.pickEllipsoid(Wt,n,Ht);return a(s)?(qt[i]=n.cartesianToCartographic(s,qt[i]),1):(qt[i]=n.cartesianToCartographic(o[i],qt[i]),0)}A.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),A.TRANSFORM_2D_INVERSE=v.inverseTransformation(A.TRANSFORM_2D,new v),A.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),A.DEFAULT_VIEW_FACTOR=.5,A.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===x.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,h=o.x+l.left,d=o.x+l.right,p=n.y+s.bottom,m=n.y+s.top,f=o.y+l.bottom,g=o.y+l.top,v=Math.max(u,h),y=Math.min(c,d),C=Math.max(p,f),w=Math.min(m,g);if(v>=y||C>=m)r=1;else{var S=l;ud&&pg&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E=_.acosClamped(i.dot(e.directionWC,e._changedDirection)),b=E/(.5*e.frustum.fovy),T=i.distance(e.positionWC,e._changedPosition),A=T/e.positionCartographic.height;(b>t||A>t)&&(e._changed.raiseEvent(Math.max(b,A)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var se=new v,le=new n;A.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==x.SCENE2D&&s!==x.MORPHING){var u,c,h=l.ellipsoid,d=e.mapProjection;v.equals(this.transform,v.IDENTITY)||(u=v.clone(this.transform,se),c=i.magnitude(this.position),this._setTransform(v.IDENTITY));var p=le;s===x.SCENE3D?h.cartesianToCartographic(this.position,p):d.unproject(this.position,p);var m=!1;if(p.height_.PI?_.TWO_PI-C:C,g=y}return _.equalsEpsilon(Math.abs(f),_.TWO_PI,_.EPSILON9)&&(r.west=-_.PI,r.east=_.PI,qt[0].latitude>=0?r.north=_.PI_OVER_TWO:r.south=-_.PI_OVER_TWO),r}},A.clone=function(e,t){return a(t)||(t=new A(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),v.clone(e._transform,t.transform),t._transformChanged=!0,t},A}),i("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),i("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function h(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function d(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,d=i._eventStartPosition,p=i._pressTime,m=i._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=i._movement[o];t(f)||(f=i._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,d[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,m[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n=0&&u1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function D(e,t,i,r){return x(e,"{y}",i)}function M(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,me),!0})},w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?d(c).then(a.callback).otherwise(s):"xml"===a.type?f(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):m({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,pe={"{x}":A,"{y}":D,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":M,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},me=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),h=256,d=256,p=t(i.minimumLevel,0),m=i.maximumLevel,f=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(f),p),g=c.positionToTileXY(r.northeast(f),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:h,tileHeight:d,minimumLevel:p,maximumLevel:m,rectangle:f})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(n){function m(s){for(var d,p,m,f,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;PF.rectangle.east&&(k.east=F.rectangle.east),k.southF.rectangle.north&&(k.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(k),N),X=F.positionToTileXY(l.northeast(k),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:k,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function f(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new h({ellipsoid:n.ellipsoid}),d=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:d,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(m).otherwise(f)}n=i(n,{});var g,v=n.url,y=d.defer(),C=new p(y.promise);return _(),C}return m}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new f({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=m.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(x)),P.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new f({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=m.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(D)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},E}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(et[i-1])return d=i-2;if(e>=t[d]){if(d+1=0&&e>=t[d-1])return--d,d;var r;for(r=0;r=t[r]&&e8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),_=i.clamp((m-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(h.positionWC,p),w=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0}}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"; }),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return m.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,m=this._texture,f=!r(m)||m.width!==n||m.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!f||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},m.prototype.execute=function(e,t){this._command.execute(e,t)},m.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},m.prototype.getColorFramebuffer=function(){return this._fbo},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return f(this),n(this)},m}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=f:"text"===e&&(r=f)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a0)for(var o=0;o1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/\s*<\/body>/im,w=//im,S=/([\s\S]*)<\/title>/im;return o}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,p,m,f,_,g,v,y,C){var w=0,S="",E=n.pickTerrain.mesh.encoding,b=E.quantization;b===i.BITS12&&(w=1,S="QUANTIZATION_BITS12");var T=t.mode,x=T|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|f<<8|_<<9|g<<10|v<<11|y<<12|C<<13|w<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===x)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[x],!e(A)){var D=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();D.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),h&&M.defines.push("APPLY_HUE"),d&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),m&&M.defines.push("APPLY_ALPHA"),f&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),D.defines.push("SHOW_REFLECTIVE_OCEAN")),_&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(v?(D.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(D.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),D.defines.push("INCLUDE_WEB_MERCATOR_Y"),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(D.defines.push("FOG"),M.defines.push("FOG"));for(var I=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;R<a;++R)I+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n u_dayTextureUseWebMercatorT["+R+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+R+"],\n u_dayTextureTranslationAndScale["+R+"],\n "+(m?"u_dayTextureAlpha["+R+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n "+(h?"u_dayTextureHue["+R+"]":"0.0")+",\n "+(d?"u_dayTextureSaturation["+R+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+R+"]":"0.0")+"\n );\n";I+=" return color;\n }",M.sources.push(I),D.sources.push(s(T)),D.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:D,fragmentShaderSource:M,attributeLocations:E.getAttributeLocations()});A=P[x]=new o(a,x,O)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,p=d|o<<2|a<<3,m=this._pickShaderPrograms[p];if(!e(m)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var _="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";m=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),m.longitude=i.west,m.latitude=.5*(i.south+i.north),m.height=0;var n=r.cartographicToCartesian(m,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),m.longitude=i.east;var s=r.cartographicToCartesian(m,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),_=e.cross(u,f,h);e.normalize(_,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),v=e.cross(f,g,h);e.normalize(v,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,p=new e,m=new t,f=new e,_=new e,g=new e(0,-1,0),v=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),_),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=v,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),w=e.dot(m,h),S=e.subtract(r,u,y),E=e.dot(S,d),b=e.dot(S,p);C>0?o+=C*C:E>0&&(o+=E*E),w>0?o+=w*w:b>0&&(o+=b*b)}var T;T=t.mode===s.SCENE3D?n.height:r.x;var x=t.mode===s.SCENE3D?this.maximumHeight:0,A=T-x;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function m(e,t,r,n,o){function s(t){e.data=t,e.state=h.RECEIVED}function l(){e.state=h.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=h.RECEIVING,c(e.data,s,l)):e.state=h.UNLOADED}u()}function f(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=h.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=h.TRANSFORMED},function(){e.state=h.FAILED}))}function _(e,t,r,o,a,c){var d=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:d,usage:l.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},_=f[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,f[t.id]=_, e.mesh.indices.indexBuffers=f}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:m,indexBuffer:_}),e.state=h.READY}return p.prototype.freeResources=function(){if(this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new d({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===h.UNLOADED&&m(this,t,i,r,n),this.state===h.RECEIVED&&f(this,e,t,i,r,n),this.state===h.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===h.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,d=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,d,r,n,o),!i(this.data))return;this.state=h.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=h.RECEIVED},function(){p.state=h.FAILED})}this.state===h.RECEIVED&&f(this,e,t,r,n,o),this.state===h.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==f.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=f.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==f.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=f.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function D(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:d.LINEAR,magnificationFilter:h.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=D(e),h=o.length;if(1===h){if(0===o[0])return;a=u.allWaterTexture}else{var d=Math.sqrt(h);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:d,height:d,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==m.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;m<p;m+=3){var f=h[m],_=h[m+1],g=h[m+2],v=C(d,i,r,c,f,R),y=C(d,i,r,c,_,O),w=C(d,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===f.START&&(w(e,i,r),e.state=f.LOADING),e.state===f.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,h=0,d=c.length;h<d;++h){var p=c[h];if(n(p.loadingImagery)){if(p.loadingImagery.state===m.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(h,1),_._createTileImagerySkeletons(e,i,h),--h,d=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===m.FAILED||p.loadingImagery.state===m.INVALID)}else u=!1}e.upsampledFromParent=u,h===d&&(s&&(e.renderable=!0),l&&(e.state=f.DONE))},y}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&s.state!==t.READY;)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),i("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N){"use strict";function L(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,L.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,L.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,L.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,L.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,L.DEFAULT_GAMMA)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,h.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new N(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function B(e,t,n,o){if(u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=O.READY}function F(e,t,i){return JSON.stringify([e,t,i])}function V(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var h=c/63;a[s++]=0,a[s++]=h,a[s++]=1,a[s++]=h}var p={position:0,webMercatorT:1},m=d.getRegularGridIndices(2,64),f=_.createIndexBuffer({context:t,typedArray:m,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var v=new E({sources:[M]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;H.textureDimensions.x=y,H.textureDimensions.y=I,H.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,V=n.north,k=q,z=0,U=0;U<64;++U){var G=U/63,W=u.lerp(F,V,G);R=Math.sin(W);var j=.5*Math.log((1+R)/(1-R)),Y=(j-O)*L;k[z++]=Y,k[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=H,e.vertexArray=o.vertexArray}function k(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,h=Math.log(c)/Math.log(2),d=Math.round(h);return 0|d}n(L.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),L.DEFAULT_BRIGHTNESS=1,L.DEFAULT_CONTRAST=1,L.DEFAULT_HUE=0,L.DEFAULT_SATURATION=1,L.DEFAULT_GAMMA=1,L.prototype.isBaseLayer=function(){return this._isBaseLayer},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return o(this)};var z=new h,U=new h,G=new h,W=new h;L.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return h.intersection(e.rectangle,t)})},L.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof f&&e.rectangle.north<m.MaximumLatitude&&e.rectangle.south>-m.MaximumLatitude,l=h.intersection(a.rectangle,this._rectangle,z),u=h.intersection(e.rectangle,l,U);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=U,d.south>=c.north?u.north=u.south=c.north:d.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(d.south,c.south),u.north=Math.min(d.north,c.north)),d.west>=c.east?u.west=u.east=c.east:d.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(d.west,c.west),u.east=Math.min(d.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=k(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(h.northwest(u),v),E=w.positionToTileXY(h.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,D=h.clone(e.rectangle,W),M=w.tileXYToRectangle(S.x,S.y,v),I=h.intersection(M,l,G);s?(w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=D.width/512,T=D.height/512):P=w.tileXYToRectangle.bind(w);var R,O,L=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-D.west)>=b&&(L=Math.min(1,(I.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(I.north-D.north)>=T&&(B=Math.max(0,(I.north-D.south)/D.height));for(var F=B,V=S.x;V<=E.x;V++)if(R=L,M=P(V,S.y,v),I=h.simpleIntersection(M,l,G),r(I)){L=Math.min(1,(I.east-D.west)/D.width),V===E.x&&(this.isBaseLayer()||Math.abs(I.east-D.east)<b)&&(L=1),B=F;for(var H=S.y;H<=E.y;H++)if(O=B,M=P(V,H,v),I=h.simpleIntersection(M,l,G),r(I)){B=Math.max(0,(I.south-D.south)/D.height),H===E.y&&(this.isBaseLayer()||Math.abs(I.south-D.south)<T)&&(B=0);var q=new t(R,B,L,O),j=this.getImageryFromCache(V,H,v);o.imagery.splice(n,0,new N(j,q,s)),++n}}return!0},L.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,z),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},L.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=O.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=O.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=O.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=O.UNLOADED)}var o=this._imageryProvider,a=this;n()},L.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(r(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(r(n)){if(!n.isReady())return void(t.state=O.RECEIVED);if(n.shouldDiscardImage(t.image))return void(t.state=O.INVALID)}}var o=new b({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB});i.tilingScheme instanceof f?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=O.TEXTURE_LOADED},L.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){V(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,B(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),B(this,a,t,n)},L.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},L.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},L.prototype.getImageryFromCache=function(e,t,i,n){var o=F(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},L.prototype.removeImageryFromCache=function(e){var t=F(e.x,e.y,e.level);delete this._imageryCache[t]};var H={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},q=a.supportsTypedArrays()?new Float32Array(128):void 0;return L}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U){"use strict";function G(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=U.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(G.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(G.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(G.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(G.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function H(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,i,Q),Q},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,r,J),v.multiply(i,J,J),J},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function j(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=Y(e,r.vertexArray,r.terrainData._mesh))}function Y(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};m.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:f.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function X(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,h=t.hasWaterMask&&l(c),d=t.oceanNormalMap,p=h&&l(d),m=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,f=a.fog.enabled,_=U.castShadows(t.shadows),S=U.receiveShadows(t.shadows);h&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=$,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==z.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),ie),k=B.project(w.northeast(i.rectangle),re);if(A.x=F.x,A.y=F.y,A.z=k.x,A.w=k.y,a.mode!==z.MORPHING&&(b=ee,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===z.SCENE2D&&x.quantization===E.BITS12){var G=1/(Math.pow(2,12)-1)*.5,W=(A.z-A.x)*G,H=(A.w-A.y)*G;A.x-=W,A.y-=H,A.z+=W,A.w+=H}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var Y=s.imagery,X=0,Z=Y.length,K=t._renderState,Q=t._blendRenderState,J=K,te=t._firstPassInitialColor,le=a.context;l(t._debug.boundingSphereTile)||ae();do{var ue,ce,he=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new D,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=q(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a));var de=ce.properties;n.clone(te,de.initialColor),de.oceanNormalMap=d,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,r.clone(b,de.rtc),n.clone(A,de.tileRectangle),de.southAndNorthLatitude.x=I,de.southAndNorthLatitude.y=R,de.southMercatorYAndOneOverHeight.x=O,de.southMercatorYAndOneOverHeight.y=N;for(var pe=f&&g.fog(i._distance,a.fog.density)>g.EPSILON3,me=!1,fe=!1,_e=!1,ge=!1,ve=!1,ye=!1;he<u&&X<Z;){var Ce=Y[X],we=Ce.readyImagery;if(++X,l(we)&&0!==we.imageryLayer.alpha){var Se=Ce.useWebMercatorT?we.textureWebMercator:we.texture,Ee=we.imageryLayer;if(l(Ce.textureTranslationAndScale)||(Ce.textureTranslationAndScale=Ee._calculateTextureTranslationAndScale(i,Ce)),de.dayTextures[he]=Se,de.dayTextureTranslationAndScale[he]=Ce.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[he]=Ce.textureCoordinateRectangle,de.dayTextureUseWebMercatorT[he]=Ce.useWebMercatorT,de.dayTextureAlpha[he]=Ee.alpha,ye=ye||1!==de.dayTextureAlpha[he],de.dayTextureBrightness[he]=Ee.brightness,me=me||de.dayTextureBrightness[he]!==V.DEFAULT_BRIGHTNESS,de.dayTextureContrast[he]=Ee.contrast,fe=fe||de.dayTextureContrast[he]!==V.DEFAULT_CONTRAST,de.dayTextureHue[he]=Ee.hue,_e=_e||de.dayTextureHue[he]!==V.DEFAULT_HUE,de.dayTextureSaturation[he]=Ee.saturation,ge=ge||de.dayTextureSaturation[he]!==V.DEFAULT_SATURATION,de.dayTextureOneOverGamma[he]=1/Ee.gamma,ve=ve||de.dayTextureOneOverGamma[he]!==1/V.DEFAULT_GAMMA,l(we.credits))for(var be=a.creditDisplay,Te=we.credits,xe=0,Ae=Te.length;xe<Ae;++xe)be.addCredit(Te[xe]); ++he}}de.dayTextures.length=he,de.waterMask=c,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=x.minimumHeight,de.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,de.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,he,me,fe,_e,ge,ve,ye,h,p,t.enableLighting,m,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=M.GLOBE,t._debug.wireframe&&(j(le,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var Pe=ue.boundingVolume,De=ue.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Pe),r.fromElements(Pe.center.z,Pe.center.x,Pe.center.y,Pe.center),a.mode===z.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(ue.boundingVolume=e.clone(s.boundingSphere3D,Pe),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,De)),a.commandList.push(ue),J=Q,te=se}while(X<Z)}function Z(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new D,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(G.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),G.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)H(a[u]);a.length=0},G.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},G.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)X(this,n[o],e)}},G.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)Z(this,t[i],e)},G.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},G.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},G.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;G.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===_.OUTSIDE)return b.NONE;if(i.mode===z.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:b.NONE:h}return h};var Q=new v,J=new v,$=new n,ee=new r,te=new r,ie=new r,re=new r;G.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},G.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},G.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=k.LOADING)}),this._layerOrderChanged=!0}},G.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},G.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},G.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;ne=function(t,r){return t===i?n:(ae(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return G}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,m=[],f=[],_=d.length-1;_>=0;--_){var g=d[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(v.imageryLayer))}}}}if(0!==m.length)return l.all(m,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=h.center(e.rectangle,L),r=i.longitude-N.longitude,n=i.latitude-N.latitude;i=h.center(t.rectangle,L);var o=i.longitude-N.longitude,a=i.latitude-N.latitude;return r*r+n*n-(o*o+a*a)}function C(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;N=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,f=e._removeHeightCallbacks,_=t.frameNumber;if(p.length>0||f.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,p,f);p.length=0,f.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?w(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);x(e)}}function w(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),A(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void D(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(D(e,i),S(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(b(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(S(e,t.camera.positionCartographic,n,o,a,s),D(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function S(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(E(e,i),E(e,r),E(e,n),E(e,o)):(E(e,n),E(e,i),E(e,o),E(e,r)):t.latitude<i.north?(E(e,r),E(e,i),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,r),E(e,i))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function b(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(T(e,t,s,o,l),T(e,i,s,o,l),T(e,r,s,o,l),T(e,n,s,o,l)):(T(e,r,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,i,s,o,l)):a.latitude<t.rectangle.north?(T(e,i,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,r,s,o,l)):(T(e,n,s,o,l),T(e,r,s,o,l),T(e,i,s,o,l),T(e,t,s,o,l))}function T(e,t,i,r,n){i.computeTileVisibility(t,r,n)!==d.NONE?w(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function x(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,i){if(t.mode===_.SCENE2D)return P(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function P(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function D(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;I(e,t,o,a,i),I(e,t,o,a,r),I(e,t,o,a,n)}}function I(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,d=u+c,p=o.mode,m=o.mapProjection,f=m.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,f)),p===_.SCENE3D){var E=f.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,B.direction),b=f.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,B.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,V);e.subtract(S.positionOnEllipsoidSurface,x,B.origin)}}else t.clone(S.positionCartographic,F),F.height=-11500,m.project(F,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,B.origin),e.clone(e.UNIT_X,B.direction);var A=g.data.pick(B,p,m,!1,V);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,D=g.children,M=D.length,I=0;I<M&&(P=D[I],!h.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=d){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function O(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(v.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),v.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},v.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},v.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},v.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),C(this,e),O(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},v.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==_.MORPHING){M(this,e),R(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var N,L=new t,B=new c,F=new t,V=new e;return v}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Math","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new E,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[w,C]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[y]}),this._surface=new x({tileProvider:new b({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new h,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function M(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function I(e,t){return _.contains(e.rectangle,t)?e:void 0}a(D.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var R=[],O={start:0,stop:0};D.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=R;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;c<p;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==A.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,m.minimumHeight,m.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(m.boundingSphere3D,f);var _=d.raySphere(t,f,O);o(_)&&l.push(m)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var N=new i,L=new i,B=new r,F=new f;return D.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!_.contains(r.rectangle,e));++a);if(o(r)&&_.contains(r.rectangle,e)){for(;r.renderable;)r=I(r.southwestChild,e)||I(r.southeastChild,e)||I(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,N),c=F,h=l.geodeticSurfaceNormal(u,c.direction),d=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(d)){var p=Math.min(n(r.data.minimumHeight,0),-11500),m=i.multiplyByScalar(h,Math.abs(p)+1,L);i.subtract(u,m,c.origin)}var f=r.data.pick(c,void 0,void 0,!1,L);if(o(f))return l.cartesianToCartographic(f,B).height}}}},D.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;S(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===A.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},D.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},D.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},D}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function d(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(), e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function m(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function f(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),m(e),f(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return h.prototype.executeDebugGlobeDepth=function(e,t){d(this,e,t)},h.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},h.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},h.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},h.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){p(this),m(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},h}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);v._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,f),v._readyPromise.reject(new u(t))}function f(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);d(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",m._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return p.loadImage(this,r)},m.prototype.pickFeatures=function(){},m._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",m}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(){},s}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var h=t(r.format,"png");/\./.test(h)||(h="."+h),this._format=h;var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,_=new l,g=new t,v=[];return m.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function y(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function C(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function w(e){y(e),C(e)}function S(e,t,i,r){y(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function E(e,t){C(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(C(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(w(e),e._translucentMultipassSupport=!1,r=!1)}return r}function b(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return b(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return b(t,L,e._translucentRenderStateCache,i)}function A(e,t,i){return b(t,B,e._alphaRenderStateCache,i)}function P(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),a=h.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function D(e,t,i){return P(t,i,e._translucentShaderCache,F)}function M(e,t,i){return P(t,i,e._translucentShaderCache,V)}function I(e,t,i){return P(t,i,e._alphaShaderCache,k)}function R(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,h=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var d=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,d);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,d);r.framebuffer=u}function O(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var h=n[c],d=l&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;i(d,t,o,r,u)}r.framebuffer=a}v.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&S(this,t,n,o),i(this._translucentFBO)&&!s||E(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[m]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[m]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color; },u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var N={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},B={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",V=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",k=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=D(this,t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=M(this,t,e.shaderProgram),r.translucentCommand.renderState=x(this,t,e.renderState),r.alphaCommand.shaderProgram=I(this,t,e.shaderProgram),r.alphaCommand.renderState=A(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},v.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void O(this,e,t,i,r):void R(this,e,t,i,r)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){w(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},v}),i("Scene/OrthographicFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(g,m,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,d),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,d),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,d),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),i("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function h(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function d(e,t,i,n){u(e),c(e),h(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||d(t,i,n,o)}function m(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),m(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u});i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a});i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function g(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function v(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function y(e,t){var i=e._scene,r=i.camera,n=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,H);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,q),d=h.eastNorthUpToFixedFrame(c,t,j);return s.multiplyByPointAsVector(d,r.direction,a),s.multiplyByPointAsVector(d,r.up,l),n}function C(t,i,r,n){function a(t){S(c,m,t.time,u.position),S(h,f,t.time,u.direction),S(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,X),h=e.clone(u.direction,Z),p=e.clone(u.up,K),m=s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,r.position,Q),f=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.direction,J),_=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.up,$),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,l,0,1,i,n)}});t._currentTweens.push(g)}function w(t,i,r){function n(t){S(d,_,t.time,l.position),S(p,v,t.time,l.direction),S(m,w,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right);var i=l.frustum;i.right=a.lerp(E,b,t.time),i.left=-i.right,i.top=i.right*(s.drawingBufferHeight/s.drawingBufferWidth),i.bottom=-i.top,l.position.z=2*s.mapProjection.ellipsoid.maximumRadius}i/=3;var s=t._scene,l=s.camera,u=ee;u.aspectRatio=s.drawingBufferWidth/s.drawingBufferHeight,u.fov=a.toRadians(60);var c;i>0?(c=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,c.position),e.negate(c.position,c.direction),e.normalize(c.direction,c.direction),e.clone(e.UNIT_Z,c.up)):(l.position.z=l.frustum.right-l.frustum.left,c=y(t,r)),c.frustum=u;var h=M(c);g(t,h);var d=e.clone(l.position,ve),p=e.clone(l.direction,ye),m=e.clone(l.up,Ce),_=e.fromElements(0,0,5*r.maximumRadius,we),v=e.negate(e.UNIT_Z,Se),w=e.clone(e.UNIT_Y,Ee),E=l.frustum.right,b=.5*_.z;if(i>0){var T=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){s._mode=f.MORPHING,x(t,i,c,function(){C(t,i,c,h)})}});t._currentTweens.push(T)}else x(t,i,c,function(){C(t,i,c,h)})}function S(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,h,e.time);var t=d/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera,c=u.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=i.position.z*Math.tan(.5*c);u.frustum.far=d/Math.tan(.5*h)+1e7;var p=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(p)}function b(t,r){function n(t){S(c,_,t.time,u.position),S(h,m,t.time,u.direction),S(p,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,te),h=e.clone(u.direction,ie),p=e.clone(u.up,re),m=e.negate(e.UNIT_Z,oe),f=e.clone(e.UNIT_Y,ae),_=ne;if(r>0)e.clone(e.ZERO,ne),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,ne);var v=le;s.multiplyByPoint(d.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(d.TRANSFORM_2D,h,v.direction);var y=l.globe;if(i(y)){var C=y.pick(v,l,ue);i(C)&&(s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=se;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var b=ce;b.position=_,b.direction=m,b.up=f,b.frustum=w;var T=I(b);g(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,b,a,T)}});t._currentTweens.push(x)}function T(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,b)}r*=.5;var l=t._scene,u=l.camera,c=de;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,he),l.mapProjection.project(he,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=fe;e.clone(c.position2D,p.origin);var m=e.clone(u.directionWC,p.direction),f=n.scaleToGeodeticSurface(u.positionWC,ge),_=h.eastNorthUpToFixedFrame(f,n,_e);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,m,m),s.multiplyByPointAsVector(d.TRANSFORM_2D,m,m);var v=l.globe;if(i(v)){var y=v.pick(p,l,me);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(d.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var b=I(S);g(t,b),P(t,r,c,a)}function x(e,t,i,r){function n(e){l.frustum.fov=a.lerp(h,c,e.time),l.position.z=d/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=u*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7,l.frustum.fov=h;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function A(t,i,r,n){function s(t){S(c,p,t.time,u.position),S(h,m,t.time,u.direction),S(d,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var i=u.frustum;i.right=a.lerp(g,v,t.time),i.left=-i.right,i.top=i.right*(l.drawingBufferHeight/l.drawingBufferWidth),i.bottom=-i.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ve),h=e.clone(u.direction,ye),d=e.clone(u.up,Ce),p=e.clone(r.position,we),m=e.clone(r.direction,Se),_=e.clone(r.up,Ee),g=u.frustum.right,v=.5*p.z,y=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){l._mode=f.MORPHING,x(t,i,r,n)}});t._currentTweens.push(y)}function P(t,i,r,n){function a(t){S(u,d,t.time,l.position),S(c,p,t.time,l.direction),S(h,m,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}var s=t._scene,l=s.camera,u=e.clone(l.position,ve),c=e.clone(l.direction,ye),h=e.clone(l.up,Ce),d=e.clone(r.position2D,we),p=e.clone(r.direction2D,Se),m=e.clone(r.up2D,Ee),f=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,s,1,0,i,n)}});t._currentTweens.push(f)}function D(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(r){var n=r._scene;if(n._mode=f.SCENE3D,n.morphTime=f.getMorphTime(f.SCENE3D),v(r),r._previousMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),i(t.frustum)&&(o.frustum=t.frustum.clone())}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE3D,a)}}function I(t){return function(r){var n=r._scene;n._mode=f.SCENE2D,n.morphTime=f.getMorphTime(f.SCENE2D),v(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=f.COLUMBUS_VIEW,n.morphTime=f.getMorphTime(f.COLUMBUS_VIEW),v(r),n.camera.frustum=t.frustum.clone(),r._previousModeMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.COLUMBUS_VIEW,a)}}_.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},_.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==f.SCENE2D&&this._previousMode!==f.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE2D,!0),r._mode=f.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===f.COLUMBUS_VIEW?b(this,e):T(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var O=new e,N=new e,L=new e,B=new e,F=new e,V=new e,k=new e,z=new t,U=new s,G=new m,W={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.COLUMBUS_VIEW&&this._previousMode!==f.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,f.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=O,l=N,u=L;if(t>0)o.x=0,o.y=0,o.z=5*r.maximumRadius,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{var c=n.camera;if(this._previousMode===f.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,k),m=h.eastNorthUpToFixedFrame(p,r,U);s.inverseTransformation(m,m),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(m,l,l),s.multiplyByPointAsVector(m,u,u)}}var _=G;_.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,_.fov=a.toRadians(60);var v=W;v.position=o,v.direction=l,v.up=u,v.frustum=_;var y=R(v);g(this,y),this._previousMode===f.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(d.TRANSFORM_2D,o,B),v.direction2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,l,F),v.up2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,u,V),n._mode=f.MORPHING,P(this,t,v,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.SCENE3D&&this._previousMode!==f.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE3D,!0),n._mode=f.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===f.SCENE2D)w(this,t,r);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=y(this,r);var a=M(o);g(this,a),C(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return v(this),r(this)};var H=new t,q=new e,j=new s,Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new e,Z=new e,K=new e,Q=new e,J=new e,$=new e,ee=new m,te=new e,ie=new e,re=new e,ne=new e,oe=new e,ae=new e,se=new p,le=new l,ue=new e,ce={position:void 0,direction:void 0,up:void 0,frustum:void 0},he=new t,de={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new p},pe={position:new e,direction:new e,up:new e,frustum:void 0},me=new e,fe=new l,_e=new s,ge=new e,ve=new e,ye=new e,Ce=new e,we=new e,Se=new e,Ee=new e;return _}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,p=new l.Tween(d);p.to(e(r.stopObject),n),p.delay(c),p.easing(h),i(r.update)&&p.onUpdate(function(){r.update(d)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var m=new u(this,p,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(), t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new b,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function P(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&d<$){var f=x(m,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||A(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function D(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;u<l;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,p=h.modifier,m=s.isMoving(d,p)&&s.getMovement(d,p),f=s.getStartMousePosition(d,p);e.enableInputs&&t&&(m?r(e,f,m):n<1&&P(s,d,p,n,r,e,a))}}}function M(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,p=s-c,m=a*p;m=d.clamp(m,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,_=f/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=m*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-h)<1)){s-g<c?g=s-c-1:s-g>h&&(g=s-h);var v,y=i._scene,C=y.camera,w=y.mode,b=e.equals(r,i._zoomMouseStart),T=i._zoomingOnVector,x=i._rotatingZoom;if(b||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(v=w!==S.SCENE2D?B(i,r,ie):C.getPickRay(r,te).origin),o(v)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,T=i._zoomingOnVector=!1,x=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(g);var A=w===S.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(x=!0),!b||x){if(w===S.SCENE2D){var P=i._zoomWorldPosition,D=C.position;if(!t.equals(P,D)&&C.positionCartographic.height<2*i._maxCoord.x){var M=C.position.x,I=t.subtract(P,D,ne);t.normalize(I,I);var R=t.distance(P,D)*g/(.5*C.getMagnitude());C.move(I,.5*R),(C.position.x<0&&M>0||C.position.x>0&&M<0)&&(v=C.getPickRay(r,te).origin,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition))}}else if(w===S.SCENE3D){var O=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,O))<.6)A=!0;else{var N=y.canvas,L=oe;L.x=N.clientWidth/2,L.y=N.clientHeight/2;var F=B(i,L,ae);if(o(F)&&C.positionCartographic.height<1e6){var V=de;t.clone(C.position,V);var k=i._zoomWorldPosition,z=he;if(z=t.normalize(k,z),t.dot(z,O)<0)return;var U=Ce,G=fe;t.clone(C.direction,G),t.add(V,t.multiplyByScalar(G,1e3,we),U);var W=_e,H=ge;t.subtract(k,V,W),t.normalize(W,H);var q=Math.acos(-t.dot(O,H)),j=t.magnitude(V),Y=t.magnitude(k),X=j-g,Z=t.magnitude(W),K=Math.asin(d.clamp(Z/Y*Math.sin(q),-1,1)),Q=Math.asin(d.clamp(X/Y*Math.sin(q),-1,1)),J=K-Q+q,$=pe;t.normalize(V,$);var ee=me;ee=t.cross(H,$,ee),ee=t.normalize(ee,ee),t.normalize(t.cross($,ee,we),G),t.multiplyByScalar(t.normalize(U,we),t.magnitude(U)-g,U),t.normalize(V,V),t.multiplyByScalar(V,X,V);var be=ve;t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),X,be),t.add(V,be,V),t.normalize(U,$),t.normalize(t.cross($,ee,we),G);var Te=ye;return t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),t.magnitude(U),Te),t.add(U,Te,U),t.clone(V,C.position),t.normalize(t.subtract(U,V,we),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),void t.cross(C.right,C.direction,C.up)}if(o(F)){var xe=t.normalize(F,se),Ae=t.normalize(i._zoomWorldPosition,le),Pe=t.dot(Ae,xe);if(Pe>0&&Pe<1){var De=d.acosClamped(Pe),Me=t.cross(Ae,xe,ue),Ie=Math.abs(De)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,Re=g/Ie;C.rotate(Me,De*Re)}}else A=!0}}i._rotatingZoom=!A}if(!b&&A||T){var Oe,Ne=E.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);Oe=w!==S.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Ne)?C.getPickRay(Ne,te):C.getPickRay(r,te);var Le=Oe.direction;w===S.COLUMBUS_VIEW&&t.fromElements(Le.y,Le.z,Le.x,Le),C.move(Le,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function I(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,be).origin,s=o.getPickRay(r.endPosition,Te).origin,l=t.subtract(a,s,xe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;M(e,t,i,e._zoomFactor,n.getMagnitude())}function O(t,i,r){if(o(r.angleAndHeight))return void N(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=Pe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var p=d.acosClamped(c.x);c.y<0&&(p=d.TWO_PI-p);var m=d.acosClamped(h.x);h.y<0&&(m=d.TWO_PI-m);var f=m-p;a.twistRight(f)}function N(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===w.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(D(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement")):(D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.translateEventTypes,O,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,Me));var u=s.getPickRay(i,De),c=a.pick(u,n,Ie),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return h<d?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void Q(i,r,n);if(i._strafing)return void W(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,ke),h=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),m=t.clone(t.ZERO,Fe),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=B(i,c,Ne),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,W(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,_,Ve);p=l.getPickRay(c,Re);var v=u.rayPlane(p,g,Ne),y=l.getPickRay(h,Oe),C=u.rayPlane(y,g,Le);if(!o(v)||!o(C))return i._looking=!0,Q(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Be),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>d.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function V(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void Q(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,k(t,i,r)):z(t,i,r)}function k(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ue;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ge),f=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,_)/y),!o(h)||h<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,We);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Ke);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,qe),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Qe);s._setTransform(b),q(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function z(i,r,n){var a,s,c=i._scene,h=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,We);else{if(h.position.z<i._minimumPickingTerrainHeight&&(a=B(i,r,We)),!o(a)){s=h.getPickRay(r,Ge);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>d.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,We),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ue;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=h.getPickRay(b,Ge);var T=t.clone(t.ZERO,Ye);T.x=a.x;var x=f.fromPointNormal(T,g,Xe),A=u.rayPlane(s,x,He),P=h._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var M=P.unproject(a,Ke);D.cartographicToCartesian(M,a);var I,R=v.eastNorthUpToFixedFrame(a,D,qe);o(A)?(t.fromElements(A.y,A.z,A.x,A),M=P.unproject(A,Ke),D.cartographicToCartesian(M,A),I=v.eastNorthUpToFixedFrame(A,D,je)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,F=m.clone(h.transform,Qe);h._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(h.position,Ze),Ze),k=t.dot(h.right,V);if(q(i,r,n,L,!1,!0),h._setTransform(I),k<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=h.constrainedAxis;h.constrainedAxis=void 0,q(i,r,n,L,!0,!1),h.constrainedAxis=z}else q(i,r,n,L,!0,!1);if(o(h.constrainedAxis)){var U=t.cross(h.direction,h.constrainedAxis,Dt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,h.right)<0&&t.negate(U,U),t.cross(U,h.direction,h.up),t.cross(h.direction,h.up,h.right),t.normalize(h.up,h.up),t.normalize(h.right,h.right))}h._setTransform(F),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(h.positionWC,Ze);if(h._adjustHeightForTerrain(),!t.equals(h.positionWC,W)){h._setTransform(I),h.worldToCameraCoordinatesPoint(W,W);var H=t.magnitudeSquared(W);t.magnitudeSquared(h.position)>H&&(t.normalize(h.position,h.position),t.multiplyByScalar(h.position,Math.sqrt(H),h.position));var j=t.angleBetween(W,h.position),Y=t.cross(W,h.position,W);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,j,Je),Z=p.fromQuaternion(X,$e);p.multiplyByVector(Z,h.direction,h.direction),p.multiplyByVector(Z,h.up,h.up),t.cross(h.direction,h.up,h.right),t.cross(h.right,h.direction,h.up),h._setTransform(F)}}function U(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=et;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,tt);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,it));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,p=c.origin,m=c.direction;h=-t.dot(d,p)/t.dot(d,m)}M(e,i,r,e._zoomFactor,h)}function G(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),D(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,U,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableLook,e.lookEventTypes,Q),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else D(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,i,r){var n=e._scene,a=n.camera,s=B(e,r.startPosition,ut);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,rt),h=t.clone(a.direction,at);n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,nt),p=u.rayPlane(c,d,ot);o(p)&&(h=t.subtract(s,p,h),n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function H(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void q(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,dt),f=i._ellipsoid.cartesianToCartographic(s.positionWC,lt).height,_=i._globe,g=!1;if(o(_)&&f<i._minimumPickingTerrainHeight&&(d=B(i,n.startPosition,ut),o(d))){var v=s.getPickRay(n.startPosition,De),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?Q(i,r,n,p):i._rotating?q(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),W(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,W(i,r,n)):(u=t.magnitude(d),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,Q(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,st))?(j(i,r,n,i._ellipsoid),t.clone(st,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,q(i,r,n)):(i._looking=!0,Q(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function q(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),m=e._rotateFactor*(p-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,_=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=m*f*Math.PI*2,v=m*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=d}function j(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,yt),c=e.clone(n.endPosition,Ct),h=l.pickEllipsoid(u,a,pt),p=l.pickEllipsoid(c,a,mt);if(!o(h)||!o(p))return i._rotating=!0,void q(i,r,n);if(h=l.worldToCameraCoordinates(h,h),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var m=l.constrainedAxis,f=t.mostOrthogonalAxis(m,ft);t.cross(f,m,f),t.normalize(f,f);var _=t.cross(m,f,_t),g=t.magnitude(h),v=t.dot(m,h),y=Math.acos(v/g),C=t.multiplyByScalar(m,v,gt);t.subtract(h,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(m,p),E=Math.acos(S/w),b=t.multiplyByScalar(m,S,vt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,f));t.dot(C,_)<0&&(T=d.TWO_PI-T);var x=Math.acos(t.dot(b,f));t.dot(b,_)<0&&(x=d.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,ft);var D,M=t.cross(m,A,ft),I=t.dot(M,t.subtract(h,m,_t)),R=t.dot(M,t.subtract(p,m,_t));D=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,m)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,ft);if(O<1&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function Y(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=et;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,tt),d=n.cartesianToCartographic(s.position,St).height;d<e._minimumPickingTerrainHeight&&(c=B(e,u,it));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,wt);M(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function X(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Nt);return void Q(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ot);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):K(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,_=Et;_.x=f.clientWidth/2,_.y=f.clientHeight/2;var y,C=c.getPickRay(_,bt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Tt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Nt);return Q(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Ot);b.height=0,y=a.cartographicToCartesian(b,Tt)}var T=v.eastNorthUpToFixedFrame(y,a,At),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=m.clone(c.transform,Mt);c._setTransform(T),q(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var D=A.maximumRadius;i._rotateFactor=1/D,i._rotateRateRangeAdjustment=D}}function K(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Tt);else{if(a=B(i,r,Tt),!o(a)){if(s=y.getPickRay(r,bt),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ot);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Nt);Q(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Tt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,E=Et;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,bt);var b=t.magnitude(a),T=t.fromElements(b,b,b,ct),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,xt),D=v.eastNorthUpToFixedFrame(a,h,At),M=v.eastNorthUpToFixedFrame(P,x,Pt),I=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=m.clone(y.transform,Mt);y._setTransform(D);var L=t.cross(P,y.positionWC,Dt),F=t.dot(y.rightWC,L);if(q(i,r,n,O,!1,!0),y._setTransform(M),F<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,q(i,r,n,O,!0,!1),y.constrainedAxis=V}else q(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,Dt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Dt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),H=t.cross(U,y.position,U);t.normalize(H,H);var j=_.fromAxisAngle(H,W,It),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function Q(e,i,r,a){var s=e._scene,l=s.camera,u=Bt;u.x=r.startPosition.x,u.y=0;var c=Ft;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p);f<1&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(_)?l.look(_,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p),f<1&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,_),o(a)){var g=l.direction,v=t.negate(a,zt),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,v,d.EPSILON2);if(y||C)(y&&m<0||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var w=d.acosClamped(f);m>0&&m>w&&(m=w-d.EPSILON4),f=t.dot(g,v),w=d.acosClamped(f),m<0&&-m>w&&(m=-w+d.EPSILON4);var S=t.cross(a,g,Ut);l.look(S,m)}}else l.lookUp(m)}function J(e){D(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableTilt,e.tiltEventTypes,X,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableLook,e.lookEventTypes,Q)}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new t,de=new t,pe=new t,me=new t,fe=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new g,Te=new g,xe=new t,Ae=new e,Pe=new e,De=new g,Me=new t,Ie=new t,Re=new g,Oe=new g,Ne=new t,Le=new t,Be=new t,Fe=new t,Ve=new f(t.ZERO,0),ke=new e,ze=new e,Ue=new e,Ge=new g,We=new t,He=new t,qe=new m,je=new m,Ye=new t,Xe=new f(t.ZERO,0),Ze=new t,Ke=new r,Qe=new m,Je=new _,$e=new p,et=new e,tt=new g,it=new t,rt=new g,nt=new f(t.ZERO,0),ot=new t,at=new t,st=new t,lt=new r,ut=new t,ct=new t,ht=new l,dt=new t,pt=i.clone(i.UNIT_W),mt=i.clone(i.UNIT_W),ft=new t,_t=new t,gt=new t,vt=new t,yt=new e,Ct=new e,wt=new t,St=new r,Et=new e,bt=new g,Tt=new t,xt=new t,At=new m,Pt=new m,Dt=new t,Mt=new m,It=new _,Rt=new p,Ot=new r,Nt=new t,Lt=new r,Bt=new e,Ft=new e,Vt=new g,kt=new g,zt=new t,Ut=new t;return T.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===S.SCENE2D?L(this):r===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,G(this)):r===S.SCENE3D&&(this._horizontalRotationAxis=void 0,J(this)),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var h="varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(h)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,h=0;h<c;++h)s[h]=t.replaceMain(s[h],"czm_shadow_cast_main");var d="";return r&&(u||(d+="varying vec3 v_positionEC; \n"),d+="uniform vec4 shadowMap_lightPositionEC; \n"),d+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",d+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",d+="} \n",s.push(d),new t({defines:a,sources:s})},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),h=r._usesDepthTexture,d=r._polygonOffsetSupported,p=r._isPointLight,m=r._isSpotLight,f=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):h&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),f&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",E+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?E+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":d||(E+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":m?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":f?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(_?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n", E+=" gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),i("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K){"use strict";function Q(e){e=h(e,h.EMPTY_OBJECT);var i=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this.dirty=!0,this.fromLightSource=h(e.fromLightSource,!0),this.darkness=h(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=h(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!1,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=h(e.isPointLight,!1),this._pointLightRadius=h(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&h(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?h(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new j:d(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new J(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,ee(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=h(e.size,2048),this.size=this._size}function J(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function $(e,t){return L.fromCache({cull:{enabled:!0,face:W.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function ee(e){var t=!e._usesDepthTexture;e._primitiveRenderState=$(t,e._primitiveBias),e._terrainRenderState=$(t,e._terrainBias),e._pointRenderState=$(t,e._pointBias)}function te(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;d(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ie(){return new B({wrapS:U.CLAMP_TO_EDGE,wrapT:U.CLAMP_TO_EDGE,minificationFilter:z.NEAREST,magnificationFilter:k.NEAREST})}function re(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=new D({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ne(e,t){for(var i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:ie()}),r=new D({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function oe(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ae(e,t){e._isPointLight?oe(e,t):e._usesDepthTexture?ne(e,t):re(e,t)}function se(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ee(e),te(e),ae(e,t))}function le(e,t){d(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(te(e),ae(e,t),se(e,t),ue(e,t))}function ue(e,t,i){i=h(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ce(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,h=u.y/o.y,d=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(d,0,0,c,0,p,0,h,0,0,1,0,0,0,0,1)}}function he(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=M.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Ee;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;d(l)||(l=he(t,r),t._debugShadowViewCommand=l),d(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function pe(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new Z({geometryInstances:[r,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function me(e,t){de(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new q({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new q({camera:e._passes[r].camera,color:Pe[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!d(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,De),c=C.fromTranslationQuaternionRotationScale(o,a,u,Te);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=pe(c,l.YELLOW)}e._debugLightFrustum.update(t)}else d(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function _e(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,h=l/s,d=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,d=.9);var m=Oe,f=Ie;for(f[0]=s,f[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(h,_),v=s+c*_,w=y.lerp(v,g,d);f[i+1]=w,m[i]=w-f[i]}if(p){for(i=0;i<u;++i)m[i]=Math.min(m[i],e._maximumCascadeDistances[i]);var S=f[0];for(i=0;i<u-1;++i)S+=m[i],f[i+1]=S}o.unpack(f,0,e._cascadeSplits[0]),o.unpack(f,1,e._cascadeSplits[1]),o.unpack(m,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,D=E.far,M=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Re),N=r.getViewProjection();for(i=0;i<u;++i){O.near=f[i],O.far=f[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,Te),B=C.inverse(L,Te),F=C.multiply(N,B,Te),V=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),k=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),z=0;z<8;++z){var U=o.clone(be[z],xe[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,V,V),n.maximumByComponent(U,k,k)}V.x=Math.max(V.x,0),V.y=Math.max(V.y,0),V.z=0,k.x=Math.min(k.x,1),k.y=Math.min(k.y,1),k.z=Math.min(k.z,1);var G=e._passes[i],W=G.camera;W.clone(r);var H=W.frustum;H.left=b+V.x*(T-b),H.right=b+k.x*(T-b),H.bottom=x+V.y*(A-x),H.top=x+k.y*(A-x),H.near=P+V.z*(D-P),H.far=P+k.z*(D-P),G.cullingVolume=W.frustum.computeCullingVolume(M,I,R);var q=e._cascadeMatrices[i];C.multiply(W.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function ge(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,Te),s=C.inverse(a,Te),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Le);u=n.cross(c,l,Be),n.normalize(u,u),n.normalize(c,c);for(var h=n.fromElements(0,0,0,ke),d=C.computeView(h,l,u,c,Ne),p=C.multiply(d,s,Te),m=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),f=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),_=0;_<8;++_){var g=o.clone(be[_],xe[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,m,m),n.maximumByComponent(g,f,f)}f.z+=1e3,m.z-=10;var v=ke;v.x=-(.5*(m.x+f.x)),v.y=-(.5*(m.y+f.y)),v.z=-f.z;var y=C.fromTranslation(v,Te);d=C.multiply(y,d,d);var w=.5*(f.x-m.x),S=.5*(f.y-m.y),E=f.z-m.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(d,i.viewMatrix),C.inverse(d,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ve(e,t){var i=new X;i.fov=y.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=ze[r],n.upWC=Ue[r],n.rightWC=Ge[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ye(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=qe;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,We),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var h=o.frustum.far/2,d=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,h,je),je);a.center=d,a.radius=h,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function Ce(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r);var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=G.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ye(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function we(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=Ye;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Se(e,t,i,r,n,o){var a,l,u;if(d(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!d(a)||n!==i.shaderProgram.id||t){d(a)&&a.destroy();var c=i.shaderProgram,h=c.vertexShaderSource,p=c.fragmentShaderSource,m=i.pass===M.GLOBE,f=i.pass!==M.TRANSLUCENT,_=e._isPointLight,g=e._usesDepthTexture,v=K.createShadowCastVertexShader(h,_,m),y=K.createShadowCastFragmentShader(p,_,g,f);a=F.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:c._attributeLocations}),l=e._primitiveRenderState,_?l=e._pointRenderState:m&&(l=e._terrainRenderState);var C=i.renderState.cull.enabled;C||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=we(e,i.uniformMap,m)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Q.MAXIMUM_DISTANCE=2e4,Q.prototype.debugCreateRenderStates=function(){ee(this)},p(Q.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ce(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var Ee=new e,be=new Array(8);be[0]=new o(-1,-1,-1,1),be[1]=new o(1,-1,-1,1),be[2]=new o(1,1,-1,1),be[3]=new o(-1,1,-1,1),be[4]=new o(-1,-1,1,1),be[5]=new o(1,-1,1,1),be[6]=new o(1,1,1,1),be[7]=new o(-1,1,1,1);for(var Te=new C,xe=new Array(8),Ae=0;Ae<8;++Ae)xe[Ae]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],De=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var Me=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(Me,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Re=new X,Oe=new Array(4),Ne=new C,Le=new n,Be=new n,Fe=new n,Ve=new n,ke=new n,ze=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ue=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ge=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],We=new n,He=new n,qe=new t,je=qe.center;Q.prototype.update=function(e){if(Ce(this,e),this._needsUpdate)if(le(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&_e(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&me(this,e)},Q.prototype.updatePass=function(e,t){ue(this,e,t)};var Ye=new r;return Q.createDerivedCommands=function(e,t,i,r,n,o){d(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===M.GLOBE,h=!1;if(c&&(h=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;d(p)||(p=o.castCommands=[]);var m=o.castShaderProgramId,f=e.length;p.length=f;for(var _=0;_<f;++_)p[_]=Se(e[_],r,i,n,m,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;d(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!d(g)||C||r||y){d(g)&&g.destroy();var w=K.createShadowReceiveVertexShader(l,c,h),S=K.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,h);g=F.fromCache({context:n,vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations}),v=we(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){te(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return m(this)},Q}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,D=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var I=1,R=2;M={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,V=o(F)&&F.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,D),Z=l.multiplyByPoint(q,H,x),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,D),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(), this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he){"use strict";function de(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new R(i,r);h(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new q(o,new z(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new B(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ne,this._groundPrimitives=new ne,this._tweens=new he,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new X);var d;this._useOIT&&h(l)&&(d=new K(o)),this._globeDepth=l,this._depthPlane=new G,this._oit=d,this._fxaa=new Y,this._clearColorCommand=new M({color:new s,stencil:0,owner:this}),this._depthClearCommand=new M({depth:1,owner:this}),this._stencilClearCommand=new M({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new se(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=s.clone(s.BLACK),this._mode=oe.SCENE3D,this._mapProjection=h(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new H,this._sunCamera=new k(this),this.shadowMap=new ue({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new k(this);this._camera=p,this._cameraClone=k.clone(p),this._screenSpaceCameraController=new le(this),this._mapMode2D=c(t.mapMode2D,Z.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var m=p.frustum.near,f=p.frustum.far,v=Math.ceil(Math.log(f/m)/Math.log(this.farToNearRatio));ye(m,f,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),ve(this,0,E.now()),this.initializeFrame()}function pe(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function me(e,t,i){var r=1/Math.max(1,pe(e.position,t.position));return n.multiplyByScalar(e.position,r,Qe),n.multiplyByScalar(t.position,r,Je),n.equalsEpsilon(Qe,Je,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function fe(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;if(t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0),t.dirty){t.dirty=!1;var c=t.derivedCommands;n&&(t.receiveShadows||t.castShadows)&&(c.shadows=ue.createDerivedCommands(o,a,t,l,r,c.shadows));var d=e._oit;t.pass===L.TRANSLUCENT&&h(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=h(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=d.createDerivedCommands(t,r,c.oit))}}function _e(e){var t=e.globe;if(e._mode===oe.SCENE3D&&h(t)){var i=t.ellipsoid;return $e.radius=i.minimumRadius,Ke=A.fromBoundingSphere($e,e._camera.positionWC,Ke)}}function ge(e){e.render=!1,e.pick=!1}function ve(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=_e(e),n.terrainExaggeration=e._terrainExaggeration,ge(n.passes)}function ye(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];h(c)?(c.near=l,c.far=u):c=n[s]=new j(l,u)}}function Ce(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||fe(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof M?L.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=h(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function we(e,t,i){return h(e)&&(!h(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!h(i)||!e.boundingVolume.isOccluded(i)))}function Se(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=L.NUMBER_OF_PASSES,d=0;d<u;++d)for(var p=0;p<c;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===oe.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=et.planes,b=0;b<5;++b)E[b]=S.planes[b];S=et;var T=e._environmentState;T.isSkyAtmosphereVisible=h(T.skyAtmosphereCommand)&&T.isReadyForAtmosphere,T.isSunVisible=we(T.sunDrawCommand,S,w),T.isMoonVisible=we(T.moonCommand,S,w);for(var x=s.length,A=0;A<x;++A){var P=s[A],D=P.pass;if(D===L.COMPUTE)o.push(P);else if(D===L.OVERLAY)a.push(P);else{var I=P.boundingVolume;if(h(I)){if(!we(P,S,w))continue;if(tt=I.computePlaneDistances(n,r,tt),m=Math.min(m,tt.start),f=Math.max(f,tt.stop),g&&P.receiveShadows&&tt.start<ue.MAXIMUM_DISTANCE&&!(D===L.GLOBE&&tt.start<-100&&tt.stop>100)){var R=tt.stop-tt.start;D!==L.GLOBE&&tt.start<100&&(C=Math.min(C,R)),v=Math.min(v,tt.start),y=Math.max(y,tt.stop)}}else tt.start=i.frustum.near,tt.stop=i.frustum.far,_=!(P instanceof M);Ce(e,P,tt)}}_?(m=i.frustum.near,f=i.frustum.far):(m=Math.min(Math.max(m,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),m),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var O,N=e.mode===oe.SCENE2D,B=e.farToNearRatio;N?(f=Math.min(f,i.position.z+e.nearToFarDistance2D),m=Math.min(m,f),O=Math.ceil(Math.max(1,f-m)/e.nearToFarDistance2D)):O=Math.ceil(Math.log(f/m)/Math.log(B)),m!==Number.MAX_VALUE&&(O!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(ye(m,f,B,O,l,N,e.nearToFarDistance2D),Se(e))}function Ee(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function be(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=V.replaceMain(e,"czm_Debug_main")});var a="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){h(e._debugColor)||(e._debugColor=s.fromRandom());var l=e._debugColor;a+=" gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var u=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";a+=" gl_FragColor.rgb *= vec3("+u+", "+d+", "+p+"); \n"}a+="}",o.sources.push(a);var m=Ee(n);return F.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:m})}function Te(e,t,i){var r=N.shallowClone(e);r.shaderProgram=be(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function xe(e,t,r,o,a){if(!h(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Te(e,t,o):u&&e.receiveShadows&&h(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&h(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;h(t._debugVolume)&&t._debugVolume.destroy();var p,m=n.clone(d.center);if(c.mode!==oe.SCENE3D){m=T.multiplyByPoint(it,m,m);var _=c.mapProjection,g=_.unproject(m);m=_.ellipsoid.cartographicToCartesian(g)}if(h(d.radius)){var C=d.radius;p=y.toWireframe(f.createGeometry(new f({radii:new n(C,C,C),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=d.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;h(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),h(b)&&(o.framebuffer=b),c.commandList=S}}}function Ae(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Pe(e,t,i,r){var n=e.context;x(r,Ae,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function De(e,t){var i=e._debugGlobeDepths[t];return!h(i)&&e.context.depthTexture&&(i=new X,e._debugGlobeDepths[t]=i),i}function Me(e,t){var i=e._pickDepths[t];return h(i)||(i=new ie,e._pickDepths[t]=i),i}function Ie(e,t){var i=e._camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=h(i.frustum.fov)?i.frustum.clone(rt):h(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(nt):i.frustum.clone(ot),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(L.ENVIRONMENT);var a=e._environmentState,s=a.skyBoxCommand;h(s)&&xe(s,e,r,t),a.isSkyAtmosphereVisible&&xe(a.skyAtmosphereCommand,e,r,t);var l=e._useWebVR&&e.mode!==oe.SCENE2D;if(a.isSunVisible&&(a.sunDrawCommand.execute(r,t),e.sunBloom&&!l)){var u;u=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(r,u),t.framebuffer=u}a.isMoonVisible&&a.moonCommand.execute(r,t);var c;a.useOIT?(h(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),c=e._executeOITFunction):c=Pe;for(var d,p=a.clearGlobeDepth,m=a.useDepthPlane,f=e._depthClearCommand,_=e._depthPlane,g=i.position.z,v=e._frustumCommandsList,y=v.length,C=0;C<y;++C){var w=y-C-1,S=v[w];e.mode===oe.SCENE2D?(i.position.z=g-S.near+1,o.far=Math.max(1,S.far-S.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==w?S.near*Ze:S.near,o.far=S.far,n.updateFrustum(o));var E,b=e.debugShowGlobeDepth?De(e,w):e._globeDepth;e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=b.framebuffer),f.execute(r,t),n.updatePass(L.GLOBE);var T=S.commands[L.GLOBE],x=S.indices[L.GLOBE];for(d=0;d<x;++d)xe(T[d],e,r,t);for(h(b)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(b.update(r),b.executeCopyDepth(r,t)),e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),n.updatePass(L.GROUND),T=S.commands[L.GROUND],x=S.indices[L.GROUND],d=0;d<x;++d)xe(T[d],e,r,t);x>0&&r.stencilBuffer&&e._stencilClearCommand.execute(r,t),p&&(f.execute(r,t),m&&_.execute(r,t));for(var A=L.GROUND+1,P=L.TRANSLUCENT,D=A;D<P;++D)for(n.updatePass(D),T=S.commands[D],x=S.indices[D],d=0;d<x;++d)xe(T[d],e,r,t);if(0!==w&&e.mode!==oe.SCENE2D&&(o.near=S.near,n.updateFrustum(o)),n.updatePass(L.TRANSLUCENT),T=S.commands[L.TRANSLUCENT],T.length=S.indices[L.TRANSLUCENT],c(e,xe,t,T),h(b)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var M=Me(e,w);M.update(r,b.framebuffer.depthStencilTexture),M.executeCopyDepth(r,t)}}}function Re(e){var t=e.context.uniformState;t.updatePass(L.COMPUTE);var i=e._environmentState.sunComputeCommand;h(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine)}function Oe(e,t){var i=e.context.uniformState;i.updatePass(L.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function Ne(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(fe(e,u),u.castShadows&&(u.pass===L.GLOBE||u.pass===L.OPAQUE||u.pass===L.TRANSLUCENT)&&we(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var h=!1,d=a-1;d>=0;--d){var p=o[d].cullingVolume;if(we(u,p))o[d].commandList.push(u),h=!0;else if(h)break}}}function Le(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var h=e.frameState.commandList;for(Ne(e,h,s),l=0;l<c;++l){var d=s.passes[l];o.updateCamera(d.camera),s.updatePass(n,l);for(var p=d.commandList.length,m=0;m<p;++m){var f=d.commandList[m];o.updatePass(f.pass),xe(f.derivedCommands.shadows.castCommands[a],e,n,d.passState)}}}}}function Be(e,t,i,r){var o=e._context,a=t.viewport,s=e._frameState,l=s.camera,u=s.mode;if(e._useWebVR&&u!==oe.SCENE2D){Ue(e),Se(e),Ge(e,t,i,r),Re(e),Le(e),a.x=0,a.y=0,a.width=.5*o.drawingBufferWidth,a.height=o.drawingBufferHeight;var c=k.clone(l,e._cameraVR),h=l.frustum.near,d=5*h,p=d/30,m=n.multiplyByScalar(c.right,.5*p,pt);l.frustum.aspectRatio=a.width/a.height;var f=.5*p*h/d;n.add(c.position,m,l.position),l.frustum.xOffset=f,Ie(e,t),a.x=t.viewport.width,n.subtract(c.position,m,l.position),l.frustum.xOffset=-f,Ie(e,t),k.clone(c,l)}else a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight,u!==oe.SCENE2D||e._mapMode2D===Z.ROTATE?Ve(!0,e,t,i,r):Fe(e,t,i,r)}function Fe(e,t,i,r){var o=e.context,a=e.frameState,s=e.camera,l=t.viewport,u=at,c=st,h=e.mapProjection;h.project(u,c);var d=n.clone(s.position,lt),p=T.clone(s.transform,ct),m=s.frustum.clone();s._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(l,0,1,ut),_=s.frustum.projectionMatrix,g=s.positionWC.y,v=n.fromElements(b.sign(g)*c.x-g,0,-s.positionWC.x,ht),y=D.pointToGLWindowCoordinates(_,f,v,dt);y.x=Math.floor(y.x);var C=l.x,w=l.width;if(0===g||y.x<=0||y.x>=o.drawingBufferWidth)Ve(!0,e,t,i,r);else if(Math.abs(.5*o.drawingBufferWidth-y.x)<1)l.width=y.x,s.position.x*=b.sign(s.position.x),s.frustum.right=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=l.width,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r);else if(y.x>.5*o.drawingBufferWidth){l.width=y.x;var S=s.frustum.right;s.frustum.right=c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x+=y.x,l.width=o.drawingBufferWidth-y.x,s.position.x=-s.position.x,s.frustum.left=-s.frustum.right,s.frustum.right=S-2*s.frustum.right,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}else{l.x=y.x,l.width=o.drawingBufferWidth-y.x;var E=s.frustum.left;s.frustum.left=-c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=0,l.width=y.x,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=E-2*s.frustum.left,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}s._setTransform(p),n.clone(d,s.position),s.frustum=m.clone(),l.x=C,l.width=w}function Ve(e,t,i,r,n){e||(t.frameState.commandList.length=0),Ue(t),Se(t),e&&(Ge(t,i,r,n),Re(t),Le(t)),Ie(t,i)}function ke(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&h(e.skyBox)?e.skyBox.update(t):void 0;var n=e.skyAtmosphere,o=e.globe;h(n)&&h(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=r&&h(n)?n.update(t):void 0;var a=r&&h(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=h(a)?a.drawCommand:void 0,i.sunComputeCommand=h(a)?a.computeCommand:void 0,i.moonCommand=r&&h(e.moon)?e.moon.update(t):void 0;var s=i.clearGlobeDepth=h(o)&&(!o.depthTestAgainstTerrain||e.mode===oe.SCENE2D),l=i.useDepthPlane=s&&e.mode===oe.SCENE3D;l&&e._depthPlane.update(t)}function ze(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===oe.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ue(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),ze(e),e._globe&&e._globe.update(t)}function Ge(e,t,i,r){var n=e._context,o=e._environmentState,a=e._useWebVR&&e.mode!==oe.SCENE2D;o.originalFramebuffer=t.framebuffer,h(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!a?e._sunPostProcess=new ce:h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!h(e.sun)&&h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var l=e._clearColorCommand;s.clone(i,l.color),l.execute(n,t);var u=o.useGlobeDepthFramebuffer=!r&&h(e._globeDepth);u&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var c=!1,d=e._frustumCommandsList,p=d.length,m=0;m<p;++m)if(d[m].indices[L.TRANSLUCENT]>0){c=!0;break}var f=o.useOIT=!r&&c&&h(e._oit)&&e._oit.isSupported();f&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var _=o.useFXAA=!r&&e.fxaa;_&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!a?t.framebuffer=e._sunPostProcess.update(t):u?t.framebuffer=e._globeDepth.framebuffer:_&&(t.framebuffer=e._fxaa.getColorFramebuffer()),h(t.framebuffer)&&l.execute(n,t)}function We(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=De(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Me(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function He(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function qe(e,t){h(t)||(t=E.now());var i=e._camera;me(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),k.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);ve(e,l,t),a.passes.render=!0,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var u=e.shadowMap;h(u)&&u.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var d=e._passState;if(d.framebuffer=void 0,d.blendingEnabled=void 0,d.scissorTest=void 0,h(e.globe)&&e.globe.beginFrame(a),ke(e),Be(e,d,c(e.backgroundColor,s.BLACK)),We(e,d),Oe(e,d),h(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!h(e._performanceDisplay)){var p=document.createElement("div");p.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(p);var f=new J({container:p});e._performanceDisplay=f,e._performanceContainer=p}e._performanceDisplay.update()}else h(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),He(a),e._postRender.raiseEvent(e,t)}function je(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,vt);o._setTransform(T.IDENTITY);var h=n.clone(o.position,ft);n.multiplyByScalar(o.right,l,_t),n.add(_t,h,h),n.multiplyByScalar(o.up,u,_t),n.add(_t,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,gt),p=mt;return p.right=.5*d.x,p.left=-p.right,p.top=.5*d.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(h,o.directionWC,o.upWC)}function Ye(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,p=h*a*s,m=o.getPixelDimensions(u.width,u.height,1,gt),f=m.x*i*.5,_=m.y*r*.5,g=yt;return g.top=p+_,g.bottom=p-_,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Xe(e,t,i,r){return e._mode===oe.SCENE2D?je(e,t,i,r):Ye(e,t,i,r)}var Ze=.99;d(de.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return O.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return O.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return h(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new k(this),h(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new W(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}}});var Ke,Qe=new n,Je=new n,$e=new t,et=new U,tt=new S,it=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);it=T.inverseTransformation(it,it);var rt=new ee,nt=new te,ot=new Q,at=new a(Math.PI,b.PI_OVER_TWO),st=new n,lt=new n,ut=new T,ct=new T,ht=new n,dt=new n;de.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),h(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var pt=new n;de.prototype.render=function(e){try{qe(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},de.prototype.clampLineWidth=function(e){return Math.max(O.minimumAliasedLineWidth,Math.min(e,O.maximumAliasedLineWidth))};var mt=new Q,ft=new n,_t=new n,gt=new r,vt=new T,yt=new te,Ct=3,wt=3,St=new e(0,0,Ct,wt),Et=new s(0,0,0,0),bt=new r;de.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ae.transformWindowToDrawingBuffer(this,e,bt);h(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),ve(this,r.frameNumber,r.time),r.cullingVolume=Xe(this,n,Ct,wt),r.passes.pick=!0,i.update(r),St.x=n.x-.5*(Ct-1),St.y=this.drawingBufferHeight-n.y-.5*(wt-1);var o=this._pickFramebuffer.begin(St);Be(this,o,Et,!0),We(this,o);var a=this._pickFramebuffer.end(St);return t.endFrame(),He(r),a};var Tt=new o,xt=new o(1,1/255,1/65025,1/16581375);return de.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ae.transformWindowToDrawingBuffer(this,e,bt);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;h(s.frustum.fov)?a=s.frustum.clone(rt):h(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(nt));for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Me(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(d,0,Tt);o.divideByScalar(p,255,p);var m=o.dot(p,xt);if(m>0&&m<1){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ze:1),a.far=f.far,r.updateFrustum(a),ae.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},de.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];h(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);h(s)&&h(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&h(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),h(r)&&h(r.show)&&(u=!0,r.show=P.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=P.toValue(!0,r.show);return n},de.prototype.completeMorph=function(){this._transitioner.completeMorph()},de.prototype.morphTo2D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},de.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},de.prototype.morphTo3D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(), this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),h(this._globeDepth)&&this._globeDepth.destroy(),h(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),h(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},de}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function d(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){h(s(v),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var v=m;i(f)&&(v=f.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new d({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show&&(t.mode===w.SCENE3D||t.mode===w.MORPHING)&&t.passes.render){var i=this._command;if(!r(i.vertexArray)){var n=t.context,o=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));i.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:l.createAttributeLocations(o),bufferUsage:h.STATIC_DRAW}),i.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var a=new f({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g}),a=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g})}var u=E(this);if(u&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var d=t.context,S=new f({defines:["SKY_FROM_SPACE"],sources:[v]}),b=new f({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b}),S=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b})}var T=t.camera.positionWC,x=e.magnitude(T);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=u?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=u?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},S}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:d.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,D=new t,M=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,d=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:d,width:O,height:O,pixelFormat:h.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new f({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=p.createVertexBuffer({context:d,typedArray:V,usage:m.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:d,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:m.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:d,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:d,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=d.uniformState.sunPositionWC,W=d.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,_===T.SCENE3D?e.clone(H,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=d.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToDrawingBufferCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToDrawingBufferCoordinates(a.viewport,J,D);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r){function n(e,t){i(f[e])||(f[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),_=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(_,f);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,w=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function m(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),p}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new d({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=m.resolve(!0);var n=this._tilingScheme.positionToTileXY(h.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(h.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,h=r(l)?l[a]:a.toString(),d=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",d[(n+o+a)%d.length]);else{var m=new p(t._url),f=c(i(m.query,""));f=e(v,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,m.query=u(f),s=m.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return f.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,n=t.navigator,o=t.jQuery,a=t.JSON;!function(e){"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(i,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=f.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=f.a.setTimeout(e,t)}}function h(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function d(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function m(e,t,i,r){f.d[e]={init:function(e,n,o,a,s){var l,u;return f.m(function(){var o=f.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&f.va.Aa()&&(u=f.a.ua(f.f.childNodes(e),!0)),a?(c||f.f.da(e,f.a.ua(u)),f.eb(r?r(s,o):s,e)):f.f.xa(e),l=a)},null,{ i:e}),{controlsDescendantBindings:!0}}},f.h.ta[e]=!1,f.f.Z[e]=!0}var f="undefined"!=typeof i?i:{};f.b=function(e,t){for(var i=e.split("."),r=f,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},f.G=function(e,t,i){e[t]=i},f.version="3.4.0",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1},f.a=function(){function i(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];f.a.q(i.match(g),function(e){f.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,h="function"==typeof Symbol,d={},p={};d[n&&/Firefox\/2/i.test(n.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),i(d,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var m={propertychange:!0},_=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=f.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>f.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},pa:function(e,t,i){var r=f.a.o(f.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:i,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)f.removeNode(e.firstChild)},jc:function(e){e=f.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(f.$(e[i]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?f.$(o):o)}return n},da:function(e,t){if(f.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)f.removeNode(i[o])}},za:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return f.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!f.a.Sb(e,f.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return f.onError?function(){try{return e.apply(this,arguments)}catch(e){throw f.onError&&f.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(f.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw f.onError&&f.onError(e),e},0)},p:function(e,t,i){var r=f.a.Wb(i);if(i=_&&m[t],f.options.useOnlyNativeEvents||i||!o)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,n),f.a.F.oa(e,function(){e.detachEvent(a,n)})}else e.addEventListener(t,r,!1);else o(e).bind(t,r)},Da:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var n;if("input"===f.a.A(e)&&e.type&&"click"==i.toLowerCase()?(n=e.type,n="checkbox"==n||"radio"==n):n=!1,f.options.useOnlyNativeEvents||!o||n)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");n=r.createEvent(p[i]||"HTMLEvents"),n.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(n)}else if(n&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else o(e).trigger(i)},c:function(e){return f.H(e)?e():e},zb:function(e){return f.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],f.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=f.a.c(i);null!==r&&r!==e||(r="");var n=f.f.firstChild(t);!n||3!=n.nodeType||f.f.nextSibling(n)?f.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,f.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=f.a.c(e),t=f.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return h?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=f.a.V(e.getElementsByTagName("input")).concat(f.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=f.a.$a(e))?a&&a.parse?a.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!a||!a.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return a.stringify(f.a.c(e),t,i)},fd:function(e,t,n){n=n||{};var o=n.params||{},a=n.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===f.a.A(e))for(var s=e.action,l=a.length-1;0<=l;l--)for(var u=f.a.ec(e,a[l]),c=u.length-1;0<=c;c--)o[u[c].name]=u[c].value;t=f.a.c(t);var h=r.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var d in t)e=r.createElement("input"),e.type="hidden",e.name=d,e.value=f.a.Eb(f.a.c(t[d])),h.appendChild(e);i(o,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),r.body.appendChild(h),n.submitter?n.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.q),f.b("utils.arrayFirst",f.a.Sb),f.b("utils.arrayFilter",f.a.Ka),f.b("utils.arrayGetDistinctValues",f.a.Tb),f.b("utils.arrayIndexOf",f.a.o),f.b("utils.arrayMap",f.a.fb),f.b("utils.arrayPushAll",f.a.ra),f.b("utils.arrayRemoveItem",f.a.La),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.cc),f.b("utils.getFormFields",f.a.ec),f.b("utils.peekObservable",f.a.zb),f.b("utils.postJson",f.a.fd),f.b("utils.parseJson",f.a.ed),f.b("utils.registerEventHandler",f.a.p),f.b("utils.stringifyJson",f.a.Eb),f.b("utils.range",f.a.hd),f.b("utils.toggleDomNodeCssClass",f.a.bb),f.b("utils.triggerEvent",f.a.Da),f.b("utils.unwrapObservable",f.a.c),f.b("utils.objectForEach",f.a.D),f.b("utils.addOrRemoveItem",f.a.pa),f.b("utils.setTextContent",f.a.Za),f.b("unwrap",f.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),f.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},f.b("utils.domData",f.a.e),f.b("utils.domData.clear",f.a.e.clear),f.a.F=new function(){function t(t,i){var n=f.a.e.get(t,r);return n===e&&i&&(n=[],f.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(f.a.e.clear(e),f.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=f.a.e.I(),n={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(f.a.La(o,n),0==o.length&&f.a.e.set(i,r,e))},$:function(e){if(n[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];f.a.ra(t,e.getElementsByTagName("*"));for(var r=0,o=t.length;r<o;r++)i(t[r])}return e},removeNode:function(e){f.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){o&&"function"==typeof o.cleanData&&o.cleanData([e])}}},f.$=f.a.F.$,f.removeNode=f.a.F.removeNode,f.b("cleanNode",f.$),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.F),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.F.oa),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.F.pc),function(){var i=[0,"",""],n=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:n,tbody:n,tfoot:n,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=f.a.C;f.a.ma=function(e,n){var a;if(o){if(o.parseHTML)a=o.parseHTML(e,n)||[];else if((a=o.clean([e],n))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=n)||(a=r);var c,s=a.parentWindow||a.defaultView||t,h=f.a.$a(e).toLowerCase(),d=a.createElement("div");for(c=(h=h.match(/^<([a-z]+)[ >]/))&&l[h[1]]||i,h=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?d.appendChild(s.innerShiv(c)):(u&&a.appendChild(d),d.innerHTML=c,u&&d.parentNode.removeChild(d));h--;)d=d.lastChild;a=f.a.V(d.lastChild.childNodes)}return a},f.a.Cb=function(t,i){if(f.a.ob(t),i=f.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),o)o(t).html(i);else for(var r=f.a.ma(i,t.ownerDocument),n=0;n<r.length;n++)t.appendChild(r[n])}}(),f.b("utils.parseHtmlFragment",f.a.ma),f.b("utils.setHtml",f.a.Cb),f.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=f.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&f.a.ra(s,i),f.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),f.b("memoization",f.M),f.b("memoization.memoize",f.M.wb),f.b("memoization.unmemoize",f.M.xc),f.b("memoization.parseMemoText",f.M.lc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.M.yc),f.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,f.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){f.a.$b(e)}}}function i(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=r.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):r&&"onreadystatechange"in r.createElement("script")?function(e){var t=r.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,r.documentElement.removeChild(t),t=null,e()},r.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||f.Y.scheduler(i),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),f.b("tasks",f.Y),f.b("tasks.schedule",f.Y.Wa),f.b("tasks.runEarly",f.Y.md),f.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return f.B({read:e,write:function(r){clearTimeout(i),i=f.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){f.Y.cancel(r),r=f.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.ya),f.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,f.G(this,"dispose",this.k)},f.vc.prototype.k=function(){this.R=!0,this.Kc()},f.J=function(){f.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new f.vc(r,t?e.bind(t):e,function(){f.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{f.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{f.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=f.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=h);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return f.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&f.a.D(e,function(e,i){var r=f.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};f.G(v,"subscribe",v.X),f.G(v,"extend",v.extend),f.G(v,"getSubscriptionsCount",v.Sc),f.a.ka&&f.a.Xa(v,Function.prototype),f.J.fn=v,f.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},f.b("subscribable",f.J),f.b("isSubscribable",f.hc),f.va=f.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!f.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),f.b("computedContext",f.va),f.b("computedContext.getDependenciesCount",f.va.Aa),f.b("computedContext.isInitial",f.va.Sa),f.b("ignoreDependencies",f.qd=f.l.w);var y=f.a.Yb("_latestValue");f.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(f.l.oc(t),t[y])}return t[y]=e,f.a.ka||f.a.extend(t,f.J.fn),f.J.fn.rb(t),f.a.Ya(t,C),f.options.deferUpdates&&f.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};f.a.ka&&f.a.Xa(C,f.J.fn);var w=f.N.gd="__ko_proto__";C[w]=f.N,f.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||f.Oa(t[w],i))},f.H=function(e){return f.Oa(e,f.N)},f.Ba=function(e){return!!("function"==typeof e&&e[w]===f.N||"function"==typeof e&&e[w]===f.B&&e.Vc)},f.b("observable",f.N),f.b("isObservable",f.H),f.b("isWriteableObservable",f.Ba),f.b("isWritableObservable",f.Ba),f.b("observable.fn",C),f.G(C,"peek",C.t),f.G(C,"valueHasMutated",C.fa),f.G(C,"valueWillMutate",C.ga),f.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=f.N(e),f.a.Ya(e,f.la.fn),e.extend({trackArrayChanges:!0})},f.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||f.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=f.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||f.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=f.a.o(t,e)}):[]},indexOf:function(e){var t=this();return f.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},f.a.ka&&f.a.Xa(f.la.fn,f.N.fn),f.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){f.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),f.a.q(["slice"],function(e){f.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),f.b("observableArray",f.la),f.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=f.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&f.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],d=[],p=2;t<c;++t,++p)t<l&&d.push(r("deleted",e[t],t)),t<u&&h.push(r("added",i[p],t));f.a.dc(d,h);break;default:return}o=s}}}};var S=f.a.Yb("_state");f.m=f.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.pb,arguments),this}return f.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,f.a.ka||f.a.extend(n,f.J.fn),f.J.fn.rb(n),f.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,f.a.extend(n,b)):r.deferEvaluation&&f.a.extend(n,T),f.options.deferUpdates&&f.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&f.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=f.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!f.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};f.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{f.l.end(),t.lb&&!e.s&&f.a.D(t.Ma,d),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){f.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&f.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&f.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];f.a.D(i.r,function(e,t){r[t.Ga]=e}),f.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(f.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),f.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};f.a.ka&&f.a.Xa(E,f.J.fn);var x=f.N.gd;f.m[x]=f.N,E[x]=f.m,f.Xc=function(e){return f.Oa(e,f.m)},f.Yc=function(e){return f.Oa(e,f.m)&&e[S]&&e[S].Va},f.b("computed",f.m),f.b("dependentObservable",f.m),f.b("isComputed",f.Xc),f.b("isPureComputed",f.Yc),f.b("computed.fn",E),f.G(E,"peek",E.t),f.G(E,"dispose",E.k),f.G(E,"isActive",E.ba),f.G(E,"getDependenciesCount",E.Aa),f.nc=function(e,t){return"function"==typeof e?f.m(e,t,{pure:!0}):(e=f.a.extend({},e),e.pure=!0,f.m(e,t))},f.b("pureComputed",f.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.Ib=[]}f.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;f.H(e)&&10>t;t++)e=e();return e})},f.toJSON=function(e,t,i){return e=f.wc(e),f.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=f.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=f.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),f.b("toJS",f.wc),f.b("toJSON",f.toJSON),function(){f.j={u:function(t){switch(f.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?f.a.e.get(t,f.d.options.xb):7>=f.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(f.a.A(t)){case"option":switch(typeof i){case"string":f.a.e.set(t,f.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:f.a.e.set(t,f.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=f.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),f.b("selectExtensions",f.j),f.b("selectExtensions.readValue",f.j.u),f.b("selectExtensions.writeValue",f.j.ha),f.h=function(){function e(e){e=f.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===h){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===h&&c&&1<u.length?(h=a[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===h||123===h||91===h?++l:41===h||125===h||93===h?--l:t||s.length||34!==h&&39!==h||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var h=f.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=f.a.o(t,n)?n=!1:(h=n.match(i),n=null!==h&&(h[1]?"Object("+h[1]+")"+h[2]:n)),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return f.a.q(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&f.H(e)?!f.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),f.b("expressionRewriting",f.h),f.b("expressionRewriting.bindingRewriteValidators",f.h.ta),f.b("expressionRewriting.parseObjectLiteral",f.h.yb),f.b("expressionRewriting.preProcessBindings",f.h.Ua),f.b("expressionRewriting._twoWayBindings",f.h.ea),f.b("jsonExpressionRewriting",f.h),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"<!--test-->"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};f.f={Z:{},childNodes:function(t){return e(t)?i(t):t.childNodes},xa:function(t){if(e(t)){t=f.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)f.removeNode(t[i])}else f.a.ob(t)},da:function(t,i){if(e(t)){f.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else f.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):f.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[f.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),f.b("virtualElements",f.f),f.b("virtualElements.allowedBindings",f.f.Z),f.b("virtualElements.emptyNode",f.f.xa),f.b("virtualElements.insertAfter",f.f.gc),f.b("virtualElements.prepend",f.f.mc),f.b("virtualElements.setDomNodeChildren",f.f.da),function(){f.Q=function(){this.Fc={}},f.a.extend(f.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||f.g.getComponentNameForNode(e);case 8:return f.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return f.g.Ob(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return f.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return f.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+f.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),f.Q.instance=new f.Q}(),f.b("bindingProvider",f.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function n(e){return f.a.Ca(f.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?n(e.bind(null,t,r)):f.a.Ca(e,i)}function s(e,t){return n(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=f.f.firstChild(t),o=f.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=f.f.nextSibling(r),a.call(o,r);n=f.f.firstChild(t)}for(;r=n;)n=f.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&f.f.kc(t),(n&&i||f.Q.instance.nodeHasBindings(t))&&(r=h(t,null,e,i).shouldBindDescendants),r&&!p[f.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return f.a.D(e,function n(o){if(!i[o]){var a=f.getBindingHandler(o);a&&(a.after&&(r.push(o),f.a.q(a.after,function(t){if(e[t]){if(-1!==f.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function h(t,i,n,o){var a=f.a.e.get(t,m);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");f.a.e.set(t,m,!0)}!a&&o&&f.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=f.Q.instance,h=u.getBindingAccessors||s,d=f.B(function(){return(l=i?i(n,t):h.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&d.ba()||(d=null)}var p;if(l){var _=d?function(e){return function(){return r(d()[e])}}:function(e){return l[e]},g=function(){return f.a.Ca(d?d():l,r)};g.get=function(e){return l[e]&&r(_(e)); },g.has=function(e){return e in l},o=c(l),f.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!f.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&f.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&f.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function d(e){return e&&e instanceof f.U?e:new f.U(e)}f.d={};var p={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(e){return f.d[e]},f.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!f.H(t),l=f.B(function(){var e=s?t():t,o=f.a.c(e);return i?(i.P&&i.P(),f.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=f),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!f.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),f.a.F.oa(t,function(t){f.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},f.U.prototype.createChildContext=function(e,t,i){return new f.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},f.U.prototype.extend=function(e){return new f.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,f.a.extend(t,"function"==typeof e?e():e)})};var m=f.a.e.I(),_=f.a.e.I();f.tc=function(e,t){return 2!=arguments.length?f.a.e.get(e,_):(f.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},f.Ja=function(e,t,i){return 1===e.nodeType&&f.f.kc(e),h(e,t,d(i),!0)},f.Dc=function(e,t,i){return i=d(i),f.Ja(e,a(t,i,e),i)},f.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t,!0)},f.Rb=function(e,i){if(!o&&t.jQuery&&(o=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(d(e),i,!0)},f.kb=function(t){switch(t.nodeType){case 1:case 8:var i=f.tc(t);if(i)return i;if(t.parentNode)return f.kb(t.parentNode)}return e},f.Jc=function(t){return(t=f.kb(t))?t.$data:e},f.b("bindingHandlers",f.d),f.b("applyBindings",f.Rb),f.b("applyBindingsToDescendants",f.eb),f.b("applyBindingAccessorsToNode",f.Ja),f.b("applyBindingsToNode",f.Dc),f.b("contextFor",f.kb),f.b("dataFor",f.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new f.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):f.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=f.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};f.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?f.l.w(function(){r(n.definition)}):f.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},f.g.loaders=[],f.b("components",f.g),f.b("components.get",f.g.get),f.b("components.clearCachedDefinition",f.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){f.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){f.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(f.a.A(e)){case"script":return f.a.ma(e.text);case"textarea":return f.a.ma(e.value);case"template":if(o(e.content))return f.a.ua(e.content.childNodes)}return f.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};f.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(f.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},f.g.ub=function(e){return u.hasOwnProperty(e)},f.g.od=function(e){delete u[e],f.g.Xb(e)},f.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(f.a.ma(i));else if(i instanceof Array)a(i);else if(o(i))a(f.a.V(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";f.b("components.register",f.g.register),f.b("components.isRegistered",f.g.ub),f.b("components.unregister",f.g.od),f.b("components.defaultLoader",f.g.Zb),f.g.loaders.push(f.g.Zb),f.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=f.a.Ca(r,function(t){return f.m(t,null,{i:e})}),n=f.a.Ca(r,function(t){var i=t.t();return t.ba()?f.m({read:function(){return f.a.c(t())},write:f.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}f.g.getComponentNameForNode=function(e){var t=f.a.A(e);if(f.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=f.a.C&&e.tagName===t))return t},f.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=f.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new f.Q;9>f.a.C&&(f.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(f.g.register),r.createDocumentFragment=function(e){return function(){var t,i=e(),r=f.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(r.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=f.a.ua(t),f.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;f.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),h=c=null}var c,h,d=f.a.V(f.f.childNodes(n));return f.a.F.oa(n,u),f.m(function(){var a,s,p=f.a.c(o());if("string"==typeof p?a=p:(a=f.a.c(p.name),s=f.a.c(p.params)),!a)throw Error("No component name specified");var m=h=++r;f.g.get(a,function(r){if(h===m){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,d,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=d}),c=o,f.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},f.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};f.d.attr={update:function(t,i){var r=f.a.c(i())||{};f.a.D(r,function(i,r){r=f.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=f.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&f.a.rc(t,n?"":r.toString())})}},function(){f.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!f.va.Sa()&&(!l||e)){var o=f.l.w(i);if(c){var s=h?o.t():o;d!==n?(e&&(f.a.pa(s,n,!0),f.a.pa(s,d,!1)),d=n):f.a.pa(s,n,e),h&&f.Ba(o)&&o(s)}else f.h.Ea(o,r,"checked",n,!0)}}function o(){var e=f.a.c(i());t.checked=c?0<=f.a.o(e,a()):s?e:a()===e}var a=f.nc(function(){return r.has("checkedValue")?f.a.c(r.get("checkedValue")):r.has("value")?f.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&f.a.c(u)instanceof Array,h=!(c&&u.push&&u.splice),d=c?a():e,p=l||c;l&&!t.name&&f.d.uniqueName.init(t,function(){return!0}),f.m(n,null,{i:t}),f.a.p(t,"click",n),f.m(o,null,{i:t}),u=e}}},f.h.ea.checked=!0,f.d.checkedValue={update:function(e,t){e.value=f.a.c(t())}}}(),f.d.css={update:function(e,t){var i=f.a.c(t());null!==i&&"object"==typeof i?f.a.D(i,function(t,i){i=f.a.c(i),f.a.bb(e,t,i)}):(i=f.a.$a(String(i||"")),f.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,f.a.bb(e,i,!0))}},f.d.enable={update:function(e,t){var i=f.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},f.d.disable={update:function(e,t){f.d.enable.update(e,function(){return!f.a.c(t())})}},f.d.event={init:function(e,t,i,r,n){var o=t()||{};f.a.D(o,function(o){"string"==typeof o&&f.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=f.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},f.d.foreach={ic:function(e){return function(){var t=e(),i=f.a.zb(t);return i&&"number"!=typeof i.length?(f.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:f.W.sb}):{foreach:t,templateEngine:f.W.sb}}},init:function(e,t){return f.d.template.init(e,f.d.foreach.ic(t))},update:function(e,t,i,r,n){return f.d.template.update(e,f.d.foreach.ic(t),i,r,n)}},f.h.ta.foreach=!1,f.f.Z.foreach=!0,f.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),f.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);f.a.p(e,"focus",n),f.a.p(e,"focusin",n),f.a.p(e,"blur",o),f.a.p(e,"focusout",o)},update:function(e,t){var i=!!f.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),f.l.w(f.a.Da,null,[e,i?"focusin":"focusout"]))}},f.h.ea.hasfocus=!0,f.d.hasFocus=f.d.hasfocus,f.h.ea.hasFocus=!0,f.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Cb(e,t())}},m("if"),m("ifnot",!1,!0),m("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};f.d.options={init:function(e){if("select"!==f.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return f.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(m&&c)f.j.ha(t,f.a.c(r.get("value")),!0);else if(p.length){var n=0<=f.a.o(p,f.j.u(i[0]));f.a.sc(i[0],n),m&&!n&&f.l.w(f.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=f.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),h=r.get("optionsIncludeDestroyed");i={};var d,p=[];c||(s?p=f.a.fb(n(),f.j.u):0<=t.selectedIndex&&p.push(f.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),d=f.a.Ka(u,function(t){return h||t===e||null===t||!f.a.c(t._destroy)}),r.has("optionsCaption")&&(u=f.a.c(r.get("optionsCaption")),null!==u&&u!==e&&d.unshift(P)));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),f.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),f.a.Bb(t,d,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[f.j.u(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===P?(f.a.Za(n,r.get("optionsCaption")),f.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),f.j.ha(n,f.a.c(a)),i=o(i,r.get("optionsText"),a),f.a.Za(n,i)),[n]},i,u),f.l.w(function(){c?f.j.ha(t,f.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&f.a.Da(t,"change")}),f.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},f.d.options.xb=f.a.e.I(),f.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){f.a.p(e,"change",function(){var r=t(),n=[];f.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(f.j.u(e))}),f.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=f.a.A(e))throw Error("values binding applies only to SELECT elements");var i=f.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&f.a.q(e.getElementsByTagName("option"),function(e){var t=0<=f.a.o(i,f.j.u(e));e.selected!=t&&f.a.sc(e,t)}),e.scrollTop=r}},f.h.ea.selectedOptions=!0,f.d.style={update:function(t,i){var r=f.a.c(i()||{});f.a.D(r,function(i,r){r=f.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},f.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");f.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},f.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Za(e,t())}},f.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>f.a.C)var s=f.a.e.I(),l=f.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&f.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;f.a.e.get(i,s)||(f.a.e.set(i,s,!0),f.a.p(i,"selectionchange",u)),f.a.e.set(e,l,t)};f.d.textInput={init:function(t,i,n){function s(e,i){f.a.p(t,e,i)}function l(){var r=f.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?f.a.setTimeout(l,4):t.value!==r&&(m=r,t.value=r)}function u(){d||(p=t.value,d=f.a.setTimeout(h,4))}function h(){clearTimeout(d),p=d=e;var r=t.value;m!==r&&(m=r,f.h.Ea(i(),n,"textInput",r))}var d,p,m=t.value,_=9==f.a.C?u:h;10>f.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==f.a.C&&(s("keyup",h),s("keydown",h)),8<=f.a.C&&(c(t,_),s("dragend",u))):(s("input",h),5>o&&"textarea"===f.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),f.m(l,null,{i:t})}},f.h.ea.textInput=!0,f.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),f.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++f.d.uniqueName.Ic;f.a.rc(e,i)}}},f.d.uniqueName.Ic=0,f.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),f.a.ra(r,n),r=f.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=f.j.u(e);f.h.Ea(r,i,"value",n)};!f.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=f.a.o(r,"propertychange")||(f.a.p(e,"propertychange",function(){o=!0}),f.a.p(e,"focus",function(){o=!1}),f.a.p(e,"blur",function(){o&&s()})),f.a.q(r,function(t){var i=s;f.a.nd(t,"after")&&(i=function(){a=f.j.u(e),f.a.setTimeout(s,0)},t=t.substring(5)),f.a.p(e,t,i)});var l=function(){var r=f.a.c(t()),n=f.j.u(e);if(null!==a&&r===a)f.a.setTimeout(l,0);else if(r!==n)if("select"===f.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){f.j.ha(e,r,o)};n(),o||r===f.j.u(e)?f.a.setTimeout(n,0):f.l.w(f.a.Da,null,[e,"change"])}else f.j.ha(e,r)};f.m(l,null,{i:e})}else f.Ja(e,{checkedValue:t})},update:function(){}},f.h.ea.value=!0,f.d.visible={update:function(e,t){var i=f.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){f.d[e]={init:function(t,i,r,n,o){return f.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),f.O=function(){},f.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new f.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new f.v.qa(e);throw Error("Unknown template type: "+e)},f.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},f.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},f.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},f.b("templateEngine",f.O),f.Gb=function(){function e(e,t,i,r){e=f.h.yb(e);for(var n=f.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.h.Ua(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return f.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return f.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&f.Ja(n,e,r)})}}}(),f.b("__tr_ambtns",f.Gb.Ec),function(){f.v={},f.v.n=function(e){if(this.n=e){var t=f.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},f.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?f.a.Cb(this.n,t):this.n[e]=t};var t=f.a.e.I()+"_";f.v.n.prototype.data=function(e){return 1===arguments.length?f.a.e.get(this.n,t+e):void f.a.e.set(this.n,t+e,arguments[1])};var i=f.a.e.I();f.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(f.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void f.a.e.set(t,i,{jb:arguments[0]})},f.v.qa=function(e){this.n=e},f.v.qa.prototype=new f.v.n,f.v.qa.prototype.text=function(){if(0==arguments.length){var t=f.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}f.a.e.set(this.n,i,{Hb:arguments[0]})},f.b("templateSources",f.v),f.b("templateSources.domElement",f.v.n),f.b("templateSources.anonymousTemplate",f.v.qa)}(),function(){function t(e,t,i){var r;for(t=f.f.nextSibling(t);e&&(r=e)!==t;)e=f.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=f.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),f.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.M.yc(e,[i])}),f.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(f.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":f.f.da(e,n),l=!0;break;case"replaceNode":f.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&f.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return f.H(e)?e():"function"==typeof e?e(t,i):e}var a;f.Db=function(t){if(t!=e&&!(t instanceof f.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},f.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return f.B(function(){var e=i&&i instanceof f.U?i:new f.U(f.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!f.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return f.M.wb(function(e){f.Ab(t,i,s,e,"replaceNode")})},f.kd=function(t,r,a,s,l){function u(e,t){i(t,h),a.afterRender&&a.afterRender(t,e),h=null}function c(e,i){h=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,h);return n(null,"ignoreTargetNode",r,h,a)}var h;return f.B(function(){var t=f.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=f.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!f.a.c(t._destroy)}),f.l.w(f.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=f.a.e.I();f.d.template={init:function(e,t){var i=f.a.c(t());if("string"==typeof i||i.name)f.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],f.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=f.f.childNodes(e);i=f.a.jc(i),new f.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=f.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=f.a.c(i.if)),r&&"ifnot"in i&&(r=!f.a.c(i.ifnot)),a=f.a.c(i.data)),"foreach"in i?n=f.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=f.Ab(l||t,o,i,t)):f.f.xa(t),o=n,(a=f.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),f.a.e.set(t,s,o&&o.ba()?o:e)}},f.h.ta.template=function(e){return e=f.h.yb(e),1==e.length&&e[0].unknown||f.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.f.Z.template=!0}(),f.b("setTemplateEngine",f.Db),f.b("renderTemplate",f.Ab),f.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},f.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,d=[],p=e.length,m=t.length,_=m-p||1,g=p+m+1;for(o=0;o<=p;o++)for(l=s,d.push(s=[]),u=c(m,o+_),a=h(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],_=[],o=p,a=m;o||a;)m=d[o][a]-1,a&&m===d[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&m===d[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return f.a.dc(_,h,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),f.b("utils.compareArrays",f.a.ib),function(){function t(t,i,r,n,o){var a=[],s=f.B(function(){var e=i(r,o,f.a.za(a,t))||[];0<a.length&&(f.a.qc(a,e),n&&f.l.w(n,null,[r,e,o])),a.length=0,f.a.ra(a,e)},null,{i:t,wa:function(){return!f.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=f.a.e.I(),r=f.a.e.I();f.a.Bb=function(n,o,a,s,l){function u(e,t){w=d[t],v!==t&&(b[e]=w),w.qb(v++),f.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&f.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var h=f.a.e.get(n,i)===e,d=f.a.e.get(n,i)||[],p=f.a.fb(d,function(e){return e.ja}),m=f.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=m[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=d[g],w.B&&(w.B.k(),w.B=e),f.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:f.N(v++)},_.push(w),C.push(w),h||(p[T]=w))}f.a.e.set(n,i,_),c(s.beforeMove,b),f.a.q(y,s.beforeRemove?f.$:f.removeNode);for(var x,T=0,h=f.f.firstChild(n);w=C[T];T++){for(w.ca||f.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;m=w.ca[g];h=m.nextSibling,x=m,g++)m!==h&&f.f.gc(n,m,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.Bb),f.W=function(){this.allowTemplateRewriting=!1},f.W.prototype=new f.O,f.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>f.a.C?0:e.nodes)?e.nodes():null)?f.a.V(t.cloneNode(!0).childNodes):(e=e.text(),f.a.ma(e,r))},f.W.sb=new f.W,f.Db(f.W.sb),f.b("nativeTemplateEngine",f.W),function(){f.vb=function(){var e=this.$c=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,n,a){if(a=a||r,n=n||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=o.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=o.extend({koBindingContext:i},n.templateOptions),i=o.tmpl(s,t,i),i.appendTo(a.createElement("div")),o.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.vb.prototype=new f.O;var e=new f.vb;0<e.$c&&f.Db(e),f.b("jqueryTmplTemplateEngine",f.vb)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){ "use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,p=180*Math.atan2(d,h)/Math.PI+90;p>180&&(p-=360);var m=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<m?i.slower():p>m&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){m(x,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(v,"g");this._topG=h,this._realtimeSVG=new f(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(T),h.appendChild(w),h.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(h),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,w)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,w)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,w)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,b)},{tagName:"stop",offset:"75%","stop-color":h(n,T)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,x)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,x)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},_}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t){return e-t}function d(t,i){var r=e(i,t,h);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function m(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function f(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=f.defaultDateFormatter,this._timeFormatter=f.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(f.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return m(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[d(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var h=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(h,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return f.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},f.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],f.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},f.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},f.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(h);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(f.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),f._maxShuttleRingAngle=v,f._realtimeShuttleRingAngle=g,f}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),d.appendChild(m);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1); },n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function m(t,i){function r(t){_.removeInputAction(a.LEFT_CLICK),m.pickPrimitiveActive=!1;var i=m._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(m.primitive=e(i.collection)?i.collection:i.primitive)}function d(t){var i,r=g.ellipsoid,o=m._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var s=r.cartesianToCartographic(o),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(e(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];n.contains(d.rectangle,s)&&(i=d)}}m.tile=i,_.removeInputAction(a.LEFT_CLICK),m.pickTileActive=!1}var m=this,f=t.canvas,_=new o(f);this._eventHandler=_,this._scene=t,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.depthFrustumText="1 of 1",this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",c.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=h(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=h(function(){m.generalVisible=!m.generalVisible,m.generalSwitchText=m.generalVisible?"-":"+"}),this._togglePrimitives=h(function(){m.primitivesVisible=!m.primitivesVisible,m.primitivesSwitchText=m.primitivesVisible?"-":"+"}),this._toggleTerrain=h(function(){m.terrainVisible=!m.terrainVisible,m.terrainSwitchText=m.terrainVisible?"-":"+"}),this._showFrustums=h(function(){return m.frustums?m._scene.debugShowFrustums=!0:m._scene.debugShowFrustums=!1,!0}),this._showPerformance=h(function(){return m.performance?m._performanceDisplay=new l({container:m._performanceContainer}):m._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=h(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=h(function(){if(m.primitiveReferenceFrame){var t=m._primitive.modelMatrix;m._modelMatrixPrimitive=new s({modelMatrix:t}),m._scene.primitives.add(m._modelMatrixPrimitive)}else e(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=h(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(t){return!(!e(m._modelMatrixPrimitive)||t.owner!==m._modelMatrixPrimitive._primitive)||!!e(m._primitive)&&(t.owner===m._primitive||t.owner===m._primitive._billboardCollection||t.owner.primitive===m._primitive)}:m._scene.debugCommandFilter=void 0,!0}),this._showWireframe=h(function(){return g._surface.tileProvider._debug.wireframe=m.wireframe,!0}),this._showGlobeDepth=h(function(){return m._scene.debugShowGlobeDepth=m.globeDepth,!0}),this._showPickDepth=h(function(){return m._scene.debugShowPickDepth=m.pickDepth,!0}),this._incrementDepthFrustum=h(function(){var e=m.depthFrustum+1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._decrementDepthFrustum=h(function(){var e=m.depthFrustum-1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._doSuspendUpdates=h(function(){return g._surface._debug.suspendLodUpdate=m.suspendUpdates,m.suspendUpdates||(m.filterTile=!1),!0});var v;this._showTileCoordinates=h(function(){return m.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!m.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._showTileBoundingSphere=h(function(){return m.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=m._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=h(function(){return m.filterTile?(m.suspendUpdates=!0,m.doSuspendUpdates(),g._surface._tilesToRender=[],e(m._tile)&&g._surface._tilesToRender.push(m._tile)):(m.suspendUpdates=!1,m.doSuspendUpdates()),!0}),this._pickPrimitive=h(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive,m.pickPrimitiveActive?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)}),this._pickTile=h(function(){m.pickTileActive=!m.pickTileActive,m.pickTileActive?_.setInputAction(d,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(m.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showFrustums:{get:function(){return this._showFrustums}},showPerformance:{get:function(){return this._showPerformance}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},showWireframe:{get:function(){return this._showWireframe}},showGlobeDepth:{get:function(){return this._showGlobeDepth}},showPickDepth:{get:function(){return this._showPickDepth}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},doSuspendUpdates:{get:function(){return this._doSuspendUpdates}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return h(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return h(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return h(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return h(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return h(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;t!==i&&(this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north,this.tileText+="<br>Min: "+t.data.minimumHeight+" Max: "+t.data.maximumHeight),this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=d(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=p(1,t,e.depthFrustum);e.depthFrustum=i,e.scene.debugShowDepthFrustum=i,e.depthFrustumText=i+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._eventHandler.destroy(),i(this)},m}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var h=document.createElement("span");h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(h),c.appendChild(document.createTextNode("General")),u.appendChild(c);var d=document.createElement("div");d.className="cesium-cesiumInspector-section",d.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(d);var p=document.createElement("div");d.appendChild(p);var m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStats",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var f=document.createElement("input");f.type="checkbox",f.setAttribute("data-bind","checked: frustums, click: showFrustums"),p.appendChild(f),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(m);var _=document.createElement("div");d.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(g),_.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(i);var v=document.createElement("div");v.className="cesium-cesiumInspector-shaderCache",v.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(v);var y=document.createElement("div");d.appendChild(y);var C=document.createElement("input");C.type="checkbox",C.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),y.appendChild(C),y.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");y.appendChild(w);var S=document.createElement("div");d.appendChild(S);var E=document.createElement("input");E.type="checkbox",E.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),S.appendChild(E),S.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");d.appendChild(b);var T=document.createElement("span");T.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(T);var x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(x);var A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(A);var P=document.createElement("input");P.type="button",P.value="+",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(P);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(h),D.appendChild(document.createTextNode("Primitives")),u.appendChild(D);var M=document.createElement("div");M.className="cesium-cesiumInspector-section",M.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(M);var I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",M.appendChild(I);var R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var O=document.createElement("div");O.className="cesium-cesiumInspector-center",O.appendChild(R),I.appendChild(O);var N=document.createElement("div");I.appendChild(N);var L=document.createElement("input");L.type="checkbox",L.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),N.appendChild(L),N.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");I.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,I.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show only selected"));var z=document.createElement("div");z.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),z.appendChild(h),z.appendChild(document.createTextNode("Terrain")),u.appendChild(z);var U=document.createElement("div");U.className="cesium-cesiumInspector-section",U.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(U);var G=document.createElement("div");G.className="cesium-cesiumInspector-pickSection",U.appendChild(G);var W=document.createElement("input");W.type="button",W.value="Pick a tile",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),O=document.createElement("div"),O.appendChild(W),O.className="cesium-cesiumInspector-center",G.appendChild(O);var H=document.createElement("div");G.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Parent",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind","click: selectParent");var j=document.createElement("input");j.type="button",j.value="NW",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind","click: selectNW");var Y=document.createElement("input");Y.type="button",Y.value="NE",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectNE");var X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");var Z=document.createElement("input");Z.type="button",Z.value="SE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSE");var K=document.createElement("div");K.className="cesium-cesiumInspector-tileText",H.className="cesium-cesiumInspector-frustumStats",H.appendChild(K),H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),K.setAttribute("data-bind","html: tileText");var Q=document.createElement("div");Q.className="cesium-cesiumInspector-relativeText",Q.textContent="Select relative:",H.appendChild(Q);var J=document.createElement("table"),$=document.createElement("tr"),ee=document.createElement("tr"),te=document.createElement("td");te.appendChild(q);var ie=document.createElement("td");ie.appendChild(j);var re=document.createElement("td");re.appendChild(Y),$.appendChild(te),$.appendChild(ie),$.appendChild(re);var ne=document.createElement("td"),oe=document.createElement("td");oe.appendChild(X);var ae=document.createElement("td");ae.appendChild(Z),ee.appendChild(ne),ee.appendChild(oe),ee.appendChild(ae),J.appendChild($),J.appendChild(ee),H.appendChild(J);var se=document.createElement("div");G.appendChild(se);var le=document.createElement("input");le.type="checkbox",le.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),se.appendChild(le),se.appendChild(document.createTextNode("Show bounding volume"));var ue=document.createElement("div");G.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show only selected"));var he=document.createElement("div");U.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: wireframe, click: showWireframe"),he.appendChild(de),he.appendChild(document.createTextNode("Wireframe"));var pe=document.createElement("div");U.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),pe.appendChild(me),pe.appendChild(document.createTextNode("Suspend LOD update"));var fe=document.createElement("div");U.appendChild(fe);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),fe.appendChild(_e),fe.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(d);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var M=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=M,M.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(M.mapProjection.ellipsoid,u.WGS84),R=M.frameState.creditDisplay,O=new r("Cesium",D,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new f(I)),N!==!1&&(M.globe=N,M.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(M.skyBox=L,M.sun=new S,M.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(M.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new m({url:"https://dev.virtualearth.net"})),F!==!1&&M.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(M.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)), this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var V=this;M.renderError.addEventListener(function(e,t){if(V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";V.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(k,z,e)}throw e}}var D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),u.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(m);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},m.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/loadJsonp","../../Core/Matrix4","../../Core/Rectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(t){this._url=i(t.url,"https://dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key);var n=e.getErrorCredit(t.key);r(n)&&t.scene._frameState.creditDisplay.addDefaultCredit(n),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var o=this;this._searchCommand=d(function(){o.isSearchInProgress?_(o):f(o)}),this.keepExpanded=!1,c.track(this,["_searchText","_isSearchInProgress","keepExpanded"]),this.isSearchInProgress=void 0,c.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,c.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,c.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY})}function f(e){var i=e.searchText;if(!/^\s*$/.test(i)){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(n)&&!isNaN(o)&&!isNaN(a))return void m(e,t.fromDegrees(n,o,a))}e._isSearchInProgress=!0;var l=s(e._url+"REST/v1/Locations",{parameters:{query:i,key:e._key},callbackParameterName:"jsonp"}),c=e._geocodeInProgress=h(l,function(t){if(!c.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return void(e.searchText=e._searchText+" (not found)");var i=t.resourceSets[0];if(0===i.resources.length)return void(e.searchText=e._searchText+" (not found)");var r=i.resources[0];e._searchText=r.name;var n=r.bbox,o=n[0],a=n[1],s=n[2],l=n[3];m(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function _(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(p.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),p}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 }'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r),o.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||l.blur()},this._onInputEnd=function(e){t.contains(e.target)&&l.focus()},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),o.cleanNode(this._form),this._container.removeChild(this._form),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="×",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),m._descriptionSubscription=l(p,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var m=document.createElement("img");m.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),m.className="cesium-navigation-button-icon",m.style.width="25px",m.style.height="25px",p.appendChild(m),p.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",f.appendChild(_),f.appendChild(document.createTextNode("Touch")),d.appendChild(p),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>', d.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',d.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(m);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=v.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=p(this),this._onTouchStart=m(this),this._onTouchMove=_(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function m(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t), this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,p=31536e6,m=1e-10,f=0,_=this._timeBarSecondsSpan;_<d?(_=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=f;f-=m;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(A)});var P=0,D=0,M=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>f)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=f&&(D=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(D,C[N]))<1e-5&&C[N]>=f){M=C[N];break}++N}}f=x,f>m&&M<1e-5&&Math.abs(f-P)>m&&(M=f,f<=P+m&&(D=0));var F,V=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var k=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-k)>.1&&(o+=U-k,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),W=this.makeLabel(z);this._rulerEle.innerHTML=W,F=this._rulerEle.offsetWidth,F<10&&(F=T);var H=G-(F/2-1);H>V?(V=H+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+H.toString()+'px;">'+W+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof _)return o}if(r(e.scene.globe))return H(e,t.position)}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new _({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new _({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new _({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Y(e,t){function n(e){var t=G(l,e);r(t)&&(v.getValueOrUndefined(t.position,l.clock.currentTime)?l.trackedEntity=t:l.zoomTo(t))}function o(e){l.selectedEntity=G(l,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),l=this,u=document.createElement("div");u.className="cesium-viewer",e.appendChild(u);var c=document.createElement("div");c.className="cesium-viewer-cesiumWidgetContainer",u.appendChild(c);var d=document.createElement("div");d.className="cesium-viewer-bottom",u.appendChild(d);var p=i(t.scene3DOnly,!1),_=new P(c,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:d,scene3DOnly:p,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),g=t.dataSources,y=!1;r(g)||(g=new m,y=!0);var C=new f({scene:_.scene,dataSourceCollection:g}),S=_.clock,W=new D(S),H=new s;H.add(S.onTick,Y.prototype._onTick,this),H.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var q;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var X=document.createElement("div");X.className="cesium-viewer-selectionIndicatorContainer",u.appendChild(X),q=new F(X,_.scene)}var Z;if(!r(t.infoBox)||t.infoBox!==!1){var K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",u.appendChild(K),Z=new N(K);var Q=Z.viewModel;H.add(Q.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),H.add(Q.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var J=document.createElement("div");J.className="cesium-viewer-toolbar",u.appendChild(J);var $;if(!r(t.geocoder)||t.geocoder!==!1){var ee=document.createElement("div");ee.className="cesium-viewer-geocoderContainer",J.appendChild(ee),$=new I({container:ee,scene:_.scene}),H.add($.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var te;r(t.homeButton)&&t.homeButton===!1||(te=new O(J,_.scene),r($)&&H.add(te.viewModel.command.afterExecute,function(){var e=$.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),H.add(te.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this));var ie;p||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ie=new B(J,_.scene));var re,ne;if(a){var oe=i(t.imageryProviderViewModels,x()),ae=i(t.terrainProviderViewModels,A());re=new T(J,{globe:_.scene.globe,imageryProviderViewModels:oe,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ae,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var se=J.getElementsByClassName("cesium-baseLayerPicker-dropDown");ne=se[0]}var le;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var ue=!0;try{if(r(window.localStorage)){var ce=window.localStorage.getItem("cesium-hasSeenNavHelp");r(ce)&&Boolean(ce)?ue=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}le=new L({container:J,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,ue)})}var he;if(!r(t.animation)||t.animation!==!1){var de=document.createElement("div");de.className="cesium-viewer-animationContainer",u.appendChild(de),he=new E(de,new b(W))}var pe;if(!r(t.timeline)||t.timeline!==!1){var me=document.createElement("div");me.className="cesium-viewer-timelineContainer",u.appendChild(me),pe=new k(me,S),pe.addEventListener("settime",U,!1),pe.zoomTo(S.startTime,S.stopTime)}var fe,_e;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-fullscreenContainer",u.appendChild(ge),fe=new M(ge,t.fullscreenElement),_e=V(fe.viewModel,"isFullscreenEnabled",function(e){ge.style.display=e?"block":"none",r(pe)&&(pe.container.style.right=ge.clientWidth+"px",pe.resize())})}var ve,ye,Ce;if(t.vrButton){var we=document.createElement("div");we.className="cesium-viewer-vrContainer",u.appendChild(we),ve=new z(we,_.scene,t.fullScreenElement),ye=V(ve.viewModel,"isVREnabled",function(e){we.style.display=e?"block":"none",r(fe)&&(we.style.right=ge.clientWidth+"px"),r(pe)&&(pe.container.style.right=we.clientWidth+"px",pe.resize())}),Ce=V(ve.viewModel,"isVRMode",function(e){j(l,e)})}this._baseLayerPickerDropDown=ne,this._fullscreenSubscription=_e,this._vrSubscription=ye,this._vrModeSubscription=Ce,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=d,this._element=u,this._cesiumWidget=_,this._selectionIndicator=q,this._infoBox=Z,this._dataSourceCollection=g,this._destroyDataSourceCollection=y,this._dataSourceDisplay=C,this._clockViewModel=W,this._toolbar=J,this._homeButton=te,this._sceneModePicker=ie,this._baseLayerPicker=re,this._navigationHelpButton=le,this._animation=he,this._timeline=pe,this._fullscreenButton=fe,this._vrButton=ve,this._geocoder=$,this._eventHelper=H,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Z)||r(q),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,w.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),H.add(g.dataSourceAdded,Y.prototype._onDataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),H.add(_.scene.preRender,Y.prototype.resize,this),H.add(_.scene.postRender,Y.prototype._postRender,this);for(var Se=g.length,Ee=0;Ee<Se;Ee++)this._dataSourceAdded(g,g.get(Ee));this._dataSourceAdded(void 0,C.defaultDataSource),H.add(g.dataSourceAdded,Y.prototype._dataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a){if(t instanceof y)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(l(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),l(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof c){var h={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(h):(a.setView(h),s.resolve(!0)),void Z(t)}for(var p=[],m=0,f=n.length;m<f;m++){var _=t._dataSourceDisplay.getBoundingSphere(n[m],!1,$);if(_===d.PENDING)return;_!==d.FAILED&&p.push(e.clone($))}if(0===p.length)return void K(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(p),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(Z(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(u.IDENTITY),Z(t),s.resolve(!0))}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=v.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==d.PENDING){var s=o.mode;s!==C.COLUMBUS_VIEW&&s!==C.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==C.COLUMBUS_VIEW&&s!==C.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==d.FAILED?$:void 0;e._entityView=new g(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return n(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,i!==C.COLUMBUS_VIEW&&i!==C.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==C.COLUMBUS_VIEW&&i!==C.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(u.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,h=0,d=0,p=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;u=this._animation.container,i>900?(h=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,_=this._vrButton,g=c.container,v=g.style;p=g.clientHeight+3,v.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(_)&&(y+=_.container.clientWidth),v.right=y+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,$);l===d.DONE&&a.update(n,$)}var u,c=!1,h=this.selectedEntity,p=r(h)&&this._enableInfoOrSelection;if(p&&h.isShowing&&h.isAvailable(n)){var m=this._dataSourceDisplay.getBoundingSphere(h,!0,$);m!==d.FAILED?u=$.center:r(h.position)&&(u=h.position.getValue(n,u)),c=r(u)}var f=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(f)&&(f.position=t.clone(u,f.position),f.showSelection=p&&c,f.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=p,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,p?(_.titleText=i(h.name,h.id),_.description=v.getValueOrDefault(h.description,n,"")):(_.titleText="",_.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity); }},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,y,v),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function m(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var h;if(/\.czml$/i.test(c))h=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))h=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);h=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(h)&&e.dataSources.add(h).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le,Be,Fe,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Dt,Mt,It,Rt,Ot,Nt,Lt,Bt,Ft,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Di,Mi,Ii,Ri,Oi,Ni,Li,Bi,Fi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Dr,Mr,Ir,Rr,Or,Nr,Lr,Br,Fr,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Dn,Mn,In,Rn,On,Nn,Ln,Bn,Fn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Do,Mo,Io,Ro,Oo,No,Lo,Bo,Fo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Da,Ma,Ia,Ra,Oa,Na,La,Ba,Fa,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ds,Ms,Is,Rs,Os,Ns,Ls,Bs,Fs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Dl,Ml,Il,Rl,Ol,Nl,Ll,Bl,Fl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Du,Mu,Iu,Ru,Ou,Nu,Lu,Bu,Fu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Dc,Mc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,hh,dh,ph,mh,fh,_h,gh,vh,yh,Ch,wh,Sh,Eh,bh,Th,xh,Ah,Ph,Dh,Mh){"use strict";var Ih={VERSION:"1.29",_shaders:{}};return Ih.appendForwardSlash=e,Ih.ArcGisImageServerTerrainProvider=t,Ih.arrayRemoveDuplicates=i,Ih.AssociativeArray=r,Ih.AttributeCompression=n,Ih.AxisAlignedBoundingBox=o,Ih.barycentricCoordinates=a,Ih.binarySearch=s,Ih.BingMapsApi=l,Ih.BoundingRectangle=u,Ih.BoundingSphere=c,Ih.BoxGeometry=h,Ih.BoxOutlineGeometry=d,Ih.buildModuleUrl=p,Ih.cancelAnimationFrame=m,Ih.Cartesian2=f,Ih.Cartesian3=_,Ih.Cartesian4=g,Ih.Cartographic=v,Ih.CatmullRomSpline=y,Ih.CesiumTerrainProvider=C,Ih.Check=w,Ih.CircleGeometry=S,Ih.CircleOutlineGeometry=E,Ih.Clock=b,Ih.ClockRange=T,Ih.ClockStep=x,Ih.clone=A,Ih.Color=P,Ih.ColorGeometryInstanceAttribute=D,Ih.combine=M,Ih.ComponentDatatype=I,Ih.CornerType=R,Ih.CorridorGeometry=O,Ih.CorridorGeometryLibrary=N,Ih.CorridorOutlineGeometry=L,Ih.createGuid=B,Ih.Credit=F,Ih.CubicRealPolynomial=V,Ih.CylinderGeometry=k,Ih.CylinderGeometryLibrary=z,Ih.CylinderOutlineGeometry=U,Ih.DefaultProxy=G,Ih.defaultValue=W,Ih.defined=H,Ih.defineProperties=q,Ih.deprecationWarning=j,Ih.destroyObject=Y,Ih.DeveloperError=X,Ih.DistanceDisplayCondition=Z,Ih.DistanceDisplayConditionGeometryInstanceAttribute=K,Ih.EarthOrientationParameters=Q,Ih.EarthOrientationParametersSample=J,Ih.EasingFunction=$,Ih.EllipseGeometry=ee,Ih.EllipseGeometryLibrary=te,Ih.EllipseOutlineGeometry=ie,Ih.Ellipsoid=re,Ih.EllipsoidalOccluder=ne,Ih.EllipsoidGeodesic=oe,Ih.EllipsoidGeometry=ae,Ih.EllipsoidOutlineGeometry=se,Ih.EllipsoidTangentPlane=le,Ih.EllipsoidTerrainProvider=ue,Ih.EncodedCartesian3=ce,Ih.Event=he,Ih.EventHelper=de,Ih.ExtrapolationType=pe,Ih.FeatureDetection=me,Ih.formatError=fe,Ih.freezeObject=_e,Ih.Fullscreen=ge,Ih.GeographicProjection=ve,Ih.GeographicTilingScheme=ye,Ih.Geometry=Ce,Ih.GeometryAttribute=we,Ih.GeometryAttributes=Se,Ih.GeometryInstance=Ee,Ih.GeometryInstanceAttribute=be,Ih.GeometryPipeline=Te,Ih.GeometryType=xe,Ih.getAbsoluteUri=Ae,Ih.getBaseUri=Pe,Ih.getExtensionFromUri=De,Ih.getFilenameFromUri=Me,Ih.getImagePixels=Ie,Ih.getMagic=Re,Ih.getStringFromTypedArray=Oe,Ih.getTimestamp=Ne,Ih.GregorianDate=Le,Ih.HeadingPitchRange=Be,Ih.HeadingPitchRoll=Fe,Ih.HeightmapTerrainData=Ve,Ih.HeightmapTessellator=ke,Ih.HermitePolynomialApproximation=ze,Ih.HermiteSpline=Ue,Ih.Iau2000Orientation=Ge,Ih.Iau2006XysData=We,Ih.Iau2006XysSample=He,Ih.IauOrientationAxes=qe,Ih.IauOrientationParameters=je,Ih.IndexDatatype=Ye,Ih.InterpolationAlgorithm=Xe,Ih.Intersect=Ze,Ih.Intersections2D=Ke,Ih.IntersectionTests=Qe,Ih.Interval=Je,Ih.isArray=$e,Ih.isCrossOriginUrl=et,Ih.isLeapYear=tt,Ih.Iso8601=it,Ih.joinUrls=rt,Ih.JulianDate=nt,Ih.KeyboardEventModifier=ot,Ih.LagrangePolynomialApproximation=at,Ih.LeapSecond=st,Ih.LinearApproximation=lt,Ih.LinearSpline=ut,Ih.loadArrayBuffer=ct,Ih.loadBlob=ht,Ih.loadImage=dt,Ih.loadImageFromTypedArray=pt,Ih.loadImageViaBlob=mt,Ih.loadJson=ft,Ih.loadJsonp=_t,Ih.loadText=gt,Ih.loadWithXhr=vt,Ih.loadXML=yt,Ih.MapboxApi=Ct,Ih.MapProjection=wt,Ih.Math=St,Ih.Matrix2=Et,Ih.Matrix3=bt,Ih.Matrix4=Tt,Ih.mergeSort=xt,Ih.NearFarScalar=At,Ih.objectToQuery=Pt,Ih.Occluder=Dt,Ih.oneTimeWarning=Mt,Ih.OrientedBoundingBox=It,Ih.Packable=Rt,Ih.PackableForInterpolation=Ot,Ih.parseResponseHeaders=Nt,Ih.PinBuilder=Lt,Ih.PixelFormat=Bt,Ih.Plane=Ft,Ih.PointGeometry=Vt,Ih.pointInsideTriangle=kt,Ih.PolygonGeometry=zt,Ih.PolygonGeometryLibrary=Ut,Ih.PolygonHierarchy=Gt,Ih.PolygonOutlineGeometry=Wt,Ih.PolygonPipeline=Ht,Ih.PolylineGeometry=qt, Ih.PolylinePipeline=jt,Ih.PolylineVolumeGeometry=Yt,Ih.PolylineVolumeGeometryLibrary=Xt,Ih.PolylineVolumeOutlineGeometry=Zt,Ih.PrimitiveType=Kt,Ih.QuadraticRealPolynomial=Qt,Ih.QuantizedMeshTerrainData=Jt,Ih.QuarticRealPolynomial=$t,Ih.Quaternion=ei,Ih.QuaternionSpline=ti,Ih.queryToObject=ii,Ih.Queue=ri,Ih.Ray=ni,Ih.Rectangle=oi,Ih.RectangleGeometry=ai,Ih.RectangleGeometryLibrary=si,Ih.RectangleOutlineGeometry=li,Ih.ReferenceFrame=ui,Ih.requestAnimationFrame=ci,Ih.RequestErrorEvent=hi,Ih.RuntimeError=di,Ih.sampleTerrain=pi,Ih.scaleToGeodeticSurface=mi,Ih.ScreenSpaceEventHandler=fi,Ih.ScreenSpaceEventType=_i,Ih.ShowGeometryInstanceAttribute=gi,Ih.Simon1994PlanetaryPositions=vi,Ih.SimplePolylineGeometry=yi,Ih.SphereGeometry=Ci,Ih.SphereOutlineGeometry=wi,Ih.Spherical=Si,Ih.Spline=Ei,Ih.subdivideArray=bi,Ih.TaskProcessor=Ti,Ih.TerrainData=xi,Ih.TerrainEncoding=Ai,Ih.TerrainMesh=Pi,Ih.TerrainProvider=Di,Ih.TerrainQuantization=Mi,Ih.throttleRequestByServer=Ii,Ih.TileProviderError=Ri,Ih.TilingScheme=Oi,Ih.TimeConstants=Ni,Ih.TimeInterval=Li,Ih.TimeIntervalCollection=Bi,Ih.TimeStandard=Fi,Ih.Tipsify=Vi,Ih.Transforms=ki,Ih.TranslationRotationScale=zi,Ih.TridiagonalSystemSolver=Ui,Ih.TrustedServers=Gi,Ih.VertexFormat=Wi,Ih.VideoSynchronizer=Hi,Ih.Visibility=qi,Ih.VRTheWorldTerrainProvider=ji,Ih.WallGeometry=Yi,Ih.WallGeometryLibrary=Xi,Ih.WallOutlineGeometry=Zi,Ih.WebGLConstants=Ki,Ih.WebMercatorProjection=Qi,Ih.WebMercatorTilingScheme=Ji,Ih.WindingOrder=$i,Ih.wrapFunction=er,Ih.writeTextToCanvas=tr,Ih.BillboardGraphics=ir,Ih.BillboardVisualizer=rr,Ih.BoundingSphereState=nr,Ih.BoxGeometryUpdater=or,Ih.BoxGraphics=ar,Ih.CallbackProperty=sr,Ih.CheckerboardMaterialProperty=lr,Ih.ColorMaterialProperty=ur,Ih.CompositeEntityCollection=cr,Ih.CompositeMaterialProperty=hr,Ih.CompositePositionProperty=dr,Ih.CompositeProperty=pr,Ih.ConstantPositionProperty=mr,Ih.ConstantProperty=fr,Ih.CorridorGeometryUpdater=_r,Ih.CorridorGraphics=gr,Ih.createMaterialPropertyDescriptor=vr,Ih.createPropertyDescriptor=yr,Ih.createRawPropertyDescriptor=Cr,Ih.CustomDataSource=wr,Ih.CylinderGeometryUpdater=Sr,Ih.CylinderGraphics=Er,Ih.CzmlDataSource=br,Ih.DataSource=Tr,Ih.DataSourceClock=xr,Ih.DataSourceCollection=Ar,Ih.DataSourceDisplay=Pr,Ih.dynamicGeometryGetBoundingSphere=Dr,Ih.DynamicGeometryUpdater=Mr,Ih.EllipseGeometryUpdater=Ir,Ih.EllipseGraphics=Rr,Ih.EllipsoidGeometryUpdater=Or,Ih.EllipsoidGraphics=Nr,Ih.Entity=Lr,Ih.EntityCluster=Br,Ih.EntityCollection=Fr,Ih.EntityView=Vr,Ih.GeoJsonDataSource=kr,Ih.GeometryUpdater=zr,Ih.GeometryVisualizer=Ur,Ih.GridMaterialProperty=Gr,Ih.ImageMaterialProperty=Wr,Ih.KmlDataSource=Hr,Ih.LabelGraphics=qr,Ih.LabelVisualizer=jr,Ih.MaterialProperty=Yr,Ih.ModelGraphics=Xr,Ih.ModelVisualizer=Zr,Ih.NodeTransformationProperty=Kr,Ih.PathGraphics=Qr,Ih.PathVisualizer=Jr,Ih.PointGraphics=$r,Ih.PointVisualizer=en,Ih.PolygonGeometryUpdater=tn,Ih.PolygonGraphics=rn,Ih.PolylineArrowMaterialProperty=nn,Ih.PolylineGeometryUpdater=on,Ih.PolylineGlowMaterialProperty=an,Ih.PolylineGraphics=sn,Ih.PolylineOutlineMaterialProperty=ln,Ih.PolylineVolumeGeometryUpdater=un,Ih.PolylineVolumeGraphics=cn,Ih.PositionProperty=hn,Ih.PositionPropertyArray=dn,Ih.Property=pn,Ih.PropertyArray=mn,Ih.PropertyBag=fn,Ih.RectangleGeometryUpdater=_n,Ih.RectangleGraphics=gn,Ih.ReferenceProperty=vn,Ih.Rotation=yn,Ih.SampledPositionProperty=Cn,Ih.SampledProperty=wn,Ih.ScaledPositionProperty=Sn,Ih.StaticGeometryColorBatch=En,Ih.StaticGeometryPerMaterialBatch=bn,Ih.StaticGroundGeometryColorBatch=Tn,Ih.StaticOutlineGeometryBatch=xn,Ih.StripeMaterialProperty=An,Ih.StripeOrientation=Pn,Ih.TimeIntervalCollectionPositionProperty=Dn,Ih.TimeIntervalCollectionProperty=Mn,Ih.VelocityOrientationProperty=In,Ih.VelocityVectorProperty=Rn,Ih.Visualizer=On,Ih.WallGeometryUpdater=Nn,Ih.WallGraphics=Ln,Ih.AutomaticUniforms=Bn,Ih.Buffer=Fn,Ih.BufferUsage=Vn,Ih.ClearCommand=kn,Ih.ComputeCommand=zn,Ih.ComputeEngine=Un,Ih.Context=Gn,Ih.ContextLimits=Wn,Ih.createUniform=Hn,Ih.createUniformArray=qn,Ih.CubeMap=jn,Ih.CubeMapFace=Yn,Ih.DrawCommand=Xn,Ih.Framebuffer=Zn,Ih.loadCubeMap=Kn,Ih.MipmapHint=Qn,Ih.Pass=Jn,Ih.PassState=$n,Ih.PickFramebuffer=eo,Ih.PixelDatatype=to,Ih.Renderbuffer=io,Ih.RenderbufferFormat=ro,Ih.RenderState=no,Ih.Sampler=oo,Ih.ShaderCache=ao,Ih.ShaderProgram=so,Ih.ShaderSource=lo,Ih.Texture=uo,Ih.TextureMagnificationFilter=co,Ih.TextureMinificationFilter=ho,Ih.TextureWrap=po,Ih.UniformState=mo,Ih.VertexArray=fo,Ih.VertexArrayFacade=_o,Ih.Appearance=go,Ih.ArcGisMapServerImageryProvider=vo,Ih.BatchTable=yo,Ih.Billboard=Co,Ih.BillboardCollection=wo,Ih.BingMapsImageryProvider=So,Ih.BingMapsStyle=Eo,Ih.BlendEquation=bo,Ih.BlendFunction=To,Ih.BlendingState=xo,Ih.Camera=Ao,Ih.CameraEventAggregator=Po,Ih.CameraEventType=Do,Ih.CameraFlightPath=Mo,Ih.ColorBlendMode=Io,Ih.createOpenStreetMapImageryProvider=Ro,Ih.createTangentSpaceDebugPrimitive=Oo,Ih.createTileMapServiceImageryProvider=No,Ih.CreditDisplay=Lo,Ih.CullFace=Bo,Ih.CullingVolume=Fo,Ih.DebugAppearance=Vo,Ih.DebugCameraPrimitive=ko,Ih.DebugModelMatrixPrimitive=zo,Ih.DepthFunction=Uo,Ih.DepthPlane=Go,Ih.DeviceOrientationCameraController=Wo,Ih.DiscardMissingTileImagePolicy=Ho,Ih.EllipsoidPrimitive=qo,Ih.EllipsoidSurfaceAppearance=jo,Ih.Fog=Yo,Ih.FrameRateMonitor=Xo,Ih.FrameState=Zo,Ih.FrustumCommands=Ko,Ih.FXAA=Qo,Ih.getAttributeOrUniformBySemantic=Jo,Ih.getBinaryAccessor=$o,Ih.GetFeatureInfoFormat=ea,Ih.Globe=ta,Ih.GlobeDepth=ia,Ih.GlobeSurfaceShaderSet=ra,Ih.GlobeSurfaceTile=na,Ih.GlobeSurfaceTileProvider=oa,Ih.GoogleEarthImageryProvider=aa,Ih.GridImageryProvider=sa,Ih.GroundPrimitive=la,Ih.HeightReference=ua,Ih.HorizontalOrigin=ca,Ih.Imagery=ha,Ih.ImageryLayer=da,Ih.ImageryLayerCollection=pa,Ih.ImageryLayerFeatureInfo=ma,Ih.ImageryProvider=fa,Ih.ImageryState=_a,Ih.Label=ga,Ih.LabelCollection=va,Ih.LabelStyle=ya,Ih.MapboxImageryProvider=Ca,Ih.MapMode2D=wa,Ih.Material=Sa,Ih.MaterialAppearance=Ea,Ih.Model=ba,Ih.ModelAnimation=Ta,Ih.ModelAnimationCache=xa,Ih.ModelAnimationCollection=Aa,Ih.ModelAnimationLoop=Pa,Ih.ModelAnimationState=Da,Ih.ModelMaterial=Ma,Ih.modelMaterialsCommon=Ia,Ih.ModelMesh=Ra,Ih.ModelNode=Oa,Ih.Moon=Na,Ih.NeverTileDiscardPolicy=La,Ih.OIT=Ba,Ih.OrthographicFrustum=Fa,Ih.PerformanceDisplay=Va,Ih.PerInstanceColorAppearance=ka,Ih.PerspectiveFrustum=za,Ih.PerspectiveOffCenterFrustum=Ua,Ih.PickDepth=Ga,Ih.PointAppearance=Wa,Ih.PointPrimitive=Ha,Ih.PointPrimitiveCollection=qa,Ih.Polyline=ja,Ih.PolylineCollection=Ya,Ih.PolylineColorAppearance=Xa,Ih.PolylineMaterialAppearance=Za,Ih.Primitive=Ka,Ih.PrimitiveCollection=Qa,Ih.PrimitivePipeline=Ja,Ih.PrimitiveState=$a,Ih.QuadtreeOccluders=es,Ih.QuadtreePrimitive=ts,Ih.QuadtreeTile=is,Ih.QuadtreeTileLoadState=rs,Ih.QuadtreeTileProvider=ns,Ih.Scene=os,Ih.SceneMode=as,Ih.SceneTransforms=ss,Ih.SceneTransitioner=ls,Ih.ScreenSpaceCameraController=us,Ih.ShadowMap=cs,Ih.ShadowMapShader=hs,Ih.ShadowMode=ds,Ih.SingleTileImageryProvider=ps,Ih.SkyAtmosphere=ms,Ih.SkyBox=fs,Ih.StencilFunction=_s,Ih.StencilOperation=gs,Ih.Sun=vs,Ih.SunPostProcess=ys,Ih.TerrainState=Cs,Ih.TextureAtlas=ws,Ih.TileBoundingBox=Ss,Ih.TileCoordinatesImageryProvider=Es,Ih.TileDiscardPolicy=bs,Ih.TileImagery=Ts,Ih.TileReplacementQueue=xs,Ih.TileState=As,Ih.TileTerrain=Ps,Ih.TweenCollection=Ds,Ih.UrlTemplateImageryProvider=Ms,Ih.VerticalOrigin=Is,Ih.ViewportQuad=Rs,Ih.WebMapServiceImageryProvider=Os,Ih.WebMapTileServiceImageryProvider=Ns,Ih._shaders.AdjustTranslucentFS=Ls,Ih._shaders.AllMaterialAppearanceFS=Bs,Ih._shaders.AllMaterialAppearanceVS=Fs,Ih._shaders.BasicMaterialAppearanceFS=Vs,Ih._shaders.BasicMaterialAppearanceVS=ks,Ih._shaders.EllipsoidSurfaceAppearanceFS=zs,Ih._shaders.EllipsoidSurfaceAppearanceVS=Us,Ih._shaders.PerInstanceColorAppearanceFS=Gs,Ih._shaders.PerInstanceColorAppearanceVS=Ws,Ih._shaders.PerInstanceFlatColorAppearanceFS=Hs,Ih._shaders.PerInstanceFlatColorAppearanceVS=qs,Ih._shaders.PointAppearanceFS=js,Ih._shaders.PointAppearanceVS=Ys,Ih._shaders.PolylineColorAppearanceVS=Xs,Ih._shaders.PolylineMaterialAppearanceVS=Zs,Ih._shaders.TexturedMaterialAppearanceFS=Ks,Ih._shaders.TexturedMaterialAppearanceVS=Qs,Ih._shaders.BillboardCollectionFS=Js,Ih._shaders.BillboardCollectionVS=$s,Ih._shaders.degreesPerRadian=el,Ih._shaders.depthRange=tl,Ih._shaders.epsilon1=il,Ih._shaders.epsilon2=rl,Ih._shaders.epsilon3=nl,Ih._shaders.epsilon4=ol,Ih._shaders.epsilon5=al,Ih._shaders.epsilon6=sl,Ih._shaders.epsilon7=ll,Ih._shaders.infinity=ul,Ih._shaders.oneOverPi=cl,Ih._shaders.oneOverTwoPi=hl,Ih._shaders.passCompute=dl,Ih._shaders.passEnvironment=pl,Ih._shaders.passGlobe=ml,Ih._shaders.passGround=fl,Ih._shaders.passOpaque=_l,Ih._shaders.passOverlay=gl,Ih._shaders.passTranslucent=vl,Ih._shaders.pi=yl,Ih._shaders.piOverFour=Cl,Ih._shaders.piOverSix=wl,Ih._shaders.piOverThree=Sl,Ih._shaders.piOverTwo=El,Ih._shaders.radiansPerDegree=bl,Ih._shaders.sceneMode2D=Tl,Ih._shaders.sceneMode3D=xl,Ih._shaders.sceneModeColumbusView=Al,Ih._shaders.sceneModeMorphing=Pl,Ih._shaders.solarRadius=Dl,Ih._shaders.threePiOver2=Ml,Ih._shaders.twoPi=Il,Ih._shaders.webMercatorMaxLatitude=Rl,Ih._shaders.CzmBuiltins=Ol,Ih._shaders.alphaWeight=Nl,Ih._shaders.antialias=Ll,Ih._shaders.cascadeColor=Bl,Ih._shaders.cascadeDistance=Fl,Ih._shaders.cascadeMatrix=Vl,Ih._shaders.cascadeWeights=kl,Ih._shaders.columbusViewMorph=zl,Ih._shaders.computePosition=Ul,Ih._shaders.cosineAndSine=Gl,Ih._shaders.decompressTextureCoordinates=Wl,Ih._shaders.eastNorthUpToEyeCoordinates=Hl,Ih._shaders.ellipsoidContainsPoint=ql,Ih._shaders.ellipsoidNew=jl,Ih._shaders.ellipsoidWgs84TextureCoordinates=Yl,Ih._shaders.equalsEpsilon=Xl,Ih._shaders.eyeOffset=Zl,Ih._shaders.eyeToWindowCoordinates=Kl,Ih._shaders.fog=Ql,Ih._shaders.geodeticSurfaceNormal=Jl,Ih._shaders.getDefaultMaterial=$l,Ih._shaders.getLambertDiffuse=eu,Ih._shaders.getSpecular=tu,Ih._shaders.getWaterNoise=iu,Ih._shaders.getWgs84EllipsoidEC=ru,Ih._shaders.hue=nu,Ih._shaders.isEmpty=ou,Ih._shaders.isFull=au,Ih._shaders.latitudeToWebMercatorFraction=su,Ih._shaders.luminance=lu,Ih._shaders.metersPerPixel=uu,Ih._shaders.modelToWindowCoordinates=cu,Ih._shaders.multiplyWithColorBalance=hu,Ih._shaders.nearFarScalar=du,Ih._shaders.octDecode=pu,Ih._shaders.packDepth=mu,Ih._shaders.phong=fu,Ih._shaders.pointAlongRay=_u,Ih._shaders.rayEllipsoidIntersectionInterval=gu,Ih._shaders.RGBToXYZ=vu,Ih._shaders.saturation=yu,Ih._shaders.shadowDepthCompare=Cu,Ih._shaders.shadowVisibility=wu,Ih._shaders.signNotZero=Su,Ih._shaders.tangentToEyeSpaceMatrix=Eu,Ih._shaders.translateRelativeToEye=bu,Ih._shaders.translucentPhong=Tu,Ih._shaders.transpose=xu,Ih._shaders.unpackDepth=Au,Ih._shaders.windowToEyeCoordinates=Pu,Ih._shaders.XYZToRGB=Du,Ih._shaders.depthRangeStruct=Mu,Ih._shaders.ellipsoid=Iu,Ih._shaders.material=Ru,Ih._shaders.materialInput=Ou,Ih._shaders.ray=Nu,Ih._shaders.raySegment=Lu,Ih._shaders.shadowParameters=Bu,Ih._shaders.CompositeOITFS=Fu,Ih._shaders.DepthPlaneFS=Vu,Ih._shaders.DepthPlaneVS=ku,Ih._shaders.EllipsoidFS=zu,Ih._shaders.EllipsoidVS=Uu,Ih._shaders.GlobeFS=Gu,Ih._shaders.GlobeVS=Wu,Ih._shaders.GroundAtmosphere=Hu,Ih._shaders.BumpMapMaterial=qu,Ih._shaders.CheckerboardMaterial=ju,Ih._shaders.DotMaterial=Yu,Ih._shaders.FadeMaterial=Xu,Ih._shaders.GridMaterial=Zu,Ih._shaders.NormalMapMaterial=Ku,Ih._shaders.PolylineArrowMaterial=Qu,Ih._shaders.PolylineGlowMaterial=Ju,Ih._shaders.PolylineOutlineMaterial=$u,Ih._shaders.RimLightingMaterial=ec,Ih._shaders.StripeMaterial=tc,Ih._shaders.Water=ic,Ih._shaders.PointPrimitiveCollectionFS=rc,Ih._shaders.PointPrimitiveCollectionVS=nc,Ih._shaders.PolylineCommon=oc,Ih._shaders.PolylineFS=ac,Ih._shaders.PolylineVS=sc,Ih._shaders.AdditiveBlend=lc,Ih._shaders.BrightPass=uc,Ih._shaders.FXAA=cc,Ih._shaders.GaussianBlur1D=hc,Ih._shaders.PassThrough=dc,Ih._shaders.ReprojectWebMercatorFS=pc,Ih._shaders.ReprojectWebMercatorVS=mc,Ih._shaders.ShadowVolumeFS=fc,Ih._shaders.ShadowVolumeVS=_c,Ih._shaders.SkyAtmosphereFS=gc,Ih._shaders.SkyAtmosphereVS=vc,Ih._shaders.SkyBoxFS=yc,Ih._shaders.SkyBoxVS=Cc,Ih._shaders.SunFS=wc,Ih._shaders.SunTextureFS=Sc,Ih._shaders.SunVS=Ec,Ih._shaders.ViewportQuadFS=bc,Ih._shaders.ViewportQuadVS=Tc,Ih.Autolinker=xc,Ih["earcut-2.1.1"]=Ac,Ih.gltfDefaults=Pc,Ih.kdbush=Dc,Ih["knockout-3.4.0"]=Mc,Ih["knockout-es5"]=Ic,Ih.knockout=Rc,Ih.measureText=Oc,Ih["mersenne-twister"]=Nc,Ih.NoSleep=Lc,Ih.sprintf=Bc,Ih.topojson=Fc,Ih.Tween=Vc,Ih.Uri=kc,Ih.when=zc,Ih.zip=Uc,Ih.Animation=Gc,Ih.AnimationViewModel=Wc,Ih.BaseLayerPicker=Hc,Ih.BaseLayerPickerViewModel=qc,Ih.createDefaultImageryProviderViewModels=jc,Ih.createDefaultTerrainProviderViewModels=Yc,Ih.ProviderViewModel=Xc,Ih.CesiumInspector=Zc,Ih.CesiumInspectorViewModel=Kc,Ih.CesiumWidget=Qc,Ih.ClockViewModel=Jc,Ih.Command=$c,Ih.createCommand=eh,Ih.FullscreenButton=th,Ih.FullscreenButtonViewModel=ih,Ih.Geocoder=rh,Ih.GeocoderViewModel=nh,Ih.getElement=oh,Ih.HomeButton=ah,Ih.HomeButtonViewModel=sh,Ih.InfoBox=lh,Ih.InfoBoxViewModel=uh,Ih.NavigationHelpButton=ch,Ih.NavigationHelpButtonViewModel=hh,Ih.PerformanceWatchdog=dh,Ih.PerformanceWatchdogViewModel=ph,Ih.SceneModePicker=mh,Ih.SceneModePickerViewModel=fh,Ih.SelectionIndicator=_h,Ih.SelectionIndicatorViewModel=gh,Ih.subscribeAndEvaluate=vh,Ih.SvgPathBindingHandler=yh,Ih.Timeline=Ch,Ih.TimelineHighlightRange=wh,Ih.TimelineTrack=Sh,Ih.ToggleButtonViewModel=Eh,Ih.Viewer=bh,Ih.viewerCesiumInspectorMixin=Th,Ih.viewerDragDropMixin=xh,Ih.viewerPerformanceWatchdogMixin=Ah,Ih.VRButton=Ph,Ih.VRButtonViewModel=Dh,Ih.createTaskProcessorWorker=Mh,Ih}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}();