/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ /** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ /** @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 * * Grauw URI utilities * * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js * * @author Laurens Holst (http://www.grauw.nl/) * * Copyright 2012 Laurens Holst * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** @license when.js - https://github.com/cujojs/when MIT License (c) copyright B Cavalier & J Hann * A lightweight CommonJS Promises/A and when() implementation * when is part of the cujo.js family of libraries (http://cujojs.com/) * * Licensed under the MIT License at: * http://www.opensource.org/licenses/mit-license.php * * @version 1.7.1 */ /** @license sprintf.js from the php.js project - https://github.com/kvz/phpjs 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. */ // 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. */ /*! * protobuf.js v6.7.0 (c) 2016, Daniel Wirtz * Compiled Wed, 22 Mar 2017 17:30:26 UTC * Licensed under the BSD-3-Clause License * see: https://github.com/dcodeIO/protobuf.js for details */ /** * Dictionary of provider id to copyright strings. * @type {Object} * @default {} */ /** @license fontmetrics.js - https://github.com/Pomax/fontmetrics.js 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) 2014-2015, NVIDIA CORPORATION. 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 NVIDIA CORPORATION nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * @license * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the project nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Modifications made by Analytical Graphics, Inc. */ /** * @licence * * crunch/crnlib v1.04 - Advanced DXTn texture compression library * Copyright (C) 2010-2016 Richard Geldreich, Jr. and Binomial LLC http://binomial.info */ /** * @license * * crunch_lib.cpp * * Copyright (c) 2013, Evan Parker, Brandon Jones. 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. * * 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 HOLDER 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. */ /*! * Knockout JavaScript library v3.4.2 * (c) The Knockout.js team - 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 requirejs,require,define;!function(e){function t(e,t){return _.call(e,t)}function r(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=g.map,v=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,g.nodeIdCompat&&b.test(e[a])&&(e[a]=e[a].replace(b,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||v)&&m){for(r=e.split("/"),c=r.length;c>0;c-=1){if(i=r.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if((n=m[f.slice(0,d).join("/")])&&(n=n[i])){o=n,s=c;break}if(o)break;!l&&v&&v[i]&&(l=v[i],u=c)}!o&&l&&(o=l,s=u),o&&(r.splice(0,s,o),e=r.join("/"))}return e}function i(t,r){return function(){var i=y.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),d.apply(e,i.concat([t,r]))}}function n(e){return function(t){return r(t,e)}}function o(e){return function(t){f[e]=t}}function a(r){if(t(m,r)){var i=m[r];delete m[r],v[r]=!0,c.apply(e,i)}if(!t(f,r)&&!t(v,r))throw new Error("No "+r);return f[r]}function s(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function l(e){return e?s(e):[]}function u(e){return function(){return g&&g.config&&g.config[e]||{}}}var c,d,h,p,f={},m={},g={},v={},_=Object.prototype.hasOwnProperty,y=[].slice,b=/\.js$/;h=function(e,t){var i,o=s(e),l=o[0],u=t[1];return e=o[1],l&&(l=r(l,u),i=a(l)),l?e=i&&i.normalize?i.normalize(e,n(u)):r(e,u):(e=r(e,u),o=s(e),l=o[0],e=o[1],l&&(i=a(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:i}},p={require:function(e){return i(e)},exports:function(e){var t=f[e];return void 0!==t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:u(e)}}},c=function(r,n,s,u){var c,d,g,_,y,b,C,w=[],S=typeof s;if(u=u||r,b=l(u),"undefined"===S||"function"===S){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y=i)throw new t("Expected "+e+" to be less than "+i+", actual value was "+r)},n.typeOf.number.lessThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r>i)throw new t("Expected "+e+" to be less than or equal to "+i+", actual value was "+r)},n.typeOf.number.greaterThan=function(e,r,i){if(n.typeOf.number(e,r),r<=i)throw new t("Expected "+e+" to be greater than "+i+", actual value was "+r)},n.typeOf.number.greaterThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r>>0,a=t(i,0),s=a<0?Math.max(o+a,0):Math.min(a,o),l=t(n,o),u=l<0?Math.max(o+l,0):Math.min(l,o);s>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*n.clamp(e,-1,1)+.5)*r)},n.fromSNorm=function(e,r){return r=t(r,255),n.clamp(e,0,r)/r*2-1},n.sinh=function(e){return.5*(Math.pow(Math.E,e)-Math.pow(Math.E,-1*e))},n.cosh=function(e){return.5*(Math.pow(Math.E,e)+Math.pow(Math.E,-1*e))},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,r,i,n){n=t(n,i);var o=Math.abs(e-r);return o<=n||o<=i*Math.max(Math.abs(e),Math.abs(r))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;i<=e;i++)o.push(r*i);return o[e]},n.incrementWrap=function(e,r,i){return i=t(i,0),++e,e>r&&(e=i),e},n.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},n.clamp=function(e,t,r){return er?r:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.randomBetween=function(e,t){return n.nextRandomNumber()*(t-e)+e},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var r=e*t;return 1-Math.exp(-r*r)},n}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,r,i){"use strict";function n(e,i,n){if(r(e)){n=t(n,!1);var a=e.length;if(a<2)return e;var s,l,u;for(s=1;s1&&i(c[0],c[c.length-1],o)&&c.shift(),c}}var o=i.EPSILON10;return n}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(){this._array=[],this._hash={}}return t(i.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),i.prototype.contains=function(t){return e(this._hash[t])},i.prototype.set=function(e,t){t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},i.prototype.get=function(e){return this._hash[e]},i.prototype.remove=function(t){var r=this._hash[t],i=e(r);if(i){var n=this._array;n.splice(n.indexOf(r),1),delete this._hash[t]}return i},i.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r){this.x=t(e,0),this.y=t(r,0)}a.fromElements=function(e,t,i){return r(i)?(i.x=e,i.y=t,i):new a(e,t)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i]=e.y,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=2*i:t=new Array(2*i);for(var n=0;n0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,i){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,g,v,_;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),g=t.dot(d,p),v=t.dot(h,h),_=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),g=e.dot(d,p),v=e.dot(h,h),_=e.dot(h,p));var y=1/(f*v-m*m);return c.y=(v*g-m*_)*y,c.z=(f*_-m*g)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var i,n,o=0,a=e.length-1;o<=a;)if(i=~~((o+a)/2),(n=r(e[i],t))<0)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)}return r}),define("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i){var a=e(i),s=e(r);e(t)||s||(t=i),this._text=t,this._imageUrl=r,this._link=i,this._hasLink=a,this._hasImage=s;var l,u=JSON.stringify([t,r,i]);e(o[u])?l=o[u]:(l=n++,o[u]=l),this._id=l}var n=0,o={};return t(i.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),i.prototype.hasImage=function(){return this._hasImage},i.prototype.hasLink=function(){return this._hasLink},i.equals=function(t,r){return t===r||e(t)&&e(r)&&t._id===r._id},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var r={};r.defaultKey=void 0;var i,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return r.getKey=function(e){return t(e)?e:t(r.defaultKey)?r.defaultKey:(n||(console.log(o),n=!0),"Aig5SkZ4pNMN8b4rX-RUH2c_95mK-wjb4WL9k50K51faErEGnNsxgpWHXiqS3Rhe")},r.getErrorCredit=function(n){if(!t(n)&&!t(r.defaultKey))return t(i)||(i=new e(o)),i},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,r).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];i&&t.shift();for(""==t[0]&&t.shift();t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){return new i(function(r){try{return t(r?r(e):e)}catch(e){return o(e)}})}function o(e){return new i(function(r,i){try{return i?t(i(e)):o(e)}catch(e){return o(e)}})}function a(){function e(e,t,r){return h(e,t,r)}function r(e){return f(e)}function n(e){return f(o(e))}function s(e){return p(e)}var l,u,c,d,h,p,f;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],d=[],h=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(e){i.progress(e)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),d.push(n),i.promise},p=function(e){return m(d,e),e},f=function(e){return e=t(e),h=e.then,f=t,p=v,m(c,e),d=c=C,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return g(2,arguments),e(t,function(t){function s(e){m(e)}function l(e){f(e)}var u,c,d,h,p,f,m,g,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(r,_)),d=[],c=_-u+1,h=[],p=a(),u)for(g=p.progress,m=function(e){h.push(e),--c||(f=m=v,p.reject(h))},f=function(e){d.push(e),--u||(f=m=v,p.resolve(d))},y=0;y<_;++y)y in t&&e(t[y],l,s,g);else p.resolve(d);return p.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return g(1,arguments),h(e,_).then(t,r,i)}function d(){return h(arguments,_)}function h(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;l2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function m(e,t){for(var r,i=0;r=e[i++];)r(t)}function g(e,t){for(var r,i=t.length;i>e;)if(null!=(r=t[--i])&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function v(){}function _(e){return e}var y,b,C;return e.defer=a,e.resolve=t,e.reject=r,e.join=d,e.all=c,e.map=h,e.reduce=p,e.any=u,e.some=l,e.chain=f,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(C,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(C,t)})})}},b=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;oe&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),n.prototype.reserve=function(e){e=t(e,this._length),this._array.length=e},n.prototype.heapify=function(e){e=t(e,0);for(var r=this._length,i=this._comparator,n=this._array,a=-1,s=!0;s;){var l=2*(e+1),u=l-1;a=u=0;--t)this.heapify(t)},n.prototype.insert=function(e){var t=this._array,i=this._comparator,n=this._maximumLength,a=this._length++;for(an&&(l=t[n],this._length=n),l},n.prototype.pop=function(e){if(e=t(e,0),0!==this._length){var r=this._array,i=r[e];return o(r,e,--this._length),this.heapify(e),i}},n}),define("Core/isBlobUri",["./Check"],function(e){"use strict";function t(e){return r.test(e)}var r=/^blob:/i;return t}),define("Core/isDataUri",["./Check"],function(e){"use strict";function t(e){return r.test(e)}var r=/^data:/i;return t}),define("Core/RequestScheduler",["../ThirdParty/Uri","../ThirdParty/when","./Check","./clone","./defined","./defineProperties","./Heap","./isBlobUri","./isDataUri","./RequestState"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return e.priority-t.priority}function d(){}function h(e){n(e.priorityFunction)&&(e.priority=e.priorityFunction())}function p(e){return E[e]0&&console.log("Number of attempted requests: "+C.numberOfAttemptedRequests),C.numberOfActiveRequests>0&&console.log("Number of active requests: "+C.numberOfActiveRequests),C.numberOfCancelledRequests>0&&console.log("Number of cancelled requests: "+C.numberOfCancelledRequests),C.numberOfCancelledActiveRequests>0&&console.log("Number of cancelled active requests: "+C.numberOfCancelledActiveRequests),C.numberOfFailedRequests>0&&console.log("Number of failed requests: "+C.numberOfFailedRequests),y())}var C={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0},w=20,S=new a({comparator:c});S.maximumLength=w,S.reserve(w);var T=[],E={},x="undefined"!=typeof document?new e(document.location.href):new e;return d.maximumRequests=50,d.maximumRequestsPerServer=6,d.throttleRequests=!0,d.debugShowStatistics=!1,o(d,{statistics:{get:function(){return C}},priorityHeapLength:{get:function(){return w},set:function(e){if(ee;){var t=S.pop();_(t)}w=e,S.maximumLength=e,S.reserve(e)}}}),d.update=function(){var e,t,r=0,i=T.length;for(e=0;e0&&(T[e-r]=t):++r;T.length-=r;var n=S.internalArray,o=S.length;for(e=0;e0;)t=S.pop(),t.cancelled?_(t):!t.throttleByServer||p(t.serverKey)?(v(t),++s):_(t);b()},d.getServerKey=function(t){var r=new e(t).resolve(x);r.normalize();var i=r.authority;/:/.test(i)||(i=i+":"+("https"===r.scheme?"443":"80"));var o=E[i];return n(o)||(E[i]=0),i},d.request=function(e){if(l(e.url)||s(e.url))return e.state=u.RECEIVED,e.requestFunction();if(++C.numberOfAttemptedRequests,n(e.serverKey)||(e.serverKey=d.getServerKey(e.url)),!d.throttleRequests||!e.throttle)return v(e);if(!(T.length>=d.maximumRequests)&&(!e.throttleByServer||p(e.serverKey))){h(e);var t=S.insert(e);if(n(t)){if(t===e)return;_(t)}return f(e)}},d.clearForSpecs=function(){for(;S.length>0;){_(S.pop())}for(var e=T.length,t=0;ti.EPSILON12);return t(u)?(u.x=c*A,u.y=d*D,u.z=h*I,u):new e(c*A,d*D,h*I)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,i){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(i,0)}s.fromRadians=function(e,t,n,o){return n=r(n,0),i(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new s(e,t,n)},s.fromDegrees=function(e,t,r,i){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,r,i)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,g=i(r)?r._centerToleranceSquared:p,v=a(t,f,m,g,u);if(i(v)){var _=e.multiplyComponents(v,m,l);_=e.normalize(_,_);var y=e.subtract(t,v,c),b=Math.atan2(_.y,_.x),C=Math.asin(_.z),w=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=b,n.latitude=C,n.height=w,n):new s(b,C,w)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(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=l.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function d(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,c(this,e,t,r)}o(d.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}}}),d.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new d(i.x,i.y,i.z)}},d.fromCartesian3=function(e,t){return n(t)||(t=new d),n(e)?(c(t,e.x,e.y,e.z),t):t},d.WGS84=s(new d(6378137,6378137,6356752.314245179)),d.UNIT_SPHERE=s(new d(1,1,1)),d.MOON=s(new d(l.LUNAR_RADIUS,l.LUNAR_RADIUS,l.LUNAR_RADIUS)),d.prototype.clone=function(e){return d.clone(this,e)},d.packedLength=e.packedLength,d.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},d.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return d.fromCartesian3(o,n)},d.prototype.geocentricSurfaceNormal=e.normalize,d.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(i),l=a*Math.sin(i),u=Math.sin(o);return n(r)||(r=new e),r.x=s,r.y=l,r.z=u,e.normalize(r,r)},d.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var h=new e,p=new e;d.prototype.cartographicToCartesian=function(t,r){var i=h,o=p;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,o);var a=Math.sqrt(e.dot(i,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(o,i,r)},d.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i=this._radii.z-r))return o},d}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n){this.west=r(e,0),this.south=r(t,0),this.east=r(i,0),this.north=r(n,0)}n(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},l.computeWidth=function(e){var t=e.east,r=e.west;return t=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,n){t=r(t,o.WGS84);for(var a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=0,m=e.length;f=0?g.longitude:g.longitude+s.TWO_PI;c=Math.min(c,v),d=Math.max(d,v)}return u-a>d-c&&(a=c,u=d,u>s.PI&&(u-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),i(n)?(n.west=a,n.south=h,n.east=u,n.north=p,n):new l(a,h,u,p)},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=h,r.east=d,r.north=p,r):new l(c,h,d,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),nn||s.equalsEpsilon(r,n,s.EPSILON14))&&(r=e.south&&i<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0),i(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=d<0?d:h>0?h:0;for(var g=1;g<8;++g)m.longitude=-Math.PI+g*s.PI_OVER_TWO,l.contains(e,m)&&(a[c]=t.cartographicToCartesian(m,a[c]),c++);return 0===m.latitude&&(m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),define("Core/BingMapsGeocoderService",["./BingMapsApi","./Check","./defaultValue","./defined","./defineProperties","./loadJsonp","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=r(t,r.EMPTY_OBJECT);var n=t.key;if(this._key=e.getKey(n),i(n)){var o=e.getErrorCredit(n);i(o)&&t.scene._frameState.creditDisplay.addDefaultCredit(o)}}var l="https://dev.virtualearth.net/REST/v1/Locations";return n(s.prototype,{url:{get:function(){return l}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){var t=this.key;return o(l,{parameters:{query:e,key:t},callbackParameterName:"jsonp"}).then(function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map(function(e){var t=e.bbox,r=t[0],i=t[1],n=t[2],o=t[3];return{displayName:e.name,destination:a.fromDegrees(i,r,o,n)}})})},s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},l.unpack=function(e,t,r){return t=i(t,0),n(r)||(r=new l),r.x=e[t++],r.y=e[t++],r.width=e[t++],r.height=e[t],r},l.fromPoints=function(e,t){if(n(t)||(t=new l),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,i=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;ur.width?r.width=i:i<0&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:n<0&&(r.height-=n,r.y=t.y),r},l.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,o,a,s,l,u){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(s,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(l,0),this[6]=r(i,0),this[7]=r(a,0),this[8]=r(u,0)}function u(e){for(var t=0,r=0;r<9;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var i=e[l.getElementIndex(m[r],f[r])];t+=2*i*i}return Math.sqrt(t)}function d(e,t){for(var r=s.EPSILON15,i=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>i&&(n=o,i=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>r){var p,g=e[l.getElementIndex(h,h)],v=e[l.getElementIndex(d,d)],_=e[l.getElementIndex(h,d)],y=(g-v)/2/_;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=r-s-d+p,m=2*(n-h),g=2*(o+c),v=2*(n+h),_=-r+s-d+p,y=2*(u-a),b=2*(o-c),C=2*(u+a),w=-r-s+d+p;return i(t)?(t[0]=f,t[1]=v,t[2]=b,t[3]=m,t[4]=_,t[5]=C,t[6]=g,t[7]=y,t[8]=w,t):new l(f,m,g,v,_,y,b,C,w)},l.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=r*s,f=o*n+u*a*s,m=-u*n+o*a*s,g=-a,v=u*r,_=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=g,t[3]=d,t[4]=f,t[5]=v,t[6]=h,t[7]=m,t[8]=_,t):new l(c,d,h,p,f,m,g,v,_)},l.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new l(e.x,0,0,0,e.y,0,0,0,e.z)},l.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new l(e,0,0,0,e,0,0,0,e)},l.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new l(1,0,0,0,r,-n,0,n,r)},l.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new l(r,0,n,0,1,0,-n,0,r)},l.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(r,-n,0,n,r,0,0,0,1)},l.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,r){var i=3*t,n=e[i],o=e[i+1],a=e[i+2];return r.x=n,r.y=o,r.z=a,r},l.setColumn=function(e,t,r,i){i=l.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},l.getRow=function(e,t,r){var i=e[t],n=e[t+3],o=e[t+6];return r.x=i,r.y=n,r.z=o,r},l.setRow=function(e,t,r,i){return i=l.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i};var h=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=u,r[7]=c,r[8]=d,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},l.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[3]*n+e[6]*o,s=e[1]*i+e[4]*n+e[7]*o,l=e[2]*i+e[5]*n+e[8]*o;return r.x=a,r.y=s,r.z=l,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},l.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},l.transpose=function(e,t){var r=e[0],i=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],g=new l,v=new l;return l.computeEigenDecomposition=function(e,t){var r=s.EPSILON20,n=0,o=0;i(t)||(t={});for(var a=t.unitary=l.clone(l.IDENTITY,t.unitary),h=t.diagonal=l.clone(e,t.diagonal),p=r*u(h);o<10&&c(h)>p;)d(h,g),l.transpose(g,v),l.multiply(h,g,h),l.multiply(v,h,h),l.multiply(a,g,a),++n>2&&(++o,n=0);return t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},l.determinant=function(e){var t=e[0],r=e[3],i=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*i-r*u)+s*(r*a-o*i)},l.inverse=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],d=e[8],h=l.determinant(e);t[0]=a*d-c*s,t[1]=c*n-i*d,t[2]=i*s-a*n,t[3]=u*s-o*d,t[4]=r*d-u*n,t[5]=o*n-r*s,t[6]=o*c-u*a,t[7]=u*i-r*c,t[8]=r*a-o*i;var p=1/h;return l.multiplyByScalar(t,p,t)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){ return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)}a.fromElements=function(e,t,i,n,o){return r(o)?(o.x=e,o.y=t,o.z=i,o.w=n,o):new a(e,t,i,n)},a.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i++],n.w=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=4*i:t=new Array(4*i);for(var n=0;nu.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Ad.z&&e.clone(o,d)}var D=e.magnitudeSquared(e.subtract(u,a,b)),I=e.magnitudeSquared(e.subtract(c,s,b)),O=e.magnitudeSquared(e.subtract(d,l,b)),M=a,R=u,L=D;I>L&&(L=I,M=s,R=c),O>L&&(L=O,M=l,R=d);var N=C;N.x=.5*(M.x+R.x),N.y=.5*(M.y+R.y),N.z=.5*(M.z+R.z);var k=e.magnitudeSquared(e.subtract(R,N,b)),F=Math.sqrt(k),B=w;B.x=a.x,B.y=s.y,B.z=l.z;var U=S;U.x=u.x,U.y=c.y,U.z=d.z;var V=e.multiplyByScalar(e.add(B,U,b),.5,T),z=0;for(i=0;iz&&(z=G);var H=e.magnitudeSquared(e.subtract(o,N,b));if(H>k){var W=Math.sqrt(H);F=.5*(F+W),k=F*F;var j=W-F;N.x=(F*N.x+j*o.x)/W,N.y=(F*N.y+j*o.y)/W,N.z=(F*N.z+j*o.z)/W}}return FE.x&&e.clone(s,E),Ix.y&&e.clone(s,x),OP.z&&e.clone(s,P)}var M=e.magnitudeSquared(e.subtract(E,u,b)),R=e.magnitudeSquared(e.subtract(x,c,b)),L=e.magnitudeSquared(e.subtract(P,d,b)),N=u,k=E,F=M;R>F&&(F=R,N=c,k=x),L>F&&(F=L,N=d,k=P);var B=C;B.x=.5*(N.x+k.x),B.y=.5*(N.y+k.y),B.z=.5*(N.z+k.z);var U=e.magnitudeSquared(e.subtract(k,B,b)),V=Math.sqrt(U),z=w;z.x=u.x,z.y=c.y,z.z=d.z;var G=S;G.x=E.x,G.y=x.y,G.z=P.z;var H=e.multiplyByScalar(e.add(z,G,b),.5,T),W=0;for(l=0;lW&&(W=j);var q=e.magnitudeSquared(e.subtract(s,B,b));if(q>U){var Y=Math.sqrt(q);V=.5*(V+Y),U=V*V;var X=Y-V;B.x=(V*B.x+X*s.x)/Y,B.y=(V*B.y+X*s.y)/Y,B.z=(V*B.z+X*s.z)/Y}}return Vc.x&&e.clone(o,c),Ad.y&&e.clone(o,d),DE.z&&e.clone(o,E)}var I=e.magnitudeSquared(e.subtract(c,s,b)),O=e.magnitudeSquared(e.subtract(d,l,b)),M=e.magnitudeSquared(e.subtract(E,u,b)),R=s,L=c,N=I;O>N&&(N=O,R=l,L=d),M>N&&(N=M,R=u,L=E);var k=C;k.x=.5*(R.x+L.x),k.y=.5*(R.y+L.y),k.z=.5*(R.z+L.z);var F=e.magnitudeSquared(e.subtract(L,k,b)),B=Math.sqrt(F),U=w;U.x=s.x,U.y=l.y,U.z=u.z;var V=S;V.x=c.x,V.y=d.y,V.z=E.z;var z=e.multiplyByScalar(e.add(U,V,b),.5,T),G=0;for(a=0;aG&&(G=H);var W=e.magnitudeSquared(e.subtract(o,k,b));if(W>F){var j=Math.sqrt(W);B=.5*(B+j),F=B*B;var q=j-B;k.x=(B*k.x+q*o.x)/j,k.y=(B*k.y+q*o.y)/j,k.z=(B*k.z+q*o.z)/j}}return B=c+l)return t.clone(i),i;if(l>=c+a)return r.clone(i),i;var d=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+d)/c,k);return e.add(p,o,p),e.clone(p,i.center),i.radius=d,i};var F=new e;h.expand=function(t,r,i){i=h.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,F));return n>i.radius&&(i.radius=n),i},h.intersectPlane=function(t,r){var i=t.center,n=t.radius,o=r.normal,a=e.dot(o,i)+r.distance;return a<-n?s.OUTSIDE:a=i[r]){if(r+1=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;o=i[o]&&t=0&&!(t>=i[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},i}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=p,a=m,s=f,l=g ;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(i(d)||(d=l[0]=new e),e.clone(r,d),c=1;c2&&(n(a)||(a=f,e.multiplyByScalar(r[1],2,a),e.subtract(a,r[2],a),e.subtract(a,r[0],a),e.multiplyByScalar(a,.5,a)),!n(s))){var l=r.length-1;s=m,e.multiplyByScalar(r[l-1],2,s),e.subtract(r[l],s,s),e.add(s,r[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=r,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var d=new t,h=new e,p=new e,f=new e,m=new e;return o(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/Event",["./Check","./defined","./defineProperties"],function(e,t,r){"use strict";function i(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function n(e,t){return t-e}return r(i.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),i.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},i.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;o0){for(s.sort(n),e=0;e=a&&(p=a-1);var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),i(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(e,r){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,n(r)&&(this.cameraPosition=r)}function l(e,r,i){var n=e.transformPositionToScaledSpace(r,f),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,m);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,i),u=t.magnitude(t.cross(s,i,s)),c=1/a;return 1/(l*c-u*(Math.sqrt(o-1)*c))}function u(e,r,i){if(!(r<=0||r===1/0||r!==r))return t.multiplyByScalar(e,r,i)}function c(e,r){return t.equals(r,t.ZERO)?r:(e.transformPositionToScaledSpace(r,g),t.normalize(g,g))}o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,i=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(i)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=i,this._distanceToLimbInScaledSpaceSquared=n}}});var d=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(r)},s.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,r,d),o=-t.dot(n,r);return!(i<0?o>0:o>i&&o*o/t.magnitudeSquared(n)>i)},s.prototype.computeHorizonCullingPoint=function(e,r,i){n(i)||(i=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,d=0,h=r.length;ds&&s/a0?[h/e,n/h]:[n/h,h/e]},i}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,g=s*u-p,v=4*f*g-m*m;if(v<0){var _,y,b;h*d>=c*p?(_=a,y=f,b=-2*s*f+a*m):(_=u,y=g,b=-u*m+2*l*g);var C=b<0?-1:1,w=-C*Math.abs(_)*Math.sqrt(-v);o=-b+w;var S=o/2,T=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),E=o===w?-T:-y/T;return n=y<=0?T+E:-b/(T*T+E*E+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=f,P=-2*s*f+a*m,A=g,D=-u*m+2*l*g,I=Math.sqrt(v),O=Math.sqrt(3)/2,M=Math.abs(Math.atan2(a*I,-P)/3);n=2*Math.sqrt(-x);var R=Math.cos(M);o=n*R;var L=n*(-R/2-O*Math.sin(M)),N=o+L>2*s?o-s:L-s,k=a,F=N/k;M=Math.abs(Math.atan2(u*I,-D)/3),n=2*Math.sqrt(-A),R=Math.cos(M),o=n*R,L=n*(-R/2-O*Math.sin(M));var B=-u,U=o+L<2*l?o+l:L+l,V=B/U,z=k*U,G=-N*U-k*B,H=N*B,W=(l*G-s*H)/(-s*G+l*z);return F<=W?F<=V?W<=V?[F,W,V]:[F,V,W]:[V,F,W]:F<=V?[W,F,V]:W<=V?[W,V,F]:[V,W,F]}var i={};return i.computeDiscriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r;return 18*e*t*r*i+o*a-27*n*(i*i)-4*(e*a*r+o*t*i)},i.computeRealRoots=function(e,i,n,o){var a,s;if(0===e)return t.computeRealRoots(i,n,o);if(0===i){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,s<0?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.computeRealRoots(e,i,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):r(e,i,n,o)},i}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,d=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(d.length>0){var h=-t/4,p=d[d.length-1];if(Math.abs(p)=0&&v>=0){var _=Math.sqrt(g),y=Math.sqrt(v);return[h-y,h-_,h+_,h+y]}if(g>=0&&v<0)return m=Math.sqrt(g),[h-m,h+m];if(g<0&&v>=0)return m=Math.sqrt(v),[h-m,h+m]}return[]}if(p>0){var b=Math.sqrt(p),C=(l+p-u/b)/2,w=(l+p+u/b)/2,S=i.computeRealRoots(1,b,C),T=i.computeRealRoots(1,-b,w);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==T.length?(T[0]+=h,T[1]+=h,S[1]<=T[0]?[S[0],S[1],T[0],T[1]]:T[1]<=S[0]?[T[0],T[1],S[0],S[1]]:S[0]>=T[0]&&S[1]<=T[1]?[T[0],S[0],S[1],T[1]]:T[0]>=S[0]&&T[1]<=S[1]?[S[0],T[0],T[1],S[1]]:S[0]>T[0]&&S[0]0){var f,m,g=p[0],v=n-g,_=v*v,y=t/2,b=v/2,C=_-4*a,w=_+4*Math.abs(a),S=u-4*g,T=u+4*Math.abs(g);if(g<0||C*T=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>M[0]&&O[0]0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s0?y.push(new e(n,o*k,o*-U)):0!==U?(y.push(new e(n,o*k,o*-U)),y.push(new e(n,o*k,o*U)),++L):y.push(new e(n,o*k,o*U))}return y}var m={};m.rayPlane=function(t,r,n){i(n)||(n=new e);var o=t.origin,s=t.direction,l=r.normal,u=e.dot(l,s);if(!(Math.abs(u)S)return;if(u=e.cross(l,m,b),(d=e.dot(f,u))<0||c+d>S)return;h=e.dot(C,u)/S}else{if(Math.abs(S)1)return;if(u=e.cross(l,m,b),(d=e.dot(f,u)*T)<0||c+d>1)return;h=e.dot(C,u)*T}return h},m.rayTriangle=function(t,r,n,o,a,s){var l=m.rayTriangleParametric(t,r,n,o,a);if(i(l)&&!(l<0))return i(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new c;m.lineSegmentTriangle=function(t,r,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(r,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!i(c)||c<0||c>e.distance(t,r)))return i(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var w={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=h(e,t,r),i(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new c;m.lineSegmentSphere=function(t,r,n,o){var a=S;e.clone(t,a.origin);var s=e.subtract(r,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!i(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var T=new e,E=new e;m.rayEllipsoid=function(t,r){var i,n,a,s,l,u=r.oneOverRadii,c=e.multiplyComponents(u,t.origin,T),d=e.multiplyComponents(u,t.direction,E),h=e.magnitudeSquared(c),p=e.dot(c,d);if(h>1){if(p>=0)return;var f=p*p;if(i=h-1,n=e.magnitudeSquared(d),a=n*i,fa){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,g=i/l;return m=0)return n}var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(o,x),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(h,d,P),P),m=e.normalize(e.cross(d,p,A),A),g=O;g[0]=d.x,g[1]=d.y,g[2]=d.z,g[3]=p.x,g[4]=p.y,g[5]=p.z,g[6]=m.x,g[7]=m.y,g[8]=m.z;var v=s.transpose(g,M),_=s.fromScale(r.radii,R),y=s.fromScale(r.oneOverRadii,L),b=N;b[0]=0,b[1]=-o.z,b[2]=o.y,b[3]=o.z,b[4]=0,b[5]=-o.x,b[6]=-o.y,b[7]=o.x,b[8]=0;var C,w,S=s.multiply(s.multiply(v,y,k),b,k),T=s.multiply(s.multiply(S,_,F),g,F),E=s.multiplyByVector(S,n,I),z=f(T,e.negate(E,x),0,0,1),G=z.length;if(G>0){for(var H=e.clone(e.ZERO,U),W=Number.NEGATIVE_INFINITY,j=0;jW&&(W=Y,H=e.clone(C,H))}var X=r.cartesianToCartographic(H,V);return W=a.clamp(W,0,1),w=e.magnitude(e.subtract(H,n,D))*Math.sqrt(1-W*W),w=u?-w:w,X.height=w,r.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,r,n,o){i(o)||(o=new e);var s=e.subtract(r,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,r,i,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,r)+a<0,u=e.dot(o,i)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,r,i,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,r,i,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,r,i,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,r,i,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,r,i,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,r,i,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";function o(t,r){this.normal=e.clone(t),this.distance=r}o.fromPointNormal=function(r,i,n){var a=-e.dot(i,r);return t(n)?(e.clone(i,n.normal),n.distance=a,n):new o(i,a)};var a=new e;return o.fromCartesian4=function(r,i){var n=e.fromCartesian4(r,a),s=r.w;return t(i)?(e.clone(n,i.normal),i.distance=s,i):new o(n,s)},o.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},o.ORIGIN_XY_PLANE=i(new o(e.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=i(new o(e.UNIT_X,0)),o.ORIGIN_ZX_PLANE=i(new o(e.UNIT_Y,0)),o}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,d,h){var p,f,m,g,v;if("%%"==e)return"%";for(var _=!1,y="",b=!1,C=!1,w=" ",S=l.length,T=0;l&&T-1?6:"d"==h?0:void 0,v=i?t[i.slice(0,-1)]:t[r++],h){case"s":return s(String(v),_,u,d,b,w);case"c":return s(String.fromCharCode(+v),_,u,d,b);case"b":return a(v,2,C,_,u,d,b);case"o":return a(v,8,C,_,u,d,b);case"x":return a(v,16,C,_,u,d,b);case"X":return a(v,16,C,_,u,d,b).toUpperCase();case"u":return a(v,10,C,_,u,d,b);case"i":case"d":return p=+v||0,p=Math.round(p-p%1),f=p<0?"-":y,v=f+n(String(Math.abs(p)),d,"0",!1),o(v,f,_,u,b);case"e":case"E":case"f":case"F":case"g":case"G":return p=+v,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=f+Math.abs(p)[m](d),o(v,f,_,u,b)[g]();default:return e}};return i.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4==0&&e%100!=0||e%400==0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";return e({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})}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";return e({UTC:0,TAI:1})}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){_.julianDate=e;var r=m.leapSeconds,i=t(r,_,c);i<0&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){m.secondsDifference(r[i].julianDate,e)>n&&(i--,n=r[i].offset)}m.addSeconds(e,n,e)}function h(e,r){_.julianDate=e;var i=m.leapSeconds,n=t(i,_,c);if(n<0&&(n=~n),0===n)return m.addSeconds(e,-i[0].offset,r);if(n>=i.length)return m.addSeconds(e,-i[n-1].offset,r);var o=m.secondsDifference(i[n].julianDate,e);return 0===o?m.addSeconds(e,-i[n].offset,r):o<=1?void 0:m.addSeconds(e,-i[--n].offset,r)}function p(e,t,r){var i=t/l.SECONDS_PER_DAY|0;return e+=i,t-=l.SECONDS_PER_DAY*i,t<0&&(e--,t+=l.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function f(e,t,r,i,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+r-32075;(i-=12)<0&&(i+=24);var d=o+(i*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return d>=43200&&(c-=1),[c,d]}function m(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),i=r(i,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),i===u.UTC&&d(this)}var g=new o,v=[31,28,31,30,31,30,31,31,30,31,30,31],_=new s,y=/^(\d{4})$/,b=/^(\d{4})-(\d{2})$/,C=/^(\d{4})-?(\d{3})$/,w=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,E=/^(\d{2})(\.\d+)?/.source+T.source,x=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;m.fromGregorianDate=function(e,t){var r=f(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return i(t)?(p(r[0],r[1],t),d(t),t):new m(r[0],r[1],u.UTC)},m.fromDate=function(e,t){var r=f(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(p(r[0],r[1],t),d(t),t):new m(r[0],r[1],u.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,n,o,s=e.split("T"),l=1,c=1,h=0,g=0,_=0,T=0,A=s[0],D=s[1];if(null!==(s=A.match(S)))r=+s[1],l=+s[2],c=+s[3];else if(null!==(s=A.match(b)))r=+s[1],l=+s[2];else if(null!==(s=A.match(y)))r=+s[1];else{var I;if(null!==(s=A.match(C)))r=+s[1],I=+s[2],o=a(r);else if(null!==(s=A.match(w))){r=+s[1];var O=+s[2],M=+s[3]||0,R=new Date(Date.UTC(r,0,4));I=7*O+M-R.getUTCDay()-3}n=new Date(Date.UTC(r,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(r);var L;if(i(D)){s=D.match(P),null!==s?(h=+s[1],g=+s[2],_=+s[3],T=1e3*+(s[4]||0),L=5):(s=D.match(x),null!==s?(h=+s[1],g=+s[2],_=60*+(s[3]||0),L=4):null!==(s=D.match(E))&&(h=+s[1],g=60*+(s[2]||0),L=3));var N=s[L],k=+s[L+1],F=+(s[L+2]||0);switch(N){case"+":h-=k,g-=F;break;case"-":h+=k,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,c,h,g)).getTimezoneOffset()}}var B=60===_;for(B&&_--;g>=60;)g-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?29:v[l-1];c>n;)c-=n,l++,l>12&&(l-=12,r++),n=o&&2===l?29:v[l-1];for(;g<0;)g+=60,h--;for(;h<0;)h+=24,c--;for(;c<1;)l--,l<1&&(l+=12,r--),n=o&&2===l?29:v[l-1],c+=n;var U=f(r,l,c,h,g,_,T);return i(t)?(p(U[0],U[1],t),d(t)):t=new m(U[0],U[1],u.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var A=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var r=!1,n=h(e,A);i(n)||(m.addSeconds(e,-1,A),n=h(A,A),r=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var d=4e3*(u+1)/1461001|0;u=u-(1461*d/4|0)+31|0;var p=80*u/2447|0,f=u-(2447*p/80|0)|0;u=p/11|0;var g=p+2-12*u|0,v=100*(c-49)+d+u|0,_=s/l.SECONDS_PER_HOUR|0,y=s-_*l.SECONDS_PER_HOUR,b=y/l.SECONDS_PER_MINUTE|0;y-=b*l.SECONDS_PER_MINUTE;var C=0|y,w=(y-C)/l.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(C+=1),i(t)?(t.year=v,t.month=g,t.day=f,t.hour=_,t.minute=b,t.second=C,t.millisecond=w,t.isLeapSecond=r,t):new o(v,g,f,_,b,C,w,r)},m.toDate=function(e){var t=m.toGregorianDate(e,g),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var n,o=m.toGregorianDate(t,g);return i(r)||0===o.millisecond?i(r)&&0!==r?(n=(.01*o.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},m.clone=function(e,t){if(i(e))return i(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,u.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||i(e)&&i(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},m.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY},m.computeTaiMinusUtc=function(e){_.julianDate=e;var r=m.leapSeconds,i=t(r,_,c);return i<0&&(i=~i,--i<0&&(i=0)),r[i].offset},m.addSeconds=function(e,t,r){return p(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,i,r)},m.addHours=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,i,r)},m.addDays=function(e,t,r){return p(e.dayNumber+t,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)}, m.leapSeconds=[new s(new m(2441317,43210,u.TAI),10),new s(new m(2441499,43211,u.TAI),11),new s(new m(2441683,43212,u.TAI),12),new s(new m(2442048,43213,u.TAI),13),new s(new m(2442413,43214,u.TAI),14),new s(new m(2442778,43215,u.TAI),15),new s(new m(2443144,43216,u.TAI),16),new s(new m(2443509,43217,u.TAI),17),new s(new m(2443874,43218,u.TAI),18),new s(new m(2444239,43219,u.TAI),19),new s(new m(2444786,43220,u.TAI),20),new s(new m(2445151,43221,u.TAI),21),new s(new m(2445516,43222,u.TAI),22),new s(new m(2446247,43223,u.TAI),23),new s(new m(2447161,43224,u.TAI),24),new s(new m(2447892,43225,u.TAI),25),new s(new m(2448257,43226,u.TAI),26),new s(new m(2448804,43227,u.TAI),27),new s(new m(2449169,43228,u.TAI),28),new s(new m(2449534,43229,u.TAI),29),new s(new m(2450083,43230,u.TAI),30),new s(new m(2450630,43231,u.TAI),31),new s(new m(2451179,43232,u.TAI),32),new s(new m(2453736,43233,u.TAI),33),new s(new m(2454832,43234,u.TAI),34),new s(new m(2456109,43235,u.TAI),35),new s(new m(2457204,43236,u.TAI),36),new s(new m(2457754,43237,u.TAI),37)],m}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r){var i=new e(r);i.normalize();var n=i.getAuthority();if(t(n)){if(-1!==n.indexOf("@")){n=n.split("@")[1]}if(-1===n.indexOf(":")){var o=i.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)n+=":80";else{if("https"!==o)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])||(o[i]=!0)},n.remove=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])&&delete o[i]},n.contains=function(e){var r=i(e);return!(!t(r)||!t(o[r]))},n.clear=function(){o={}},n}),define("Core/loadWithXhr",["../ThirdParty/when","./Check","./defaultValue","./defined","./DeveloperError","./Request","./RequestErrorEvent","./RequestScheduler","./RuntimeError","./TrustedServers"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){t=r(t,r.EMPTY_OBJECT);var n=t.url,a=t.responseType,l=r(t.method,"GET"),u=t.data,d=t.headers,h=t.overrideMimeType;n=r(n,t.url);var p=i(t.request)?t.request:new o;return p.url=n,p.requestFunction=function(){var t=e.defer(),r=c.load(n,a,l,u,d,t,h);return i(r)&&i(r.abort)&&(p.cancelFunction=function(){r.abort()}),t.promise},s.request(p)}function d(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function h(e,t){for(var r=d(e,t),i=new ArrayBuffer(r.length),n=new Uint8Array(i),o=0;o=300)&&(!g||0!==h.status))return void s.reject(new a(h.status,h.response,h.getAllResponseHeaders()));var e=h.response,r=h.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===r||"document"===r)&&i(h.responseXML)&&h.responseXML.hasChildNodes()?s.resolve(h.responseXML):""!==r&&"text"!==r||!i(h.responseText)?s.reject(new l("Invalid XMLHttpRequest response type.")):s.resolve(h.responseText);else s.resolve(e)},h.onerror=function(e){s.reject(new a)},h.send(n),h},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r,i){return e({url:t,headers:r,request:i})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,i){"use strict";function n(r,n,a){t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o;var s=i(r,n,a);if(t(s))return s.then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),i(t.data))f(this,t.data);else if(i(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){f(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else f(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function f(e,r){if(!i(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!i(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=r.columnNames.indexOf("modifiedJulianDateUtc"),o=r.columnNames.indexOf("xPoleWanderRadians"),l=r.columnNames.indexOf("yPoleWanderRadians"),u=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||h<0||f<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var g=e._samples=r.samples,v=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,b=0,C=g.length;bt.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||i.equals(u))return m(e,r,n,l,s),s;if(i.equals(c))return m(e,r,o,l,s),s;var d=a.secondsDifference(i,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=r[h+e._ut1MinusUtcSecondsColumn],v=r[p+e._ut1MinusUtcSecondsColumn],_=v-f;if(_>.5||_<-.5){var y=r[h+e._taiMinusUtcSecondsColumn],b=r[p+e._taiMinusUtcSecondsColumn];y!==b&&(c.equals(i)?f=v:v-=b-y)}return s.xPoleWander=g(d,r[h+e._xPoleWanderRadiansColumn],r[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=g(d,r[h+e._yPoleWanderRadiansColumn],r[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=g(d,r[h+e._xCelestialPoleOffsetRadiansColumn],r[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=g(d,r[h+e._yCelestialPoleOffsetRadiansColumn],r[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=g(d,f,v),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(i(this._samples)){if(i(r)||(r=new n(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!i(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,v(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(g=this._totalSamples&&(l=this._totalSamples-1);for(var d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,r){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,(l=d-s)<0&&(l=0));var h=!1,p=this._samples;if(i(p[3*l])||(c(this,l/this._samplesPerXysFile|0),h=!0),i(p[3*d])||(c(this,d/this._samplesPerXysFile|0),h=!0),!h){i(r)?(r.x=0,r.y=0,r.s=0):r=new n(0,0,0);var f,m,g=o-l*this._stepSizeDays,v=this._work,_=this._denominators,y=this._coef,b=this._xTable;for(f=0;f<=s;++f)v[f]=g-b[f];for(f=0;f<=s;++f){for(y[f]=1,m=0;m<=s;++m)m!==f&&(y[f]*=v[m]);y[f]*=_[f];var C=3*(l+f);r.x+=y[f]*p[C++],r.y+=y[f]*p[C++],r.s+=y[f]*p[C]}return r}}}},l}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(i,0)}return n.fromQuaternion=function(e,r){t(r)||(r=new n);var i=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),l=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(l,s),r.roll=Math.atan2(a,o),r.pitch=-Math.asin(i),r},n.fromDegrees=function(e,r,o,a){return t(a)||(a=new n),a.heading=e*i.RADIANS_PER_DEGREE,a.pitch=r*i.RADIANS_PER_DEGREE,a.roll=o*i.RADIANS_PER_DEGREE,a},n.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},n.equalsEpsilon=function(e,r,n,o){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.heading,r.heading,n,o)&&i.equalsEpsilon(e.pitch,r.pitch,n,o)&&i.equalsEpsilon(e.roll,r.roll,n,o)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t,r){return n.equalsEpsilon(this,e,t,r)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.z=r(i,0),this.w=r(n,0)}var c=new e;u.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);c=e.normalize(t,c);var s=c.x*a,l=c.y*a,d=c.z*a,h=Math.cos(o);return i(n)?(n.x=s,n.y=l,n.z=d,n.w=h,n):new u(s,l,d,h)};var d=[1,2,0],h=new Array(3);u.fromRotationMatrix=function(e,t){var r,n,o,a,s,c=e[l.COLUMN0ROW0],p=e[l.COLUMN1ROW1],f=e[l.COLUMN2ROW2],m=c+p+f;if(m>0)r=Math.sqrt(m+1),s=.5*r,r=.5/r,n=(e[l.COLUMN1ROW2]-e[l.COLUMN2ROW1])*r,o=(e[l.COLUMN2ROW0]-e[l.COLUMN0ROW2])*r,a=(e[l.COLUMN0ROW1]-e[l.COLUMN1ROW0])*r;else{var g=d,v=0;p>c&&(v=1),f>c&&f>p&&(v=2);var _=g[v],y=g[_];r=Math.sqrt(e[l.getElementIndex(v,v)]-e[l.getElementIndex(_,_)]-e[l.getElementIndex(y,y)]+1);var b=h;b[v]=.5*r,r=.5/r,s=(e[l.getElementIndex(y,_)]-e[l.getElementIndex(_,y)])*r,b[_]=(e[l.getElementIndex(_,v)]+e[l.getElementIndex(v,_)])*r,b[y]=(e[l.getElementIndex(y,v)]+e[l.getElementIndex(v,y)])*r,n=-b[0],o=-b[1],a=-b[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new u(n,o,a,s)};var p=new u,f=new u,m=new u,g=new u;u.fromHeadingPitchRoll=function(t,r){return g=u.fromAxisAngle(e.UNIT_X,t.roll,p),m=u.fromAxisAngle(e.UNIT_Y,-t.pitch,r),r=u.multiply(m,g,m),f=u.fromAxisAngle(e.UNIT_Z,-t.heading,p),u.multiply(f,r,r)};var v=new e,_=new e,y=new u,b=new u,C=new u;u.packedLength=4,u.pack=function(e,t,i){return i=r(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},u.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new u),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,r,i){u.unpack(e,4*r,C),u.conjugate(C,C);for(var n=0,o=r-t+1;n=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-r,l=r*r,c=s*s,d=7;d>=0;--d)L[d]=(M[d]*l-R[d])*a,N[d]=(M[d]*c-R[d])*a;var h=n*r*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),p=s*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),f=u.multiplyByScalar(e,p,I);return u.multiplyByScalar(t,h,i),u.add(f,i,i)},u.fastSquad=function(e,t,r,i,n,o){var a=u.fastSlerp(e,t,n,A),s=u.fastSlerp(r,i,n,D);return u.fastSlerp(a,s,2*n*(1-n),o)},u.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},u.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},u.ZERO=o(new u(0,0,0,0)),u.IDENTITY=o(new u(0,0,0,1)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},u}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";var b={},C={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},w={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},S={},T={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},E=new r,x=new r,P=new r;b.localFrameToFixedFrameGenerator=function(e,t){if(!C.hasOwnProperty(e)||!C[e].hasOwnProperty(t))throw new l("firstAxis and secondAxis must be east, north, up, west, south or down.");var i,n=C[e][t],o=e+t;return s(S[o])?i=S[o]:(i=function(i,o,l){if(s(l)||(l=new v),m.equalsEpsilon(i.x,0,m.EPSILON14)&&m.equalsEpsilon(i.y,0,m.EPSILON14)){var u=m.sign(i.z);r.unpack(w[e],0,E),"east"!==e&&"west"!==e&&r.multiplyByScalar(E,u,E),r.unpack(w[t],0,x),"east"!==t&&"west"!==t&&r.multiplyByScalar(x,u,x),r.unpack(w[n],0,P),"east"!==n&&"west"!==n&&r.multiplyByScalar(P,u,P)}else{o=a(o,d.WGS84),o.geodeticSurfaceNormal(i,T.up);var c=T.up,h=T.east;h.x=-i.y,h.y=i.x,h.z=0,r.normalize(h,T.east),r.cross(c,h,T.north),r.multiplyByScalar(T.up,-1,T.down),r.multiplyByScalar(T.east,-1,T.west),r.multiplyByScalar(T.north,-1,T.south),E=T[e],x=T[t],P=T[n]}return l[0]=E.x,l[1]=E.y,l[2]=E.z,l[3]=0,l[4]=x.x,l[5]=x.y,l[6]=x.z,l[7]=0,l[8]=P.x,l[9]=P.y,l[10]=P.z,l[11]=0,l[12]=i.x,l[13]=i.y,l[14]=i.z,l[15]=1,l},S[o]=i),i},b.eastNorthUpToFixedFrame=b.localFrameToFixedFrameGenerator("east","north"),b.northEastDownToFixedFrame=b.localFrameToFixedFrameGenerator("north","east"),b.northUpEastToFixedFrame=b.localFrameToFixedFrameGenerator("north","up"),b.northWestUpToFixedFrame=b.localFrameToFixedFrameGenerator("north","west");var A=new _,D=new r(1,1,1),I=new v;b.headingPitchRollToFixedFrame=function(e,t,i,n,o){n=a(n,b.eastNorthUpToFixedFrame);var s=_.fromHeadingPitchRoll(t,A),l=v.fromTranslationQuaternionRotationScale(r.ZERO,s,D,I);return o=n(e,i,o),v.multiply(o,l,o)};var O=new v,M=new g;b.headingPitchRollQuaternion=function(e,t,r,i,n){var o=b.headingPitchRollToFixedFrame(e,t,r,i,O),a=v.getRotation(o,M);return _.fromRotationMatrix(a,n)};var R=m.TWO_PI/86400,L=new f;b.computeTemeToPseudoFixedMatrix=function(e,t){L=f.addSeconds(e,-f.computeTaiMinusUtc(e),L);var r,i=L.dayNumber,n=L.secondsOfDay,o=i-2451545;r=n>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var a=24110.54841+r*(8640184.812866+r*(.093104+-62e-7*r)),l=a*R%m.TWO_PI,u=72921158553e-15+1.1772758384668e-19*(i-2451545.5),c=(n+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,d=l+u*c,h=Math.cos(d),p=Math.sin(d);return s(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(h,p,0,-p,h,0,0,0,1)},b.iau2006XysData=new h,b.earthOrientationParameters=u.NONE;b.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+32.184,n=t.stop.dayNumber,o=t.stop.secondsOfDay+32.184,a=b.iau2006XysData.preload(r,i,n,o),s=b.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},b.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var r=b.computeFixedToIcrfMatrix(e,t);if(s(r))return g.transpose(r,t)};var N=new p(0,0,0),k=new c(0,0,0,0,0,0),F=new g,B=new g;b.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var r=b.earthOrientationParameters.compute(e,k);if(s(r)){var i=e.dayNumber,n=e.secondsOfDay+32.184,o=b.iau2006XysData.computeXysRadians(i,n,N);if(s(o)){var a=o.x+r.xPoleOffset,l=o.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=F;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var d=g.fromRotationZ(-o.s,B),h=g.multiply(c,d,F),p=e.dayNumber,v=e.secondsOfDay-f.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=p-2451545,C=v/y.SECONDS_PER_DAY,w=.779057273264+C+.00273781191135448*(_+C);w=w%1*m.TWO_PI;var S=g.fromRotationZ(w,B),T=g.multiply(h,S,F),E=Math.cos(r.xPoleWander),x=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),D=i-2451545+n/y.SECONDS_PER_DAY;D/=36525;var I=-47e-6*D*m.RADIANS_PER_DEGREE/3600,O=Math.cos(I),M=Math.sin(I),R=B;return R[0]=E*O,R[1]=E*M,R[2]=P,R[3]=-x*M+A*P*O,R[4]=x*O+A*P*M,R[5]=-A*E,R[6]=-A*M-x*P*O,R[7]=A*O-x*P*M,R[8]=x*E,g.multiply(T,R,t)}}};var U=new i;b.pointToWindowCoordinates=function(e,t,r,i){return i=b.pointToGLWindowCoordinates(e,t,r,i),i.y=2*t[5]-i.y,i},b.pointToGLWindowCoordinates=function(e,r,n,o){s(o)||(o=new t);var a=U;return v.multiplyByVector(e,i.fromElements(n.x,n.y,n.z,1,a),a),i.multiplyByScalar(a,1/a.w,a),v.multiplyByVector(r,a,a),t.fromCartesian4(a,o)};var V=new r,z=new r,G=new r;b.rotationMatrixFromPositionVelocity=function(e,t,i,n){var o=a(i,d.WGS84).geodeticSurfaceNormal(e,V),l=r.cross(t,o,z);r.equalsEpsilon(l,r.ZERO,m.EPSILON6)&&(l=r.clone(r.UNIT_X,l));var u=r.cross(l,t,G);return r.cross(t,u,l),r.negate(l,l),s(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var H=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),W=new n,j=new r,q=new r,Y=new g,X=new v,Q=new v;return b.basisTo2D=function(e,t,i){var n=v.getTranslation(t,q),o=e.ellipsoid,a=o.cartesianToCartographic(n,W),s=e.project(a,j);r.fromElements(s.z,s.x,s.y,s);var l=b.eastNorthUpToFixedFrame(n,o,X),u=v.inverseTransformation(l,Q),c=v.getRotation(t,Y),d=v.multiplyByMatrix3(u,c,i);return v.multiply(H,d,i),v.setTranslation(i,s,i),i},b.wgs84To2DModelMatrix=function(e,t,i){var n=e.ellipsoid,o=b.eastNorthUpToFixedFrame(t,n,X),a=v.inverseTransformation(o,Q),s=n.cartesianToCartographic(t,W),l=e.project(s,j);r.fromElements(l.z,l.x,l.y,l);var u=v.fromTranslation(l,X);return v.multiply(H,a,i),v.multiply(u,i,i),i},b}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var i=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(c.getColumn(i,0,m)),this._yAxis=r.fromCartesian4(c.getColumn(i,1,m));var o=r.fromCartesian4(c.getColumn(i,2,m));this._plane=d.fromPointNormal(e,o)}var m=new i;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var g=new e;f.fromPoints=function(t,r){return new f(e.fromPoints(t,g).center,r)};var v=new h,_=new r;f.prototype.projectPointOntoPlane=function(e,i){var n=v;n.origin=e,r.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,_);if(o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,_)),o(a)){var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return o(i)?(i.x=l,i.y=c,i):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var r=0,i=e.length,n=0;n0?0:a.latitude;C.latitude=b.latitude=y.latitude=e.south,w.latitude=_.latitude=T,h.latitude=m.latitude=v.latitude=e.north,C.longitude=w.longitude=h.longitude=e.west,b.longitude=m.longitude=S,y.longitude=_.longitude=v.longitude=e.east,v.height=m.height=h.height=w.height=C.height=b.height=y.height=_.height=r,i.cartographicArrayToCartesianArray(D,I),c.projectPointsToNearestOnPlane(I,O);var E=Math.min(O[6].x,O[7].x,O[0].x),x=Math.max(O[2].x,O[3].x,O[4].x),M=Math.min(O[4].y,O[5].y,O[6].y),R=Math.max(O[0].y,O[1].y,O[2].y);return v.height=h.height=y.height=C.height=t,i.cartographicArrayToCartesianArray(D,I),g(c,E,x,M,R,Math.min(p.getPointDistance(d,I[0]),p.getPointDistance(d,I[2]),p.getPointDistance(d,I[4]),p.getPointDistance(d,I[6])),r,o)},m.clone=function(e,t){if(o(e))return o(t)?(r.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var i=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[h.COLUMN0ROW0]+s*o[h.COLUMN0ROW1]+l*o[h.COLUMN0ROW2])+Math.abs(a*o[h.COLUMN1ROW0]+s*o[h.COLUMN1ROW1]+l*o[h.COLUMN1ROW2])+Math.abs(a*o[h.COLUMN2ROW0]+s*o[h.COLUMN2ROW1]+l*o[h.COLUMN2ROW2]),d=r.dot(n,i)+t.distance ;return d<=-c?u.OUTSIDE:d>=c?u.INSIDE:u.INTERSECTING};var M=new r,R=new r,L=new r,N=new r;m.distanceSquaredTo=function(e,t){var i=r.subtract(t,e.center,E),n=e.halfAxes,o=h.getColumn(n,0,M),a=h.getColumn(n,1,R),s=h.getColumn(n,2,L),l=r.magnitude(o),u=r.magnitude(a),c=r.magnitude(s);r.normalize(o,o),r.normalize(a,a),r.normalize(s,s);var d=N;d.x=r.dot(i,o),d.y=r.dot(i,a),d.z=r.dot(i,s);var p,f=0;return d.x<-l?(p=d.x+l,f+=p*p):d.x>l&&(p=d.x-l,f+=p*p),d.y<-u?(p=d.y+u,f+=p*p):d.y>u&&(p=d.y-u,f+=p*p),d.z<-c?(p=d.z+c,f+=p*p):d.z>c&&(p=d.z-c,f+=p*p),f};var k=new r,F=new r;m.computePlaneDistances=function(e,t,i,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,d=h.getColumn(u,0,M),p=h.getColumn(u,1,R),f=h.getColumn(u,2,L),m=r.add(d,p,k);r.add(m,f,m),r.add(m,l,m);var g=r.subtract(m,t,F),v=r.dot(i,g);return a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.add(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.subtract(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.subtract(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.add(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.add(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.subtract(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.subtract(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),n.start=a,n.stop=s,n};var B=new e;return m.isOccluded=function(t,r){var i=e.fromOrientedBoundingBox(t,B);return!r.isBoundingSphereVisible(i)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,r){return m.computePlaneDistances(this,e,t,r)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||o(e)&&o(t)&&r.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";return e({NONE:0,BITS12:1})}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,a,u,h){var g,v,_,y;if(o(e)&&o(t)&&o(i)&&o(a)){var b=e.minimum,C=e.maximum,w=r.subtract(C,b,d),S=i-t;g=Math.max(r.maximumComponent(w),S)l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var _=new i,y=new d,b=new i,C=new i;return v.computeVertices=function(a){var u,w,S,T,E=Math.cos,x=Math.sin,P=Math.sqrt,A=Math.atan,D=Math.exp,I=c.PI_OVER_TWO,O=c.toRadians,M=a.heightmap,R=a.width,L=a.height,N=a.skirtHeight,k=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,U=a.nativeRectangle,V=a.rectangle;o(V)?(u=V.west,w=V.south,S=V.east,T=V.north):k?(u=O(U.west),w=O(U.south),S=O(U.east),T=O(U.north)):(u=U.west*B,w=I-2*A(D(-U.south*B)),S=U.east*B,T=I-2*A(D(-U.north*B)));var z=a.relativeToCenter,G=o(z);z=G?z:i.ZERO;var H=n(a.exaggeration,1),W=n(a.includeWebMercatorT,!1),j=n(a.structure,v.DEFAULT_STRUCTURE),q=n(j.heightScale,v.DEFAULT_STRUCTURE.heightScale),Y=n(j.heightOffset,v.DEFAULT_STRUCTURE.heightOffset),X=n(j.elementsPerHeight,v.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(j.stride,v.DEFAULT_STRUCTURE.stride),Z=n(j.elementMultiplier,v.DEFAULT_STRUCTURE.elementMultiplier),K=n(j.isBigEndian,v.DEFAULT_STRUCTURE.isBigEndian),J=p.computeWidth(U),$=p.computeHeight(U),ee=J/(R-1),te=$/(L-1);k||(J*=B,$*=B);var re,ie,ne=F.radiiSquared,oe=ne.x,ae=ne.y,se=ne.z,le=65536,ue=-65536,ce=m.eastNorthUpToFixedFrame(z,F),de=d.inverseTransformation(ce,y);W&&(re=g.geodeticLatitudeToMercatorAngle(w),ie=1/(g.geodeticLatitudeToMercatorAngle(T)-re));var he=b;he.x=Number.POSITIVE_INFINITY,he.y=Number.POSITIVE_INFINITY,he.z=Number.POSITIVE_INFINITY;var pe=C;pe.x=Number.NEGATIVE_INFINITY,pe.y=Number.NEGATIVE_INFINITY,pe.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,me=R+(N>0?2:0),ge=L+(N>0?2:0),ve=me*ge,_e=new Array(ve),ye=new Array(ve),be=new Array(ve),Ce=W?new Array(ve):[],we=0,Se=L,Te=0,Ee=R;N>0&&(--we,++Se,--Te,++Ee);for(var xe=0,Pe=we;Pe=L&&(Ae=L-1);var De=U.north-te*Ae;De=k?O(De):I-2*A(D(-De*B));var Ie=E(De),Oe=x(De),Me=se*Oe,Re=(De-w)/(T-w);Re=c.clamp(Re,0,1);var Le;W&&(Le=(g.geodeticLatitudeToMercatorAngle(De)-re)*ie);for(var Ne=Te;Ne=R&&(ke=R-1);var Fe=U.west+ee*ke;k?Fe=O(Fe):Fe*=B;var Be,Ue=Ae*(R*Q)+ke*Q;if(1===X)Be=M[Ue];else{Be=0;var Ve;if(K)for(Ve=0;Ve=0;--Ve)Be=Be*Z+M[Ue+Ve]}Be=(Be*q+Y)*H;var ze=(Fe-u)/(S-u);if(ze=c.clamp(ze,0,1),be[xe]=new r(ze,Re),ue=Math.max(ue,Be),le=Math.min(le,Be),Ne!==ke||Pe!==Ae){Ne<0?Fe-=1e-5*J:Fe+=1e-5*J,Pe<0?De+=1e-5*$:De-=1e-5*$,Ie=E(De),Oe=x(De),Me=se*Oe,Be-=N}var Ge=Ie*E(Fe),He=Ie*x(Fe),We=oe*Ge,je=ae*He,qe=P(We*Ge+je*He+Me*Oe),Ye=1/qe,Xe=We*Ye,Qe=je*Ye,Ze=Me*Ye,Ke=new i;Ke.x=Xe+Ge*Be,Ke.y=Qe+He*Be,Ke.z=Ze+Oe*Be,_e[xe]=Ke,ye[xe]=Be,W&&(Ce[xe]=Le),xe++,d.multiplyByPoint(de,Ke,_),i.minimumByComponent(_,he,he),i.maximumByComponent(_,pe,pe),fe=Math.min(fe,Be)}}var Je,$e=t.fromPoints(_e);o(V)&&V.width=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){i(r)?o||(r.length=0):r=v;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},r),s.promise})}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},m._defaultWorkerModulePrefix="Workers/",m._workerModulePrefix=m._defaultWorkerModulePrefix,m._loaderConfig=void 0,m._canTransferArrayBuffer=void 0,m}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,r,i,n,o,a,s,l,u,c,d){this.center=t,this.vertices=r,this.stride=e(l,6),this.indices=i,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(){r.throwInstantiationError()}t(n.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},hasWaterMask:{get:r.throwInstantiationError},hasVertexNormals:{get:r.throwInstantiationError},availability:{get:r.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,r){var i=o[t];e(i)||(o[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array((t-1)*(r-1)*6);for(var a=0,s=0,l=0;l=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var _=c-h,y=d-f;return f=s-1-f,m=s-1-m,g(_,y,v(e,t,r,i,n,f*a+h),v(e,t,r,i,n,f*a+p),v(e,t,r,i,n,m*a+h),v(e,t,r,i,n,m*a+p))}function m(e,t,r,i,n,o,a,s,l,u,c){var d=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(d+=1,h+=1,a+=2,s+=2);var p=n>0?a-1:a,f=0|d,m=f+1;m>=p&&(m=a-1,f=a-2);var v=n>0?s-1:s,_=0|h,y=_+1;y>=v&&(y=s-1,_=s-2);var b=d-f,C=h-_;return _=s-1-_,y=s-1-y,g(b,C,(t.decodeHeight(e,_*a+f)/c-r)/i,(t.decodeHeight(e,_*a+m)/c-r)/i,(t.decodeHeight(e,y*a+f)/c-r)/i,(t.decodeHeight(e,y*a+m)/c-r)/i)}function g(e,t,r,i,n,o){return t=0;--a)s=s*r+e[o+a];return s}function _(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;l0;--l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;e[a+l]=s}i(p.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(i,n,a,s,u){var p=i.ellipsoid,f=i.tileXYToNativeRectangle(n,a,s),m=i.tileXYToRectangle(n,a,s);u=t(u,1);var g=p.cartographicToCartesian(l.center(m)),v=this._structure,_=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,i.getNumberOfXTilesAtLevel(0)),b=_/(1<d.highestEncodedHeight?d.highestEncodedHeight:L,_(g,x,P,D,f,A,I*u+M,L)}return new p({buffer:g,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},r(o)}),define("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,r,i){return e({url:t,responseType:"arraybuffer",headers:r,request:i})}return t}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=ie,l=n>e,u=o>e);var c,d,h,p,f,m,g=s+l+u;return 1===g?s?(c=(e-i)/(n-i),d=(e-i)/(o-i),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(i-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(i-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===g?s||i===e?l||n===e?u||o===e||(d=(e-i)/(o-i),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(i-n),f=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==g&&(a.push(0),a.push(1),a.push(2)),a},i.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),g=i-u,v=r-l,_=(p*v+h*g)*m,y=(-f*v+d*g)*m,b=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=b,c):new e(_,y,b)},i}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function r(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;var i=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,i),a=this._vValues=this._quantizedVertices.subarray(i,2*i);this._heightValues=this._quantizedVertices.subarray(2*i,3*i),this._westIndices=g(e.westIndices,t,i),this._southIndices=g(e.southIndices,r,i),this._eastIndices=g(e.eastIndices,t,i),this._northIndices=g(e.northIndices,r,i),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function g(e,t,r){y.length=e.length;for(var i=!1,n=0,o=e.length;n0&&t(e[n-1],e[n])>0;return i?(y.sort(t),l.createTypedArray(r,y)):e}function v(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function _(e,t,r){for(var i=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var C=b.x*o[d]+b.y*o[h]+b.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,C/w)}}}a(m.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});var y=[],b=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,r,i,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(r,i,a);s=n(s,1);var d=b.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var r=l.createTypedArray(t,e.indices),i=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,g=e.vertexStride,v=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,i,r,a,u,c,m,g,d,v,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var C=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(r,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,g=2*a===c,v=r.ellipsoid,_=r.tileXYToRectangle(u,c,h),y=C.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:g,childRectangle:_,ellipsoid:v,exaggeration:p.exaggeration});if(o(y)){var b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);var w=f?.5*b:this._westSkirtHeight,S=g?.5*b:this._southSkirtHeight,T=f?this._eastSkirtHeight:.5*b,E=g?this._northSkirtHeight:.5*b;return e(y,function(e){var r,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(r=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:n,indices:a,encodedNormals:r,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:d.clone(e.orientedBoundingBox),horizonOcclusionPoint:i.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:w,southSkirtHeight:S,eastSkirtHeight:T,northSkirtHeight:E,childTileMask:0,createdByUpsampling:!0})})}}};var w=32767,S=new i;m.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1);i*=w;var n=c.clamp((r-e.south)/e.height,0,1);return n*=w,o(this._mesh)?v(this,i,n):_(this,i,n)};var T=new r,E=new r,x=new r;return m.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,r){for(var i=0,n=!1;!n;){var o=t._nw&&p(t._nw.extent,r),a=t._ne&&p(t._ne.extent,r),s=t._sw&&p(t._sw.extent,r),l=t._se&&p(t._se.extent,r);if(o+a+s+l>1){o&&(i=Math.max(i,f(t,t._nw,r))),a&&(i=Math.max(i,f(t,t._ne,r))),s&&(i=Math.max(i,f(t,t._sw,r))),l&&(i=Math.max(i,f(t,t._se,r)));break}o?t=t._nw:a?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;c>=0&&u[c].level>i;--c){var d=u[c];p(d,r)&&(i=d.level)}t=t.parent}return i}function m(e,t,r){if(t){var i,n=!1;for(i=0;it.east&&r.push(new o(t.east,n.south,n.east,n.north)),n.southt.north&&r.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):r.push(n)}return r}var v=new o;a.prototype.addAvailableTileRange=function(e,t,r,i,n){var o=this._tilingScheme;o.tileXYToRectangle(t,r,e,v);var a=v.west,s=v.north;o.tileXYToRectangle(i,n,e,v);for(var d=v.east,h=v.south,p=new l(e,a,h,d,s),f=0;f=0;--n)if(r(i[n])&&0===i[n].length)return n;return 0};var w=new t;return a.prototype.isTileAvailable=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(t,r,e,v);return o.center(i,w),this.computeMaximumLevelAtPosition(w)>=e},a.prototype.computeChildMaskForTile=function(e,t,r){var i=e+1;if(i>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(i,2*t,2*r+1)?1:0,n|=this.isTileAvailable(i,2*t+1,2*r+1)?2:0,n|=this.isTileAvailable(i,2*t,2*r)?4:0,n|=this.isTileAvailable(i,2*t+1,2*r)?8:0},i(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,r){"use strict";function i(t,r,i,n,o,a,s){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return i.handleError=function(e,n,o,a,s,l,u,c,d){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,h.error=d,++h.timesRetried):h=new i(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Request","./RequestType","./RuntimeError","./TerrainProvider","./TileAvailability","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T){"use strict";function E(e){this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.littleEndianExtensionSize=e.littleEndianExtensionSize}function x(r){function i(r){var n;if(!r.format)return n="The tile format is not specified in the layer.json file.",void(_=T.handleError(_,y,y._errorEvent,n,void 0,void 0,void 0,h));if(!r.tiles||0===r.tiles.length)return n="The layer.json file does not specify any tile URL templates.",void(_=T.handleError(_,y,y._errorEvent,n,void 0,void 0,void 0,h));var o=!1,l=!1,u=!0,c=!1;if("heightmap-1.0"===r.format)c=!0,a(y._heightmapStructure)||(y._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),l=!0,y._requestWaterMask=!0;else if(0!==r.format.indexOf("quantized-mesh-1."))return n='The tile format "'+r.format+'" is invalid or not supported.',void(_=T.handleError(_,y,y._errorEvent,n,void 0,void 0,void 0,h));for(var d=r.tiles,f=0;f0&&(C+=" "),C+=r.attribution),b.push(new E({isHeightmap:c,tileUrlTemplates:d,availability:A,hasVertexNormals:o,hasWaterMask:l,littleEndianExtensionSize:u}));var F=r.parentUrl;if(a(F)){if(!a(A))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),t.resolve();g=p(g,F),v=p(g,"layer.json"),a(y._proxy)&&(v=y._proxy.getURL(v));var B=m(v);return t(B,i,s)}return t.resolve()}function s(e){var t="An error occurred while accessing "+v+".";_=T.handleError(_,y,y._errorEvent,t,void 0,void 0,void 0,h)}function l(e){i(e).then(function(){if(!a(_)){var e=x.length;if(e>0)for(var t=y._availability=new S(y._tilingScheme,e),r=0;r0&&(y._credit=new n(C)),y._ready=!0,y._readyPromise.resolve(!0)}})}function d(e){if(a(e)&&404===e.statusCode)return void l({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});s(e)}function h(){var e=m(v);t(e,l,d)}this._url=r.url,this._proxy=r.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=w.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(r.requestVertexNormals,!1),this._requestWaterMask=o(r.requestWaterMask,!1),this._errorEvent=new u;var f=r.credit;"string"==typeof f&&(f=new n(f)),this._credit=f,this._availability=void 0,this._ready=!1,this._readyPromise=t.defer();var g=this._url,v=p(this._url,"layer.json");a(this._proxy)&&(v=this._proxy.getURL(v));var _,y=this,b=this._layers=[],C="",x=[];h()}function P(e){return a(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function A(e,t,r,i,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new d({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function D(e,t,n,o,a,s,l){function u(e){return e>>1^-(1&e)}var c=0,d=3*Float64Array.BYTES_PER_ELEMENT,p=4*Float64Array.BYTES_PER_ELEMENT,f=3*Uint16Array.BYTES_PER_ELEMENT,m=Uint16Array.BYTES_PER_ELEMENT,y=3*m,b=new DataView(t),C=new i(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0));c+=d;var w=b.getFloat32(c,!0);c+=Float32Array.BYTES_PER_ELEMENT;var S=b.getFloat32(c,!0);c+=Float32Array.BYTES_PER_ELEMENT;var T=new r(new i(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0)),b.getFloat64(c+d,!0));c+=p;var E=new i(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0));c+=d;var x=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var P=new Uint16Array(t,c,3*x);c+=x*f,x>65536&&(m=Uint32Array.BYTES_PER_ELEMENT,y=3*m);var A,D=P.subarray(0,x),O=P.subarray(x,2*x),M=P.subarray(2*x,3*x),R=0,L=0,N=0;for(A=0;A1;--P){if(x=t.PI_OVER_TWO-(P-1)*E,N=n(-x,l,S,w,v,y,_,b,C,N),k=n(x+Math.PI,l,S,w,v,y,_,b,C,k),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,D=2*(P-1)+2,A=1;A=0?(i=65536*Math.floor(e/65536),t.high=i,t.low=e-i):(i=65536*Math.floor(-e/65536),t.high=-i,t.low=e+i),t};var n={high:0,low:0};i.fromCartesian=function(e,t){r(t)||(t=new i);var o=t.high,a=t.low;return i.encode(e.x,n),o.x=n.high,a.x=n.low,i.encode(e.y,n),o.y=n.high,a.y=n.low,i.encode(e.z,n),o.z=n.high,a.z=n.low,t};var o=new i;return i.writeElements=function(e,t,r){i.fromCartesian(e,o);var n=o.high,a=o.low;t[r]=n.x,t[r+1]=n.y,t[r+2]=n.z,t[r+3]=a.x,t[r+4]=a.y,t[r+5]=a.z},i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];sn&&(n=l),++s,l=i[s]}for(var u=[],c=0;co&&(u[i[h]]=d,++d);return(d-o+1)/(a/3)},i.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n0)return++n-1;++n}return-1}r=e(r,e.EMPTY_OBJECT);var n,o=r.indices,a=r.maximumIndex,s=e(r.cacheSize,24),l=o.length,u=0,c=0,d=o[c],h=l;if(t(a))u=a+1;else{for(;cu&&(u=d),++c,d=o[c];if(-1===u)return 0;++u}var p,f=[];for(p=0;ps&&(_.timeStamp=v,++v),++c}g=function(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,d=0;dc||-1===c)&&(c=l,u=h)),++d}return-1===u?i(n,a,e,s):u}(o,s,b,f,v,C,u)}return S},i}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T){"use strict";function E(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function x(e){for(var t=e.length,r=t/3*6,i=g.createTypedArray(t,r),n=0,o=0;o=3){var r=6*(t-2),i=g.createTypedArray(t,r);E(i,0,e[0],e[1],e[2]);for(var n=6,o=3;o0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;aD&&(D=I)}return new p({attributes:v,indices:_,primitiveType:m,boundingSphere:u(A)?new r(A,D):void 0})}function N(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;no?n>a?y.sign(e.y):y.sign(r.y):o>a?y.sign(t.y):y.sign(r.y);var s=i<0;G(e,s),G(t,s),G(r,s)}function W(e,t,r,i){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),r),n.clone(r,i),G(r,!0),G(i,!1)}function j(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var i=e.y<0,n=t.y<0,o=r.y<0,a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(W(e,t,we,Te),W(e,r,Se,Ee),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,r,we,Te),W(t,e,Se,Ee),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(r,e,we,Te),W(r,t,Se,Ee),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?n?o||(W(r,e,we,Te),W(r,t,Se,Ee),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,r,we,Te),W(t,e,Se,Ee),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,we,Te),W(e,r,Se,Ee),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=r,l.length=3,1!==a&&2!==a||(l[3]=we,l[4]=Se,l[5]=Te,l[6]=Ee,l.length=7),xe}}function q(e,t){var i=e.attributes;if(0!==i.position.values.length){for(var n in i)if(i.hasOwnProperty(n)&&u(i[n])&&u(i[n].values)){var o=i[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=r.fromVertices(i.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){var n=t[i];r[i]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:r,indices:[],primitiveType:e.primitiveType})}function X(e,t,r){var i=u(e.geometry.boundingSphere);t=q(t,i),r=q(r,i),u(r)&&!u(t)?e.geometry=r:!u(r)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Q(e,r,o,a,s,l,c,d,h,p,f,m){if(u(l)||u(c)||u(d)||u(h)||u(p)){var g=n.fromArray(s,3*e,Pe),v=n.fromArray(s,3*r,Ae),_=n.fromArray(s,3*o,De),y=t(a,g,v,_,Ie);if(u(l)){var b=n.fromArray(l,3*e,Pe),C=n.fromArray(l,3*r,Ae),w=n.fromArray(l,3*o,De);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(C,y.y,C),n.multiplyByScalar(w,y.z,w);var S=n.add(b,C,b);n.add(S,w,S),n.normalize(S,S),n.pack(S,f.normal.values,3*m)}if(u(p)){var T=n.fromArray(p,3*e,Pe),E=n.fromArray(p,3*r,Ae),x=n.fromArray(p,3*o,De);n.multiplyByScalar(T,y.x,T),n.multiplyByScalar(E,y.y,E),n.multiplyByScalar(x,y.z,x);var P;n.equals(T,n.ZERO)&&n.equals(E,n.ZERO)&&n.equals(x,n.ZERO)?(P=Pe,P.x=0,P.y=0,P.z=0):(P=n.add(T,E,T),n.add(P,x,P),n.normalize(P,P)),n.pack(P,f.extrudeDirection.values,3*m)}if(u(c)){var A=n.fromArray(c,3*e,Pe),D=n.fromArray(c,3*r,Ae),I=n.fromArray(c,3*o,De);n.multiplyByScalar(A,y.x,A),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(I,y.z,I);var O=n.add(A,D,A);n.add(O,I,O),n.normalize(O,O),n.pack(O,f.tangent.values,3*m)}if(u(d)){var M=n.fromArray(d,3*e,Pe),R=n.fromArray(d,3*r,Ae),L=n.fromArray(d,3*o,De);n.multiplyByScalar(M,y.x,M),n.multiplyByScalar(R,y.y,R),n.multiplyByScalar(L,y.z,L);var N=n.add(M,R,M);n.add(N,L,N),n.normalize(N,N),n.pack(N,f.bitangent.values,3*m)}if(u(h)){var k=i.fromArray(h,2*e,Oe),F=i.fromArray(h,2*r,Me),B=i.fromArray(h,2*o,Re);i.multiplyByScalar(k,y.x,k),i.multiplyByScalar(F,y.y,F),i.multiplyByScalar(B,y.z,B);var U=i.add(k,F,k);i.add(U,B,U),i.pack(U,f.st.values,2*m)}}}function Z(e,t,r,i,n,o){var a=e.position.values.length/3;if(-1!==n){var s=i[n],l=r[s];return-1===l?(r[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function K(e){var t,r,i,o,a,s=e.geometry,l=s.attributes,c=l.position.values,d=u(l.normal)?l.normal.values:void 0,h=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,f=u(l.st)?l.st.values:void 0,m=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,g=s.indices,v=Y(s),_=Y(s),y=[];y.length=c.length/3;var b=[];for(b.length=c.length/3,a=0;a3)for(var D=A.positions,I=A.indices,O=I.length,M=0;M0)){var u=n.unpack(i,s,Ve);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(i[s]=r[s-3],i[s+1]=r[s-2],i[s+2]=r[s-1]):n.pack(l,i,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3n&&(n=r[o]);e.indices=T.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=p.computeNumberOfVertices(e);if(u(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===S.TRIANGLES?i=3:e.primitiveType===S.LINES?i=2:e.primitiveType===S.POINTS&&(i=1);for(var d=0;d=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new n,ie=new a;te.projectTo2D=function(e,t,r,i,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m0&&a.push(L(t,"geometry")),r.length>0&&(a.push(L(r,"westHemisphereGeometry")),a.push(L(r,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,de=new n,he=new n;te.computeNormal=function(e){var t,r=e.indices,i=e.attributes,o=i.position.values,a=i.position.values.length/3,l=r.length,u=new Array(a),c=new Array(l/3),d=new Array(l);for(t=0;t0){for(h=0;h0||r.intersectPlane(i,w.ORIGIN_ZX_PLANE)!==v.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:K(e);break;case m.LINES:J(e)}else z(t),t.primitiveType===S.TRIANGLES?K(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E){"use strict";function x(e,i,o){var a=i.vertexFormat,s=i.center,l=i.semiMajorAxis,c=i.semiMinorAxis,h=i.ellipsoid,m=i.stRotation,g=o?e.length/3*2:e.length/3,v=i.shadowVolume,_=a.st?new Float32Array(2*g):void 0,b=a.normal?new Float32Array(3*g):void 0,C=a.tangent?new Float32Array(3*g):void 0,S=a.bitangent?new Float32Array(3*g):void 0,T=v?new Float32Array(3*g):void 0,E=0,x=z,P=G,A=H,D=new d(h),I=D.project(h.cartesianToCartographic(s,W),j),O=h.scaleToGeodeticSurface(s,L);h.geodeticSurfaceNormal(O,O);for(var M=w.fromAxisAngle(O,m,V),R=y.fromQuaternion(M,U),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Q=e.length,Z=o?Q:0,K=Z/3*2,J=0;J1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;o1,p=o(e.vertexFormat,E.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(i),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=E.clone(p),this._extrudedHeight=o(d,u),this._extrude=h,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=M(this._center,this._ellipsoid,n,s,this._rotation)}var L=new r,N=new r,k=new r,F=new r,B=new t,U=new y,V=new w,z=new r,G=new r,H=new r,W=new i,j=new r,q=new t,Y=new t,X=new r,Q=new e,Z=new e,K=new b,J=new b,$=new y,ee=[new r,new r,new r,new r],te=[new i,new i,new i,new i];R.packedLength=r.packedLength+c.packedLength+E.packedLength+S.packedLength+9,R.pack=function(e,t,i){return i=o(i,0),r.pack(e._center,t,i),i+=r.packedLength,c.pack(e._ellipsoid,t,i),i+=c.packedLength,E.pack(e._vertexFormat,t,i),i+=E.packedLength,S.pack(e._rectangle,t,i),i+=S.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i]=e._shadowVolume?1:0,t};var re=new r,ie=new c,ne=new E,oe=new S,ae={center:re,ellipsoid:ie,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return R.unpack=function(e,t,i){t=o(t,0);var n=r.unpack(e,t,re);t+=r.packedLength;var s=c.unpack(e,t,ie);t+=c.packedLength;var l=E.unpack(e,t,ne);t+=E.packedLength;var u=S.unpack(e,t,oe);t+=S.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],g=e[t++],v=e[t++],_=1===e[t++],y=1===e[t];return a(i)?(i._center=r.clone(n,i._center),i._ellipsoid=c.clone(s,i._ellipsoid),i._vertexFormat=E.clone(l,i._vertexFormat),i._semiMajorAxis=d,i._semiMinorAxis=h,i._rotation=p,i._stRotation=f,i._height=m,i._granularity=g,i._extrudedHeight=v,i._extrude=_,i._shadowVolume=y,i._rectangle=S.clone(u),i):(ae.height=m,ae.extrudedHeight=v,ae.granularity=g,ae.stRotation=f,ae.rotation=p,ae.semiMajorAxis=d,ae.semiMinorAxis=h,ae.shadowVolume=y,new R(ae))},R.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=O(r)):t=A(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:C.TRIANGLES,boundingSphere:t.boundingSphere})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY,shadowVolume:!0})},s(R.prototype,{rectangle:{get:function(){return this._rectangle}}}),R}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new o(i),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,r){return o.pack(e._ellipseGeometry,t,r)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return l.unpack=function(t,r,n){var d=o.unpack(t,r,u);return c.center=e.clone(d._center,c.center),c.ellipsoid=a.clone(d._ellipsoid,c.ellipsoid),c.height=d._height,c.extrudedHeight=d._extrudedHeight,c.granularity=d._granularity,c.vertexFormat=s.clone(d._vertexFormat,c.vertexFormat),c.stRotation=d._stRotation,c.shadowVolume=d._shadowVolume,i(n)?(c.semiMajorAxis=d._semiMajorAxis,c.semiMinorAxis=d._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=d._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,r){var i=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(i,n),a=r(i,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},n(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){var n=i.center;_=t.multiplyByScalar(i.ellipsoid.geodeticSurfaceNormal(n,_),i.height,_),_=t.add(n,_,_);for(var o=new e(_,i.semiMajorAxis),s=a.computeEllipsePositions(i,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,i,!1)})}),h=s.length/3,p=d.createTypedArray(h,2*h),f=0,m=0;m0){var x=Math.min(C,_);E=Math.round(_/x);var P=Math.min(E*C,_);for(S=0;S1;this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var v=new t,_=new t,y=new e,b=new e;g.packedLength=t.packedLength+s.packedLength+9,g.pack=function(e,r,o){return o=i(o,0),t.pack(e._center,r,o),o+=t.packedLength,s.pack(e._ellipsoid,r,o),o+=s.packedLength,r[o++]=e._semiMajorAxis,r[o++]=e._semiMinorAxis,r[o++]=e._rotation,r[o++]=e._height,r[o++]=e._granularity,r[o++]=n(e._extrudedHeight)?1:0,r[o++]=i(e._extrudedHeight,0),r[o++]=e._extrude?1:0,r[o]=e._numberOfVerticalLines,r};var C=new t,w=new s,S={center:C,ellipsoid:w,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return g.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,C);r+=t.packedLength;var l=s.unpack(e,r,w);r+=s.packedLength;var u=e[r++],c=e[r++],d=e[r++],h=e[r++],p=e[r++],f=e[r++],m=e[r++],v=1===e[r++],_=e[r];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=v,o._numberOfVerticalLines=_,o):(S.height=h,S.extrudedHeight=f?m:void 0,S.granularity=p,S.rotation=d,S.semiMajorAxis=u,S.semiMinorAxis=c,S.numberOfVerticalLines=_,new g(S))},g.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=m(r)):t=f(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},g}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";function a(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(i),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipseGeometry,t,r)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";return e({UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2})}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";return e({TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2})}),define("Core/getTimestamp",["./defined"],function(e){"use strict";return"undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),define("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(n){n=r(n,r.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=i(o)?l.clone(o):i(u)?l.clone(u):i(c)?l.addDays(c,-1,new l):l.now(),u=i(u)?l.clone(u):l.clone(o),c=i(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=r(n.clockRange,e.UNBOUNDED),this.canAnimate=r(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=r(n.multiplier,1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=r(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var r=s(),i=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)i=l.now(i);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)i=l.addSeconds(i,o,i);else{var a=r-this._lastSystemTime;i=l.addSeconds(i,o*(a/1e3),i)}var u=this.clockRange,c=this.startTime,d=this.stopTime;if(u===e.CLAMPED)l.lessThan(i,c)?i=l.clone(c,i):l.greaterThan(i,d)&&(i=l.clone(d,i));else if(u===e.LOOP_STOP)for(l.lessThan(i,c)&&(i=l.clone(c,i));l.greaterThan(i,d);)i=l.addSeconds(c,l.secondsDifference(i,d),i)}}return this._currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},u}),define("Core/Color",["./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function s(e,r,i,n){this.red=t(e,1),this.green=t(r,1),this.blue=t(i,1),this.alpha=t(n,1)}s.fromCartesian4=function(e,t){return r(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(e,i,n,o,a){return e=s.byteToFloat(t(e,255)),i=s.byteToFloat(t(i,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),r(a)?(a.red=e,a.green=i,a.blue=n,a.alpha=o,a):new s(e,i,n,o)},s.fromAlpha=function(e,t,i){return r(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new s(e.red,e.green,e.blue,t)};var l,u,c;i.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(e,i,n,o,l){e=t(e,0)%1,i=t(i,0),n=t(n,0),o=t(o,1);var u=n,c=n,d=n;if(0!==i){var h;h=n<.5?n*(1+i):n+i-n*i;var p=2*n-h;u=a(p,h,e+1/3),c=a(p,h,e),d=a(p,h,e-1/3)}return r(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(e,i){e=t(e,t.EMPTY_OBJECT);var n=e.red;if(!r(n)){var a=t(e.minimumRed,0),l=t(e.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=e.green;if(!r(u)){var c=t(e.minimumGreen,0),d=t(e.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=e.blue;if(!r(h)){var p=t(e.minimumBlue,0),f=t(e.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=e.alpha;if(!r(m)){var g=t(e.minimumAlpha,0),v=t(e.maximumAlpha,1);m=g+o.nextRandomNumber()*(v-g)}return r(i)?(i.red=n,i.green=u,i.blue=h,i.alpha=m,i):new s(n,u,h,m)};var d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(e,i){r(i)||(i=new s);var n=s[e.toUpperCase()];if(r(n))return s.clone(n,i),i;var o=d.exec(e);return null!==o?(i.red=parseInt(o[1],16)/15,i.green=parseInt(o[2],16)/15,i.blue=parseInt(o[3],16)/15,i.alpha=1,i):null!==(o=h.exec(e))?(i.red=parseInt(o[1],16)/255,i.green=parseInt(o[2],16)/255,i.blue=parseInt(o[3],16)/255,i.alpha=1,i):null!==(o=p.exec(e))?(i.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),i.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),i.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),i.alpha=parseFloat(t(o[4],"1.0")),i):null!==(o=f.exec(e))?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),i):i=void 0},s.packedLength=4,s.pack=function(e,r,i){return i=t(i,0),r[i++]=e.red,r[i++]=e.green,r[i++]=e.blue,r[i]=e.alpha,r},s.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new s),n.red=e[i++],n.green=e[i++],n.blue=e[i++],n.alpha=e[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,t){if(r(e))return r(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},s.equalsArray=function(e,t,r){return e.red===t[r]&&e.green===t[r+1]&&e.blue===t[r+2]&&e.alpha===t[r+3]},s.prototype.clone=function(e){return s.clone(this,e)}, s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return this===e||r(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var t=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return r(e)?(e[0]=t,e[1]=i,e[2]=n,e[3]=o,e):[t,i,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,r){return r.red=e.red+t.red,r.green=e.green+t.green,r.blue=e.blue+t.blue,r.alpha=e.alpha+t.alpha,r},s.subtract=function(e,t,r){return r.red=e.red-t.red,r.green=e.green-t.green,r.blue=e.blue-t.blue,r.alpha=e.alpha-t.alpha,r},s.multiply=function(e,t,r){return r.red=e.red*t.red,r.green=e.green*t.green,r.blue=e.blue*t.blue,r.alpha=e.alpha*t.alpha,r},s.divide=function(e,t,r){return r.red=e.red/t.red,r.green=e.green/t.green,r.blue=e.blue/t.blue,r.alpha=e.alpha/t.alpha,r},s.mod=function(e,t,r){return r.red=e.red%t.red,r.green=e.green%t.green,r.blue=e.blue%t.blue,r.alpha=e.alpha%t.alpha,r},s.multiplyByScalar=function(e,t,r){return r.red=e.red*t,r.green=e.green*t,r.blue=e.blue*t,r.alpha=e.alpha*t,r},s.divideByScalar=function(e,t,r){return r.red=e.red/t,r.green=e.green/t,r.blue=e.blue/t,r.alpha=e.alpha/t,r},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUCHSIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),define("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(t,i,n,o){t=r(t,1),i=r(i,1),n=r(n,1),o=r(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(i),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return i(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,t){"use strict";function r(e,t,r,i){this._format=e,this._width=t,this._height=r,this._buffer=i}return t(r.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),r.clone=function(t){if(e(t))return new r(t._format,t._width,t._height,t._buffer)},r.prototype.clone=function(){return r.clone(this)},r}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";return e({ROUNDED:0,MITERED:1,BEVELED:2})}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),d=l*a,h=d*d,p=1-h,f=Math.sqrt(p),m=t/4,g=m*m,v=g*m,_=g*g,y=1+m-3*g/4+5*v/4-175*_/64,b=1-m+15*g/8-35*v/8,C=1-3*m+35*g/4,w=1-5*m,S=y*c-b*Math.sin(2*c)*m/2-C*Math.sin(4*c)*g/16-w*Math.sin(6*c)*v/48-5*Math.sin(8*c)*_/512,T=e._constants;T.a=r,T.b=i,T.f=n,T.cosineHeading=o,T.sineHeading=a,T.tanU=s,T.cosineU=l,T.sineU=u,T.sigma=c,T.sineAlpha=d,T.sineSquaredAlpha=h,T.cosineSquaredAlpha=p,T.cosineAlpha=f,T.u2Over4=m,T.u4Over16=g,T.u6Over64=v,T.u8Over256=_,T.a0=y,T.a1=b,T.a2=C,T.a3=w,T.distanceRatio=S}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,r,i,n,o,a){var s=u(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function d(e,t,r,i,n,o,a){var l,u,d,h,p,f=(t-r)/t,m=o-i,g=Math.atan((1-f)*Math.tan(n)),v=Math.atan((1-f)*Math.tan(a)),_=Math.cos(g),y=Math.sin(g),b=Math.cos(v),C=Math.sin(v),w=_*b,S=_*C,T=y*C,E=y*b,x=m,P=s.TWO_PI,A=Math.cos(x),D=Math.sin(x);do{A=Math.cos(x),D=Math.sin(x);var I=S-E*A;d=Math.sqrt(b*b*D*D+I*I),u=T+w*A,l=Math.atan2(d,u);var O;0===d?(O=0,h=1):(O=w*D/d,h=1-O*O),P=x,p=u-2*T/h,isNaN(p)&&(p=0),x=m+c(f,O,h,l,d,u,p)}while(Math.abs(x-P)>s.EPSILON12);var M=h*(t*t-r*r)/(r*r),R=1+M*(4096+M*(M*(320-175*M)-768))/16384,L=M*(256+M*(M*(74-47*M)-128))/1024,N=p*p,k=L*d*(p+L*(u*(2*N-1)-L*p*(4*d*d-3)*(4*N-3)/6)/4),F=r*R*(l-k),B=Math.atan2(b*D,S-E*A),U=Math.atan2(_*D,S*A-E);e._distance=F,e._startHeading=B,e._endHeading=U,e._uSquared=M}function h(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),f),e.normalize(o.cartographicToCartesian(n,m),m);d(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),r._start.height=0,r._end.height=0,l(r)}function p(e,r,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,n(e)&&n(r)&&h(this,e,r,s)}var f=new e,m=new e;return o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){var i=this._constants,o=i.distanceRatio+e/i.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),d=Math.sin(4*o),h=Math.sin(6*o),p=Math.sin(8*o),f=o*o,m=o*f,g=i.u8Over256,v=i.u2Over4,_=i.u6Over64,y=i.u4Over16,b=2*m*g*a/3+o*(1-v+7*y/4-15*_/4+579*g/64-(y-15*_/4+187*g/16)*a-(5*_/4-115*g/16)*s-29*g*l/16)+(v/2-y+71*_/32-85*g/16)*u+(5*y/16-5*_/4+383*g/96)*d-f*((_-11*g/2)*u+5*g*d/2)+(29*_/96-29*g/16)*h+539*g*p/1536,C=Math.asin(Math.sin(b)*i.cosineAlpha),w=Math.atan(i.a/i.b*Math.tan(C));b-=i.sigma;var S=Math.cos(2*i.sigma+b),T=Math.sin(b),E=Math.cos(b),x=i.cosineU*E,P=i.sineU*T,A=Math.atan2(T*i.sineHeading,x-P*i.cosineHeading),D=A-c(i.f,i.sineAlpha,i.cosineSquaredAlpha,b,T,E,S);return n(r)?(r.longitude=this._start.longitude+D,r.latitude=w,r.height=0,r):new t(this._start.longitude+D,w,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t,r){var i=T;i.length=e;var n;if(t===r){for(n=0;n0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,g),u=c.multiplyByPoint(l,e.ZERO,v),h=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_Y,_),_),p=d.fromPointNormal(u,h,y),f=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_X,b),b),m=d.fromPointNormal(u,f,C),T=1;o.push(e.clone(t[0]));for(var E=o[0],x=t.length,P=1;P=0?-c:c}function m(e,r,i,n,o,a,u,c){var h=z,p=G;F=d.eastNorthUpToFixedFrame(e,o,F),h=l.multiplyByPointAsVector(F,k,h),h=t.normalize(h,h);var m=f(h,r,e,o);U=s.fromRotationZ(m,U),H.z=a,F=l.multiplyTransformation(F,l.fromRotationTranslation(U,H,B),F);var g=V;g[0]=u;for(var v=0;v0)for(var C=f?2:1,w=0;w<_;w++)r=s.multiplyByVector(g,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,O),d=m(b,y,h,d,u,p,1,C);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,O),d=m(b,y,h,d,u,p,1,1),i=t.clone(i,q),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(i,O),d=m(b,y,h,d,u,p,1,1);return d}var b=[new t,new t],C=new t,w=new t,S=new t,T=new t,E=new t,x=new t,P=new t,A=new t,D=new t,I=new t,O=new t,M={},R=new i,L=new t,N=new t,k=new t(-1,0,0),F=new l,B=new l,U=new s,V=s.IDENTITY.clone(),z=new t,G=new r,H=new t,W=new t,j=new c,q=new t,Y=new s;M.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;o=0};var X=new t,Q=new t;return M.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=h(e,l),d=o._granularity,f=o._cornerType,O=s?v(r,i):_(r,i),R=s?_(r,i):void 0,L=i.height/2,N=i.width/2,k=e.length,F=[],B=s?[]:void 0,U=C,V=w,z=S,G=T,H=E,W=x,j=P,q=A,Y=D,Z=e[0],K=e[1];G=l.geodeticSurfaceNormal(Z,G),U=t.subtract(K,Z,U),U=t.normalize(U,U),q=t.cross(G,U,q),q=t.normalize(q,q);var J=c[0],$=c[1];s&&(B=m(Z,q,R,B,l,J+L,1,1)),Y=t.clone(Z,Y),Z=K,V=t.negate(U,V);for(var ee,te,re=1;re80*n){c=h=e[0],d=p=e[1];for(var v=n;vh&&(h=f),m>p&&(p=m);g=Math.max(h-c,p-d)}return i(s,u,n,c,d,g),u}function t(e,t,r,i,n){var o,a;if(n===A(e,t,r,i)>0)for(o=t;o=t;o-=i)a=E(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function r(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!y(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(x(i),(i=t=i.prev)===i.next)return null;r=!0}}while(r||i!==t);return t}function i(e,t,l,u,c,d,p){if(e){!p&&d&&h(e,u,c,d);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):n(e))t.push(f.i/l),t.push(e.i/l),t.push(m.i/l),x(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?(e=a(e,t,l),i(e,t,l,u,c,d,2)):2===p&&s(e,t,l,u,c,d):i(r(e),t,l,u,c,d,1);break}}}function n(e){var t=e.prev,r=e,i=e.next;if(_(t,r,i)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(g(t.x,t.y,r.x,r.y,i.x,i.y,n.x,n.y)&&_(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,r,i){var n=e.prev,o=e,a=e.next;if(_(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,d=f(s,l,t,r,i),h=f(u,c,t,r,i),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!y(n,o)&&b(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),x(i),x(i.next),i=e=o),i=i.next}while(i!==e);return i}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=T(l,u);return l=r(l,l.next),c=r(c,c.next),i(l,t,n,o,a,s),void i(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,i,n,o){var a,s,l,d,h,p=[];for(a=0,s=i.length;a=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=c&&g(or.x)&&w(i,e)&&(r=i,h=l),i=i.next;return r}function h(e,t,r,i){var n=e;do{null===n.z&&(n.z=f(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,r,i,n,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,i=r,s=0,t=0;t0||l>0&&i;)0===s?(n=i,i=i.nextZ,l--):0!==l&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,r,i,n){return e=32767*(e-r)/n,t=32767*(t-i)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,r=e;do{t.x=0&&(e-a)*(i-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!C(e,t)&&w(e,t)&&w(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,i){return!!(y(e,t)&&y(r,i)||y(e,i)&&y(r,t))||_(e,t,r)>0!=_(e,t,i)>0&&_(r,i,e)>0!=_(r,i,t)>0}function C(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function w(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function T(e,t){var r=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function E(e,t,r,i){var n=new P(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,r,i){for(var n=0,o=t,a=r-i;o0&&(i+=e[n-1].length,r.holes.push(i))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}), define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";var p=new r,f=new r,m={};m.computeArea2D=function(e){for(var t=e.length,r=0,i=t-1,n=0;n0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(r,i){var n=t.packArray(r);return e(n,i,2)};var g=new r,v=new r,_=new r,y=new r,b=new r,C=new r,w=new r;return m.computeSubdivision=function(e,t,i,s){s=o(s,c.RADIANS_PER_DEGREE);var h,p=i.slice(0),f=t.length,m=new Array(3*f),S=0;for(h=0;h0;){var I,O,M=p.pop(),R=p.pop(),L=p.pop(),N=r.fromArray(m,3*L,g),k=r.fromArray(m,3*R,v),F=r.fromArray(m,3*M,_),B=r.multiplyByScalar(r.normalize(N,y),P,y),U=r.multiplyByScalar(r.normalize(k,b),P,b),V=r.multiplyByScalar(r.normalize(F,C),P,C),z=r.magnitudeSquared(r.subtract(B,U,w)),G=r.magnitudeSquared(r.subtract(U,V,w)),H=r.magnitudeSquared(r.subtract(V,B,w)),W=Math.max(z,G,H);W>D?z===W?(I=Math.min(L,R)+" "+Math.max(L,R),h=x[I],a(h)||(O=r.add(N,k,w),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,x[I]=h),p.push(L,h,M),p.push(h,R,M)):G===W?(I=Math.min(R,M)+" "+Math.max(R,M),h=x[I],a(h)||(O=r.add(k,F,w),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,x[I]=h),p.push(R,h,L),p.push(h,M,L)):H===W&&(I=Math.min(M,L)+" "+Math.max(M,L),h=x[I],a(h)||(O=r.add(F,N,w),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,x[I]=h),p.push(M,h,R),p.push(h,L,R)):(E.push(L),E.push(R),E.push(M))}return new l({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})},indices:E,primitiveType:d.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,i,n){i=o(i,s.WGS84);var l=p,u=f;if(t=o(t,0),n=o(n,!0),a(e))for(var c=e.length,d=0;dCe;s--)be=g.PI_OVER_TWO-s*ye,ve[_e++]=1-me*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=Ce;s>0;s--)be=g.PI_OVER_TWO-ye*s,ve[_e++]=1-ge*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=b-E;s>0;s--)ve[_e++]=s*ge,ve[_e++]=1;for(s=1;s0;s--)ve[_e++]=(s-1)*ge,ve[_e++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ve})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.bitangents})),{attributes:y,indices:K}}function T(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,n,o=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,d=2*u;if(t.normal||t.bitangent||t.tangent){var h=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=t.bitangent?new Float32Array(6*u):void 0,m=I,g=O,v=M,_=R,y=L,b=N,C=d;for(s=0;s0){var C=Math.min(g,m);v=Math.round(m/C),b+=C}var w,S=d.createTypedArray(_,2*b),T=0;for(w=0;w0)for(w=0;w=f&&(m=(m+8)%24,u=m);d1?1:u;var b=p(u);for(t in n){var C=i[t]||0,w=n[t];w instanceof Array?r[t]=f(w,b):("string"==typeof w&&(w=C+parseFloat(w,10)),"number"==typeof w&&(r[t]=C+(w-C)*b))}if(null!==_&&_.call(r,b),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var S=o[t];o[t]=n[t],n[t]=S}i[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(r);for(var T=0,E=m.length;T1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(r<0&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):r<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[i1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n;return(2*t-2*r+o+a)*(n*s)+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";return t({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})}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,C),i=Math.round(n(e.stackPartitions,64)),o=Math.round(n(e.slicePartitions,64)),a=n(e.vertexFormat,f.DEFAULT);this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=o,this._vertexFormat=f.clone(a),this._workerName="createEllipsoidGeometry"}var g=new r,v=new r,_=new r,y=new r,b=new r,C=new r(1,1,1),w=Math.cos,S=Math.sin;m.packedLength=r.packedLength+f.packedLength+2,m.pack=function(e,t,i){return i=n(i,0),r.pack(e._radii,t,i),i+=r.packedLength,f.pack(e._vertexFormat,t,i),i+=f.packedLength,t[i++]=e._stackPartitions,t[i]=e._slicePartitions,t};var T=new r,E=new f,x={radii:T,vertexFormat:E,stackPartitions:void 0,slicePartitions:void 0};return m.unpack=function(e,t,i){t=n(t,0);var a=r.unpack(e,t,T);t+=r.packedLength;var s=f.unpack(e,t,E);t+=f.packedLength;var l=e[t++],u=e[t];return o(i)?(i._radii=r.clone(a,i._radii),i._vertexFormat=f.clone(s,i._vertexFormat),i._stackPartitions=l,i._slicePartitions=u,i):(x.stackPartitions=l,x.slicePartitions=u,new m(x))},m.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,f,m=s.fromCartesian3(o),C=n._vertexFormat,T=n._slicePartitions+1,E=n._stackPartitions+1,x=E*T,P=new Float64Array(3*x),A=6*(T-1)*(E-2),D=d.createTypedArray(x,A),I=C.normal?new Float32Array(3*x):void 0,O=C.tangent?new Float32Array(3*x):void 0,M=C.bitangent?new Float32Array(3*x):void 0,R=C.st?new Float32Array(2*x):void 0,L=new Array(T),N=new Array(T),k=0;for(a=0;aP.length&&(k=3*(a-T*Math.floor(.5*E))),r.fromArray(P,k,Z),m.geodeticSurfaceNormal(Z,Z),t.negate(Z,Z)),R[W++]=Math.atan2(Z.y,Z.x)/h.TWO_PI+.5,R[W++]=Math.asin(Q.z)/Math.PI+.5}if(C.normal&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),C.tangent||C.bitangent){var K=_;if(ax-T-1?(r.cross(r.UNIT_X,Q,K),r.normalize(K,K)):(r.cross(r.UNIT_Z,Q,K),r.normalize(K,K)),C.tangent&&(O[q++]=K.x,O[q++]=K.y,O[q++]=K.z),C.bitangent){var J=r.cross(Q,K,y);r.normalize(J,J),M[Y++]=J.x,M[Y++]=J.y,M[Y++]=J.z}}}C.st&&(H.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),C.normal&&(H.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),C.tangent&&(H.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),C.bitangent&&(H.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:M}))}for(k=0,f=0;fL-C-1;--o)x[P++]=L,x[P++]=o;var N=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})});return new s({attributes:N,indices:x,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),define("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,{}),this._tilingScheme=i.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(i.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return i(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,r,i){return new s({buffer:new Uint8Array(256),width:16,height:16})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<>10),56320+(1023&o)))}return t},"undefined"!=typeof TextDecoder?n.decode=n.decodeWithTextDecoder:n.decode=n.decodeWithFromCharCode,n}),define("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function r(r,i){return i=e(i,0),t(r,i,Math.min(4,r.length))}return r}),function(global,undefined){"use strict";!function(e,t,r){function i(r){var n=t[r];return n||e[r][0].call(n=t[r]={exports:{}},i,n,n.exports),n.exports}var n=global.protobuf=i(r[0]);"function"==typeof define&&define.amd&&define("ThirdParty/protobuf-minimal",[],function(){return n.configure(),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(e,t,r){function i(e,t){for(var r=[],i=2;i1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(e,t,r){for(var i,o=[],a=0,s=0;t>2],i=(3&l)<<4,s=1;break;case 1:o[a++]=n[i|l>>4],i=(15&l)<<2,s=2;break;case 2:o[a++]=n[i|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[i],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};i.decode=function(e,t,r){for(var i,n=r,a=0,s=0;s1)break;if((l=o[l])===undefined)throw Error("invalid encoding");switch(a){case 0:i=l,a=1;break;case 1:t[r++]=i<<2|(48&l)>>4,i=l,a=2;break;case 2:t[r++]=(15&i)<<4|(60&l)>>2,i=l,a=3;break;case 3:t[r++]=(3&i)<<6|l,a=0}}if(1===a)throw Error("invalid encoding");return r-n},i.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}},{}],3:[function(e,t,r){function i(){this._listeners={}}t.exports=i,i.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},i.prototype.off=function(e,t){if(e===undefined)this._listeners={};else if(t===undefined)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i>>1,o=null,a=i;return function(r){if(r<1||r>n)return e(r);a+r>i&&(o=e(i),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}t.exports=i},{}],6:[function(e,t,r){var i=r;i.length=function(e){for(var t=0,r=0,i=0;i191&&i<224?o[a++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(i>>10),o[a++]=56320+(1023&i)):o[a++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),a=0);return n?(a&&n.push(String.fromCharCode.apply(String,o.slice(0,a))),n.join("")):String.fromCharCode.apply(String,o.slice(0,a))},i.write=function(e,t,r){for(var i,n,o=r,a=0;a>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(a+1)))?(i=65536+((1023&i)<<10)+(1023&n),++a,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}},{}],7:[function(e,t,r){function i(){n.Reader._configure(n.BufferReader),n.util._configure()}var n=r;n.build="minimal",n.roots={},n.Writer=e(14),n.BufferWriter=e(15),n.Reader=e(8),n.BufferReader=e(9),n.util=e(13),n.rpc=e(10),n.configure=i,n.Writer._configure(n.BufferWriter),i()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,r){function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new c(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw i(this,8);return new c(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}t.exports=n;var l,u=e(13),c=u.LongBits,d=u.utf8,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")};n.create=u.Buffer?function(e){return(n.create=function(e){return u.Buffer.isBuffer(e)?new l(e):h(e)})(e)}:h,n.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return a(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|a(this.buf,this.pos+=4)};var p="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],e[0]}:function(r,i){return t[0]=r[i+3],t[1]=r[i+2],t[2]=r[i+1],t[3]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=2*(r>>31)+1,n=r>>>23&255,o=8388607&r;return 255===n?o?NaN:i*(1/0):0===n?1.401298464324817e-45*i*o:i*Math.pow(2,n-150)*(o+8388608)};n.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=p(this.buf,this.pos);return this.pos+=4,e};var f="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],t[4]=r[i+4],t[5]=r[i+5],t[6]=r[i+6],t[7]=r[i+7],e[0]}:function(r,i){return t[0]=r[i+7],t[1]=r[i+6],t[2]=r[i+5],t[3]=r[i+4],t[4]=r[i+3],t[5]=r[i+2],t[6]=r[i+1],t[7]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=a(e,t+8),n=2*(i>>31)+1,o=i>>>20&2047,s=4294967296*(1048575&i)+r;return 2047===o?s?NaN:n*(1/0):0===o?5e-324*n*s:n*Math.pow(2,o-1075)*(s+4503599627370496)};n.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=f(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},n.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},n.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n._configure=function(e){l=e;var t=u.Long?"toLong":"toNumber";u.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,r){function i(e){n.call(this,e)}t.exports=i;var n=e(8);(i.prototype=Object.create(n.prototype)).constructor=i;var o=e(13);o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice),i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,r){r.Service=e(11)},{11:11}],11:[function(e,t,r){function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}t.exports=i;var n=e(13);(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(!s.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined;try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,r){if(e)return s.emit("error",e,t),a(e);if(null===r)return s.end(!0),undefined;if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)})}catch(e){return s.emit("error",e,t),setTimeout(function(){a(e)},0),undefined}},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,r){function i(e,t){this.lo=e>>>0,this.hi=t>>>0}t.exports=i;var n=e(13),o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},{13:13}],13:[function(e,t,r){function i(e,t,r){for(var i=Object.keys(t),n=0;n-1;--r)if(1===t[e[r]]&&this[e[r]]!==undefined&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function u(e,t){this.len=e,this.next=undefined,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r++]=255&e,t[r++]=e>>>8&255,t[r++]=e>>>16&255,t[r]=e>>>24}t.exports=a;var h,p=e(13),f=p.LongBits,m=p.base64,g=p.utf8;a.create=p.Buffer?function(){return(a.create=function(){return new h})()}:function(){return new a},a.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(a.alloc=p.pool(a.alloc,p.Array.prototype.subarray)),a.prototype.push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=l,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this.push(c,10,f.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=f.from(e);return this.push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=f.from(e).zzEncode();return this.push(c,t.length(),t)},a.prototype.bool=function(e){return this.push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this.push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=f.from(e);return this.push(d,4,t.lo).push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64;var v="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n]=t[3]}:function(r,i,n){e[0]=r,i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(1/e>0?0:2147483648,t,r);else if(isNaN(e))d(2147483647,t,r);else if(e>3.4028234663852886e38)d((i<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)d((i<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var n=Math.floor(Math.log(e)/Math.LN2),o=8388607&Math.round(e*Math.pow(2,-n)*8388608);d((i<<31|n+127<<23|o)>>>0,t,r)}};a.prototype.float=function(e){return this.push(v,4,e)};var _="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n++]=t[3],i[n++]=t[4],i[n++]=t[5],i[n++]=t[6],i[n]=t[7]}:function(r,i,n){e[0]=r,i[n++]=t[7],i[n++]=t[6],i[n++]=t[5],i[n++]=t[4],i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(0,t,r),d(1/e>0?0:2147483648,t,r+4);else if(isNaN(e))d(4294967295,t,r),d(2147483647,t,r+4);else if(e>1.7976931348623157e308)d(0,t,r),d((i<<31|2146435072)>>>0,t,r+4);else{var n;if(e<2.2250738585072014e-308)n=e/5e-324,d(n>>>0,t,r),d((i<<31|n/4294967296)>>>0,t,r+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),n=e*Math.pow(2,-o),d(4503599627370496*n>>>0,t,r),d((i<<31|o+1023<<20|1048576*n&1048575)>>>0,t,r+4)}}};a.prototype.double=function(e){return this.push(_,8,e)};var y=p.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i>>0;if(!t)return this.push(s,1,0);if(p.isString(e)){var r=a.alloc(t=m.length(e));m.decode(e,r,0),e=r}return this.uint32(t).push(y,t,e)},a.prototype.string=function(e){var t=g.length(e);return t?this.uint32(t).push(g.write,t,e):this.push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new i(n,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(n,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(e){h=e}},{13:13}],15:[function(e,t,r){function i(){o.call(this)}function n(e,t,r){e.length<40?a.utf8.write(e,t,r):t.utf8Write(e,r)}t.exports=i;var o=e(14);(i.prototype=Object.create(o.prototype)).constructor=i;var a=e(13),s=a.Buffer;i.alloc=function(e){return(i.alloc=a._Buffer_allocUnsafe)(e)};var l=s&&s.prototype instanceof Uint8Array&&"set"===s.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i>>0;return this.uint32(t),t&&this.push(l,t,e),this},i.prototype.string=function(e){var t=s.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{13:13,14:14}]},{},[7])}("object"==typeof window&&window||"object"==typeof self&&self||this),define("ThirdParty/google-earth-dbroot-parser",["./protobuf-minimal"],function(e){"use strict";var t=e.Reader,r=(e.Writer,e.util),i=[],n=e.roots.default||(e.roots.default={});return n.keyhole=function(){var o={};return o.dbroot=function(){var o={};return o.StringEntryProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.stringId=e.fixed32();break;case 2:o.stringValue=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.stringId)?r.isString(e.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringEntryProto)return e;var t=new n.keyhole.dbroot.StringEntryProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.stringValue&&null!==e.stringValue&&(t.stringValue=String(e.stringValue)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.stringValue=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.stringValue&&null!==e.stringValue&&e.hasOwnProperty("stringValue")&&(r.stringValue=e.stringValue),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.StringIdOrValueProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.stringId=e.fixed32();break;case 2:o.value=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.stringId||r.isInteger(e.stringId)?void 0===e.value||r.isString(e.value)?null:"value: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringIdOrValueProto)return e;var t=new n.keyhole.dbroot.StringIdOrValueProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.value&&null!==e.value&&(t.value=String(e.value)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.value=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.PlanetModelProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.radius=e.double();break;case 2:o.flattening=e.double();break;case 4:o.elevationBias=e.double();break;case 5:o.negativeAltitudeExponentBias=e.int32();break;case 6:o.compressedNegativeAltitudeThreshold=e.double();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.radius&&"number"!=typeof e.radius?"radius: number expected":void 0!==e.flattening&&"number"!=typeof e.flattening?"flattening: number expected":void 0!==e.elevationBias&&"number"!=typeof e.elevationBias?"elevationBias: number expected":void 0===e.negativeAltitudeExponentBias||r.isInteger(e.negativeAltitudeExponentBias)?void 0!==e.compressedNegativeAltitudeThreshold&&"number"!=typeof e.compressedNegativeAltitudeThreshold?"compressedNegativeAltitudeThreshold: number expected":null:"negativeAltitudeExponentBias: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetModelProto)return e;var t=new n.keyhole.dbroot.PlanetModelProto;return void 0!==e.radius&&null!==e.radius&&(t.radius=Number(e.radius)),void 0!==e.flattening&&null!==e.flattening&&(t.flattening=Number(e.flattening)),void 0!==e.elevationBias&&null!==e.elevationBias&&(t.elevationBias=Number(e.elevationBias)),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&(t.negativeAltitudeExponentBias=0|e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&(t.compressedNegativeAltitudeThreshold=Number(e.compressedNegativeAltitudeThreshold)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.radius=6378.137,r.flattening=.00335281066474748,r.elevationBias=0,r.negativeAltitudeExponentBias=0,r.compressedNegativeAltitudeThreshold=0),void 0!==e.radius&&null!==e.radius&&e.hasOwnProperty("radius")&&(r.radius=e.radius),void 0!==e.flattening&&null!==e.flattening&&e.hasOwnProperty("flattening")&&(r.flattening=e.flattening),void 0!==e.elevationBias&&null!==e.elevationBias&&e.hasOwnProperty("elevationBias")&&(r.elevationBias=e.elevationBias),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&e.hasOwnProperty("negativeAltitudeExponentBias")&&(r.negativeAltitudeExponentBias=e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&e.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(r.compressedNegativeAltitudeThreshold=e.compressedNegativeAltitudeThreshold),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ProviderInfoProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.providerId=e.int32();break;case 2:o.copyrightString=a[1].decode(e,e.uint32());break;case 3:o.verticalPixelOffset=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.copyrightString&&null!==e.copyrightString){var t=a[1].verify(e.copyrightString);if(t)return"copyrightString."+t}return void 0===e.verticalPixelOffset||r.isInteger(e.verticalPixelOffset)?null:"verticalPixelOffset: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ProviderInfoProto)return e;var t=new n.keyhole.dbroot.ProviderInfoProto;if(void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString){if("object"!=typeof e.copyrightString)throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=a[1].fromObject(e.copyrightString)}return void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&(t.verticalPixelOffset=0|e.verticalPixelOffset),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.providerId=0,r.copyrightString=null,r.verticalPixelOffset=-1),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString&&e.hasOwnProperty("copyrightString")&&(r.copyrightString=a[1].toObject(e.copyrightString,t)),void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&e.hasOwnProperty("verticalPixelOffset")&&(r.verticalPixelOffset=e.verticalPixelOffset),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.PopUpProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.isBalloonStyle=e.bool();break;case 2:o.text=a[1].decode(e,e.uint32());break;case 3:o.backgroundColorAbgr=e.fixed32();break;case 4:o.textColorAbgr=e.fixed32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.isBalloonStyle&&"boolean"!=typeof e.isBalloonStyle)return"isBalloonStyle: boolean expected";if(void 0!==e.text&&null!==e.text){var t=a[1].verify(e.text);if(t)return"text."+t}return void 0===e.backgroundColorAbgr||r.isInteger(e.backgroundColorAbgr)?void 0===e.textColorAbgr||r.isInteger(e.textColorAbgr)?null:"textColorAbgr: integer expected":"backgroundColorAbgr: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PopUpProto)return e;var t=new n.keyhole.dbroot.PopUpProto;if(void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&(t.isBalloonStyle=Boolean(e.isBalloonStyle)),void 0!==e.text&&null!==e.text){ if("object"!=typeof e.text)throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=a[1].fromObject(e.text)}return void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&(t.backgroundColorAbgr=e.backgroundColorAbgr>>>0),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&(t.textColorAbgr=e.textColorAbgr>>>0),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isBalloonStyle=!1,r.text=null,r.backgroundColorAbgr=4294967295,r.textColorAbgr=4278190080),void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&e.hasOwnProperty("isBalloonStyle")&&(r.isBalloonStyle=e.isBalloonStyle),void 0!==e.text&&null!==e.text&&e.hasOwnProperty("text")&&(r.text=a[1].toObject(e.text,t)),void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&e.hasOwnProperty("backgroundColorAbgr")&&(r.backgroundColorAbgr=e.backgroundColorAbgr),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&e.hasOwnProperty("textColorAbgr")&&(r.textColorAbgr=e.textColorAbgr),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleAttributeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.styleId=e.string();break;case 3:o.providerId=e.int32();break;case 4:o.polyColorAbgr=e.fixed32();break;case 5:o.lineColorAbgr=e.fixed32();break;case 6:o.lineWidth=e.float();break;case 7:o.labelColorAbgr=e.fixed32();break;case 8:o.labelScale=e.float();break;case 9:o.placemarkIconColorAbgr=e.fixed32();break;case 10:o.placemarkIconScale=e.float();break;case 11:o.placemarkIconPath=a[9].decode(e,e.uint32());break;case 12:o.placemarkIconX=e.int32();break;case 13:o.placemarkIconY=e.int32();break;case 14:o.placemarkIconWidth=e.int32();break;case 15:o.placemarkIconHeight=e.int32();break;case 16:o.popUp=a[14].decode(e,e.uint32());break;case 17:o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(a[15].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.styleId))return"styleId: string expected";if(void 0!==e.providerId&&!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.polyColorAbgr&&!r.isInteger(e.polyColorAbgr))return"polyColorAbgr: integer expected";if(void 0!==e.lineColorAbgr&&!r.isInteger(e.lineColorAbgr))return"lineColorAbgr: integer expected";if(void 0!==e.lineWidth&&"number"!=typeof e.lineWidth)return"lineWidth: number expected";if(void 0!==e.labelColorAbgr&&!r.isInteger(e.labelColorAbgr))return"labelColorAbgr: integer expected";if(void 0!==e.labelScale&&"number"!=typeof e.labelScale)return"labelScale: number expected";if(void 0!==e.placemarkIconColorAbgr&&!r.isInteger(e.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(void 0!==e.placemarkIconScale&&"number"!=typeof e.placemarkIconScale)return"placemarkIconScale: number expected";if(void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){var t=a[9].verify(e.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(void 0!==e.placemarkIconX&&!r.isInteger(e.placemarkIconX))return"placemarkIconX: integer expected";if(void 0!==e.placemarkIconY&&!r.isInteger(e.placemarkIconY))return"placemarkIconY: integer expected";if(void 0!==e.placemarkIconWidth&&!r.isInteger(e.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(void 0!==e.placemarkIconHeight&&!r.isInteger(e.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(void 0!==e.popUp&&null!==e.popUp){var t=a[14].verify(e.popUp);if(t)return"popUp."+t}if(void 0!==e.drawFlag){if(!Array.isArray(e.drawFlag))return"drawFlag: array expected";for(var i=0;i>>0),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&(t.lineColorAbgr=e.lineColorAbgr>>>0),void 0!==e.lineWidth&&null!==e.lineWidth&&(t.lineWidth=Number(e.lineWidth)),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&(t.labelColorAbgr=e.labelColorAbgr>>>0),void 0!==e.labelScale&&null!==e.labelScale&&(t.labelScale=Number(e.labelScale)),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&(t.placemarkIconColorAbgr=e.placemarkIconColorAbgr>>>0),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&(t.placemarkIconScale=Number(e.placemarkIconScale)),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){if("object"!=typeof e.placemarkIconPath)throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=a[9].fromObject(e.placemarkIconPath)}if(void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&(t.placemarkIconX=0|e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&(t.placemarkIconY=0|e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&(t.placemarkIconWidth=0|e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&(t.placemarkIconHeight=0|e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp){if("object"!=typeof e.popUp)throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=a[14].fromObject(e.popUp)}if(e.drawFlag){if(!Array.isArray(e.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var r=0;r>>3){case 1:o.styleMapId=e.int32();break;case 2:if(o.channelId&&o.channelId.length||(o.channelId=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos>>3){case 1:o.minZoom=e.int32();break;case 2:o.maxZoom=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.minZoom)?r.isInteger(e.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ZoomRangeProto)return e;var t=new n.keyhole.dbroot.ZoomRangeProto;return void 0!==e.minZoom&&null!==e.minZoom&&(t.minZoom=0|e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&(t.maxZoom=0|e.maxZoom),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.minZoom=0,r.maxZoom=0),void 0!==e.minZoom&&null!==e.minZoom&&e.hasOwnProperty("minZoom")&&(r.minZoom=e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&e.hasOwnProperty("maxZoom")&&(r.maxZoom=e.maxZoom),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DrawFlagProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.drawFlagType=e.uint32();break;default:e.skipType(7&a)}}return o},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";switch(e.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DrawFlagProto)return e;var t=new n.keyhole.dbroot.DrawFlagProto;switch(e.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),void 0!==e.drawFlagType&&null!==e.drawFlagType&&e.hasOwnProperty("drawFlagType")&&(r.drawFlagType=t.enums===String?o[0][e.drawFlagType]:e.drawFlagType),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.DrawFlagType=function(){var e={},t=Object.create(e);return t.TYPE_FILL_ONLY=1,t.TYPE_OUTLINE_ONLY=2,t.TYPE_FILL_AND_OUTLINE=3,t.TYPE_ANTIALIASING=4,t.TYPE_CENTER_LABEL=5,t}(),r}(),o.LayerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(a[0].decode(e,e.uint32()));break;case 2:o.preserveTextLevel=e.int32();break;case 4:o.lodBeginTransition=e.bool();break;case 5:o.lodEndTransition=e.bool();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.zoomRange){if(!Array.isArray(e.zoomRange))return"zoomRange: array expected";for(var t=0;t>>3){case 1:o.isExpandable=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.isExpandable&&"boolean"!=typeof e.isExpandable?"isExpandable: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FolderProto)return e;var t=new n.keyhole.dbroot.FolderProto;return void 0!==e.isExpandable&&null!==e.isExpandable&&(t.isExpandable=Boolean(e.isExpandable)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isExpandable=!0),void 0!==e.isExpandable&&null!==e.isExpandable&&e.hasOwnProperty("isExpandable")&&(r.isExpandable=e.isExpandable),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.RequirementProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 3:o.requiredVram=e.string();break;case 4:o.requiredClientVer=e.string();break;case 5:o.probability=e.string();break;case 6:o.requiredUserAgent=e.string();break;case 7:o.requiredClientCapabilities=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.requiredVram||r.isString(e.requiredVram)?void 0===e.requiredClientVer||r.isString(e.requiredClientVer)?void 0===e.probability||r.isString(e.probability)?void 0===e.requiredUserAgent||r.isString(e.requiredUserAgent)?void 0===e.requiredClientCapabilities||r.isString(e.requiredClientCapabilities)?null:"requiredClientCapabilities: string expected":"requiredUserAgent: string expected":"probability: string expected":"requiredClientVer: string expected":"requiredVram: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.RequirementProto)return e;var t=new n.keyhole.dbroot.RequirementProto;return void 0!==e.requiredVram&&null!==e.requiredVram&&(t.requiredVram=String(e.requiredVram)),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&(t.requiredClientVer=String(e.requiredClientVer)),void 0!==e.probability&&null!==e.probability&&(t.probability=String(e.probability)),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&(t.requiredUserAgent=String(e.requiredUserAgent)),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&(t.requiredClientCapabilities=String(e.requiredClientCapabilities)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.requiredVram="",r.requiredClientVer="",r.probability="",r.requiredUserAgent="",r.requiredClientCapabilities=""),void 0!==e.requiredVram&&null!==e.requiredVram&&e.hasOwnProperty("requiredVram")&&(r.requiredVram=e.requiredVram),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&e.hasOwnProperty("requiredClientVer")&&(r.requiredClientVer=e.requiredClientVer),void 0!==e.probability&&null!==e.probability&&e.hasOwnProperty("probability")&&(r.probability=e.probability),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&e.hasOwnProperty("requiredUserAgent")&&(r.requiredUserAgent=e.requiredUserAgent),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&e.hasOwnProperty("requiredClientCapabilities")&&(r.requiredClientCapabilities=e.requiredClientCapabilities),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.LookAtProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.longitude=e.float();break;case 2:o.latitude=e.float();break;case 3:o.range=e.float();break;case 4:o.tilt=e.float();break;case 5:o.heading=e.float();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.longitude?"longitude: number expected":"number"!=typeof e.latitude?"latitude: number expected":void 0!==e.range&&"number"!=typeof e.range?"range: number expected":void 0!==e.tilt&&"number"!=typeof e.tilt?"tilt: number expected":void 0!==e.heading&&"number"!=typeof e.heading?"heading: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LookAtProto)return e;var t=new n.keyhole.dbroot.LookAtProto;return void 0!==e.longitude&&null!==e.longitude&&(t.longitude=Number(e.longitude)),void 0!==e.latitude&&null!==e.latitude&&(t.latitude=Number(e.latitude)),void 0!==e.range&&null!==e.range&&(t.range=Number(e.range)),void 0!==e.tilt&&null!==e.tilt&&(t.tilt=Number(e.tilt)),void 0!==e.heading&&null!==e.heading&&(t.heading=Number(e.heading)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.longitude=0,r.latitude=0,r.range=0,r.tilt=0,r.heading=0),void 0!==e.longitude&&null!==e.longitude&&e.hasOwnProperty("longitude")&&(r.longitude=e.longitude),void 0!==e.latitude&&null!==e.latitude&&e.hasOwnProperty("latitude")&&(r.latitude=e.latitude),void 0!==e.range&&null!==e.range&&e.hasOwnProperty("range")&&(r.range=e.range),void 0!==e.tilt&&null!==e.tilt&&e.hasOwnProperty("tilt")&&(r.tilt=e.tilt),void 0!==e.heading&&null!==e.heading&&e.hasOwnProperty("heading")&&(r.heading=e.heading),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.NestedFeatureProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.featureType=e.uint32();break;case 2:o.kmlUrl=a[1].decode(e,e.uint32());break;case 21:o.databaseUrl=e.string();break;case 3:o.layer=a[3].decode(e,e.uint32());break;case 4:o.folder=a[4].decode(e,e.uint32());break;case 5:o.requirement=a[5].decode(e,e.uint32());break;case 6:o.channelId=e.int32();break;case 7:o.displayName=a[7].decode(e,e.uint32());break;case 8:o.isVisible=e.bool();break;case 9:o.isEnabled=e.bool();break;case 10:o.isChecked=e.bool();break;case 11:o.layerMenuIconPath=e.string();break;case 12:o.description=a[12].decode(e,e.uint32());break;case 13:o.lookAt=a[13].decode(e,e.uint32());break;case 15:o.assetUuid=e.string();break;case 16:o.isSaveLocked=e.bool();break;case 17:o.children&&o.children.length||(o.children=[]),o.children.push(a[16].decode(e,e.uint32()));break;case 18:o.clientConfigScriptName=e.string();break;case 19:o.dioramaDataChannelBase=e.int32();break;case 20:o.replicaDataChannelBase=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.featureType)switch(e.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){var t=a[1].verify(e.kmlUrl);if(t)return"kmlUrl."+t}if(void 0!==e.databaseUrl&&!r.isString(e.databaseUrl))return"databaseUrl: string expected";if(void 0!==e.layer&&null!==e.layer){var t=a[3].verify(e.layer);if(t)return"layer."+t}if(void 0!==e.folder&&null!==e.folder){var t=a[4].verify(e.folder);if(t)return"folder."+t}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}if(!r.isInteger(e.channelId))return"channelId: integer expected";if(void 0!==e.displayName&&null!==e.displayName){var t=a[7].verify(e.displayName);if(t)return"displayName."+t}if(void 0!==e.isVisible&&"boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.isEnabled&&"boolean"!=typeof e.isEnabled)return"isEnabled: boolean expected";if(void 0!==e.isChecked&&"boolean"!=typeof e.isChecked)return"isChecked: boolean expected";if(void 0!==e.layerMenuIconPath&&!r.isString(e.layerMenuIconPath))return"layerMenuIconPath: string expected";if(void 0!==e.description&&null!==e.description){var t=a[12].verify(e.description);if(t)return"description."+t}if(void 0!==e.lookAt&&null!==e.lookAt){var t=a[13].verify(e.lookAt);if(t)return"lookAt."+t}if(void 0!==e.assetUuid&&!r.isString(e.assetUuid))return"assetUuid: string expected";if(void 0!==e.isSaveLocked&&"boolean"!=typeof e.isSaveLocked)return"isSaveLocked: boolean expected";if(void 0!==e.children){if(!Array.isArray(e.children))return"children: array expected";for(var i=0;i>>3){case 1:o.countryCode=e.string();break;case 2:o.domainName=e.string();break;case 3:if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos>>3){case 1:o.disableDiskCache=e.bool();break;case 2:o.disableEmbeddedBrowserVista=e.bool();break;case 3:o.drawAtmosphere=e.bool();break;case 4:o.drawStars=e.bool();break;case 5:o.shaderFilePrefix=e.string();break;case 6:o.useProtobufQuadtreePackets=e.bool();break;case 7:o.useExtendedCopyrightIds=e.bool();break;case 8:o.precipitationsOptions=a[7].decode(e,e.uint32());break;case 9:o.captureOptions=a[8].decode(e,e.uint32());break;case 10:o.show_2dMapsIcon=e.bool();break;case 11:o.disableInternalBrowser=e.bool();break;case 12:o.internalBrowserBlacklist=e.string();break;case 13:o.internalBrowserOriginWhitelist=e.string();break;case 14:o.polarTileMergingLevel=e.int32();break;case 15:o.jsBridgeRequestWhitelist=e.string();break;case 16:o.mapsOptions=a[15].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.disableDiskCache&&"boolean"!=typeof e.disableDiskCache)return"disableDiskCache: boolean expected";if(void 0!==e.disableEmbeddedBrowserVista&&"boolean"!=typeof e.disableEmbeddedBrowserVista)return"disableEmbeddedBrowserVista: boolean expected";if(void 0!==e.drawAtmosphere&&"boolean"!=typeof e.drawAtmosphere)return"drawAtmosphere: boolean expected";if(void 0!==e.drawStars&&"boolean"!=typeof e.drawStars)return"drawStars: boolean expected";if(void 0!==e.shaderFilePrefix&&!r.isString(e.shaderFilePrefix))return"shaderFilePrefix: string expected";if(void 0!==e.useProtobufQuadtreePackets&&"boolean"!=typeof e.useProtobufQuadtreePackets)return"useProtobufQuadtreePackets: boolean expected";if(void 0!==e.useExtendedCopyrightIds&&"boolean"!=typeof e.useExtendedCopyrightIds)return"useExtendedCopyrightIds: boolean expected";if(void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){var t=a[7].verify(e.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(void 0!==e.captureOptions&&null!==e.captureOptions){var t=a[8].verify(e.captureOptions);if(t)return"captureOptions."+t}if(void 0!==e.show_2dMapsIcon&&"boolean"!=typeof e.show_2dMapsIcon)return"show_2dMapsIcon: boolean expected";if(void 0!==e.disableInternalBrowser&&"boolean"!=typeof e.disableInternalBrowser)return"disableInternalBrowser: boolean expected";if(void 0!==e.internalBrowserBlacklist&&!r.isString(e.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(void 0!==e.internalBrowserOriginWhitelist&&!r.isString(e.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(void 0!==e.polarTileMergingLevel&&!r.isInteger(e.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(void 0!==e.jsBridgeRequestWhitelist&&!r.isString(e.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(void 0!==e.mapsOptions&&null!==e.mapsOptions){var t=a[15].verify(e.mapsOptions);if(t)return"mapsOptions."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto)return e;var t=new n.keyhole.dbroot.ClientOptionsProto;if(void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&(t.disableDiskCache=Boolean(e.disableDiskCache)),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&(t.disableEmbeddedBrowserVista=Boolean(e.disableEmbeddedBrowserVista)),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&(t.drawAtmosphere=Boolean(e.drawAtmosphere)),void 0!==e.drawStars&&null!==e.drawStars&&(t.drawStars=Boolean(e.drawStars)),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&(t.shaderFilePrefix=String(e.shaderFilePrefix)),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&(t.useProtobufQuadtreePackets=Boolean(e.useProtobufQuadtreePackets)),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&(t.useExtendedCopyrightIds=Boolean(e.useExtendedCopyrightIds)),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){if("object"!=typeof e.precipitationsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=a[7].fromObject(e.precipitationsOptions)}if(void 0!==e.captureOptions&&null!==e.captureOptions){if("object"!=typeof e.captureOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=a[8].fromObject(e.captureOptions)}if(void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&(t.show_2dMapsIcon=Boolean(e.show_2dMapsIcon)),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&(t.disableInternalBrowser=Boolean(e.disableInternalBrowser)),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&(t.internalBrowserBlacklist=String(e.internalBrowserBlacklist)),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&(t.internalBrowserOriginWhitelist=String(e.internalBrowserOriginWhitelist)),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&(t.polarTileMergingLevel=0|e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&(t.jsBridgeRequestWhitelist=String(e.jsBridgeRequestWhitelist)),void 0!==e.mapsOptions&&null!==e.mapsOptions){if("object"!=typeof e.mapsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=a[15].fromObject(e.mapsOptions)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.disableDiskCache=!1,r.disableEmbeddedBrowserVista=!1,r.drawAtmosphere=!0,r.drawStars=!0,r.shaderFilePrefix="",r.useProtobufQuadtreePackets=!1,r.useExtendedCopyrightIds=!0,r.precipitationsOptions=null,r.captureOptions=null,r.show_2dMapsIcon=!0,r.disableInternalBrowser=!1,r.internalBrowserBlacklist="",r.internalBrowserOriginWhitelist="*",r.polarTileMergingLevel=0,r.jsBridgeRequestWhitelist="http://*.google.com/*",r.mapsOptions=null),void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&e.hasOwnProperty("disableDiskCache")&&(r.disableDiskCache=e.disableDiskCache),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&e.hasOwnProperty("disableEmbeddedBrowserVista")&&(r.disableEmbeddedBrowserVista=e.disableEmbeddedBrowserVista),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&e.hasOwnProperty("drawAtmosphere")&&(r.drawAtmosphere=e.drawAtmosphere),void 0!==e.drawStars&&null!==e.drawStars&&e.hasOwnProperty("drawStars")&&(r.drawStars=e.drawStars),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&e.hasOwnProperty("shaderFilePrefix")&&(r.shaderFilePrefix=e.shaderFilePrefix),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&e.hasOwnProperty("useProtobufQuadtreePackets")&&(r.useProtobufQuadtreePackets=e.useProtobufQuadtreePackets),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&e.hasOwnProperty("useExtendedCopyrightIds")&&(r.useExtendedCopyrightIds=e.useExtendedCopyrightIds),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions&&e.hasOwnProperty("precipitationsOptions")&&(r.precipitationsOptions=a[7].toObject(e.precipitationsOptions,t)),void 0!==e.captureOptions&&null!==e.captureOptions&&e.hasOwnProperty("captureOptions")&&(r.captureOptions=a[8].toObject(e.captureOptions,t)),void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&e.hasOwnProperty("show_2dMapsIcon")&&(r.show_2dMapsIcon=e.show_2dMapsIcon),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&e.hasOwnProperty("disableInternalBrowser")&&(r.disableInternalBrowser=e.disableInternalBrowser),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&e.hasOwnProperty("internalBrowserBlacklist")&&(r.internalBrowserBlacklist=e.internalBrowserBlacklist),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&e.hasOwnProperty("internalBrowserOriginWhitelist")&&(r.internalBrowserOriginWhitelist=e.internalBrowserOriginWhitelist),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&e.hasOwnProperty("polarTileMergingLevel")&&(r.polarTileMergingLevel=e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&e.hasOwnProperty("jsBridgeRequestWhitelist")&&(r.jsBridgeRequestWhitelist=e.jsBridgeRequestWhitelist),void 0!==e.mapsOptions&&null!==e.mapsOptions&&e.hasOwnProperty("mapsOptions")&&(r.mapsOptions=a[15].toObject(e.mapsOptions,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.PrecipitationsOptions=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.imageUrl=e.string();break;case 2:o.imageExpireTime=e.int32();break;case 3:o.maxColorDistance=e.int32();break;case 4:o.imageLevel=e.int32();break;case 5:o.weatherMapping&&o.weatherMapping.length||(o.weatherMapping=[]),o.weatherMapping.push(a[4].decode(e,e.uint32()));break;case 6:o.cloudsLayerUrl=e.string();break;case 7:o.animationDecelerationDelay=e.float();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageUrl&&!r.isString(e.imageUrl))return"imageUrl: string expected";if(void 0!==e.imageExpireTime&&!r.isInteger(e.imageExpireTime))return"imageExpireTime: integer expected";if(void 0!==e.maxColorDistance&&!r.isInteger(e.maxColorDistance))return"maxColorDistance: integer expected";if(void 0!==e.imageLevel&&!r.isInteger(e.imageLevel))return"imageLevel: integer expected";if(void 0!==e.weatherMapping){if(!Array.isArray(e.weatherMapping))return"weatherMapping: array expected";for(var t=0;t>>3){case 1:o.colorAbgr=e.uint32();break;case 2:o.weatherType=e.uint32();break;case 3:o.elongation=e.float();break;case 4:o.opacity=e.float();break;case 5:o.fogDensity=e.float();break;case 6:o.speed0=e.float();break;case 7:o.speed1=e.float();break;case 8:o.speed2=e.float();break;case 9:o.speed3=e.float();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:}return void 0!==e.elongation&&"number"!=typeof e.elongation?"elongation: number expected":void 0!==e.opacity&&"number"!=typeof e.opacity?"opacity: number expected":void 0!==e.fogDensity&&"number"!=typeof e.fogDensity?"fogDensity: number expected":void 0!==e.speed0&&"number"!=typeof e.speed0?"speed0: number expected":void 0!==e.speed1&&"number"!=typeof e.speed1?"speed1: number expected":void 0!==e.speed2&&"number"!=typeof e.speed2?"speed2: number expected":void 0!==e.speed3&&"number"!=typeof e.speed3?"speed3: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(void 0!==e.colorAbgr&&null!==e.colorAbgr&&(t.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:t.weatherType=0;break;case"RAIN":case 1:t.weatherType=1;break;case"SNOW":case 2:t.weatherType=2}return void 0!==e.elongation&&null!==e.elongation&&(t.elongation=Number(e.elongation)),void 0!==e.opacity&&null!==e.opacity&&(t.opacity=Number(e.opacity)),void 0!==e.fogDensity&&null!==e.fogDensity&&(t.fogDensity=Number(e.fogDensity)),void 0!==e.speed0&&null!==e.speed0&&(t.speed0=Number(e.speed0)),void 0!==e.speed1&&null!==e.speed1&&(t.speed1=Number(e.speed1)),void 0!==e.speed2&&null!==e.speed2&&(t.speed2=Number(e.speed2)),void 0!==e.speed3&&null!==e.speed3&&(t.speed3=Number(e.speed3)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.colorAbgr=0,r.weatherType=t.enums===String?"NO_PRECIPITATION":0,r.elongation=1,r.opacity=0,r.fogDensity=0,r.speed0=0,r.speed1=0,r.speed2=0,r.speed3=0),void 0!==e.colorAbgr&&null!==e.colorAbgr&&e.hasOwnProperty("colorAbgr")&&(r.colorAbgr=e.colorAbgr),void 0!==e.weatherType&&null!==e.weatherType&&e.hasOwnProperty("weatherType")&&(r.weatherType=t.enums===String?a[1][e.weatherType]:e.weatherType),void 0!==e.elongation&&null!==e.elongation&&e.hasOwnProperty("elongation")&&(r.elongation=e.elongation),void 0!==e.opacity&&null!==e.opacity&&e.hasOwnProperty("opacity")&&(r.opacity=e.opacity),void 0!==e.fogDensity&&null!==e.fogDensity&&e.hasOwnProperty("fogDensity")&&(r.fogDensity=e.fogDensity),void 0!==e.speed0&&null!==e.speed0&&e.hasOwnProperty("speed0")&&(r.speed0=e.speed0),void 0!==e.speed1&&null!==e.speed1&&e.hasOwnProperty("speed1")&&(r.speed1=e.speed1),void 0!==e.speed2&&null!==e.speed2&&e.hasOwnProperty("speed2")&&(r.speed2=e.speed2),void 0!==e.speed3&&null!==e.speed3&&e.hasOwnProperty("speed3")&&(r.speed3=e.speed3),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherType=function(){var e={},t=Object.create(e);return t.NO_PRECIPITATION=0,t.RAIN=1,t.SNOW=2,t}(),o}(),o}(),o.CaptureOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.allowSaveAsImage=e.bool();break;case 2:o.maxFreeCaptureRes=e.int32();break;case 3:o.maxPremiumCaptureRes=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.allowSaveAsImage&&"boolean"!=typeof e.allowSaveAsImage?"allowSaveAsImage: boolean expected":void 0===e.maxFreeCaptureRes||r.isInteger(e.maxFreeCaptureRes)?void 0===e.maxPremiumCaptureRes||r.isInteger(e.maxPremiumCaptureRes)?null:"maxPremiumCaptureRes: integer expected":"maxFreeCaptureRes: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&(t.allowSaveAsImage=Boolean(e.allowSaveAsImage)),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&(t.maxFreeCaptureRes=0|e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&(t.maxPremiumCaptureRes=0|e.maxPremiumCaptureRes),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.allowSaveAsImage=!0,r.maxFreeCaptureRes=2400,r.maxPremiumCaptureRes=4800),void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&e.hasOwnProperty("allowSaveAsImage")&&(r.allowSaveAsImage=e.allowSaveAsImage),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&e.hasOwnProperty("maxFreeCaptureRes")&&(r.maxFreeCaptureRes=e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&e.hasOwnProperty("maxPremiumCaptureRes")&&(r.maxPremiumCaptureRes=e.maxPremiumCaptureRes),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.MapsOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.enableMaps=e.bool();break;case 2:o.docsAutoDownloadEnabled=e.bool();break;case 3:o.docsAutoDownloadInterval=e.int32();break;case 4:o.docsAutoUploadEnabled=e.bool();break;case 5:o.docsAutoUploadDelay=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.enableMaps&&"boolean"!=typeof e.enableMaps?"enableMaps: boolean expected":void 0!==e.docsAutoDownloadEnabled&&"boolean"!=typeof e.docsAutoDownloadEnabled?"docsAutoDownloadEnabled: boolean expected":void 0===e.docsAutoDownloadInterval||r.isInteger(e.docsAutoDownloadInterval)?void 0!==e.docsAutoUploadEnabled&&"boolean"!=typeof e.docsAutoUploadEnabled?"docsAutoUploadEnabled: boolean expected":void 0===e.docsAutoUploadDelay||r.isInteger(e.docsAutoUploadDelay)?null:"docsAutoUploadDelay: integer expected":"docsAutoDownloadInterval: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return void 0!==e.enableMaps&&null!==e.enableMaps&&(t.enableMaps=Boolean(e.enableMaps)),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&(t.docsAutoDownloadEnabled=Boolean(e.docsAutoDownloadEnabled)),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&(t.docsAutoDownloadInterval=0|e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&(t.docsAutoUploadEnabled=Boolean(e.docsAutoUploadEnabled)),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&(t.docsAutoUploadDelay=0|e.docsAutoUploadDelay),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.enableMaps=!1,r.docsAutoDownloadEnabled=!1,r.docsAutoDownloadInterval=0,r.docsAutoUploadEnabled=!1,r.docsAutoUploadDelay=0),void 0!==e.enableMaps&&null!==e.enableMaps&&e.hasOwnProperty("enableMaps")&&(r.enableMaps=e.enableMaps),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&e.hasOwnProperty("docsAutoDownloadEnabled")&&(r.docsAutoDownloadEnabled=e.docsAutoDownloadEnabled),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&e.hasOwnProperty("docsAutoDownloadInterval")&&(r.docsAutoDownloadInterval=e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&e.hasOwnProperty("docsAutoUploadEnabled")&&(r.docsAutoUploadEnabled=e.docsAutoUploadEnabled),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&e.hasOwnProperty("docsAutoUploadDelay")&&(r.docsAutoUploadDelay=e.docsAutoUploadDelay),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o}(),o.FetchingOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.maxRequestsPerQuery=e.int32();break;case 12:o.forceMaxRequestsPerQuery=e.bool();break;case 13:o.sortBatches=e.bool();break;case 2:o.maxDrawable=e.int32();break;case 3:o.maxImagery=e.int32();break;case 4:o.maxTerrain=e.int32();break;case 5:o.maxQuadtree=e.int32();break;case 6:o.maxDioramaMetadata=e.int32();break;case 7:o.maxDioramaData=e.int32();break;case 8:o.maxConsumerFetchRatio=e.float();break;case 9:o.maxProEcFetchRatio=e.float();break;case 10:o.safeOverallQps=e.float();break;case 11:o.safeImageryQps=e.float();break;case 14:o.domainsForHttps=e.string();break;case 15:o.hostsForHttp=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){ return"object"!=typeof e||null===e?"object expected":void 0===e.maxRequestsPerQuery||r.isInteger(e.maxRequestsPerQuery)?void 0!==e.forceMaxRequestsPerQuery&&"boolean"!=typeof e.forceMaxRequestsPerQuery?"forceMaxRequestsPerQuery: boolean expected":void 0!==e.sortBatches&&"boolean"!=typeof e.sortBatches?"sortBatches: boolean expected":void 0===e.maxDrawable||r.isInteger(e.maxDrawable)?void 0===e.maxImagery||r.isInteger(e.maxImagery)?void 0===e.maxTerrain||r.isInteger(e.maxTerrain)?void 0===e.maxQuadtree||r.isInteger(e.maxQuadtree)?void 0===e.maxDioramaMetadata||r.isInteger(e.maxDioramaMetadata)?void 0===e.maxDioramaData||r.isInteger(e.maxDioramaData)?void 0!==e.maxConsumerFetchRatio&&"number"!=typeof e.maxConsumerFetchRatio?"maxConsumerFetchRatio: number expected":void 0!==e.maxProEcFetchRatio&&"number"!=typeof e.maxProEcFetchRatio?"maxProEcFetchRatio: number expected":void 0!==e.safeOverallQps&&"number"!=typeof e.safeOverallQps?"safeOverallQps: number expected":void 0!==e.safeImageryQps&&"number"!=typeof e.safeImageryQps?"safeImageryQps: number expected":void 0===e.domainsForHttps||r.isString(e.domainsForHttps)?void 0===e.hostsForHttp||r.isString(e.hostsForHttp)?null:"hostsForHttp: string expected":"domainsForHttps: string expected":"maxDioramaData: integer expected":"maxDioramaMetadata: integer expected":"maxQuadtree: integer expected":"maxTerrain: integer expected":"maxImagery: integer expected":"maxDrawable: integer expected":"maxRequestsPerQuery: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FetchingOptionsProto)return e;var t=new n.keyhole.dbroot.FetchingOptionsProto;return void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&(t.maxRequestsPerQuery=0|e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&(t.forceMaxRequestsPerQuery=Boolean(e.forceMaxRequestsPerQuery)),void 0!==e.sortBatches&&null!==e.sortBatches&&(t.sortBatches=Boolean(e.sortBatches)),void 0!==e.maxDrawable&&null!==e.maxDrawable&&(t.maxDrawable=0|e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&(t.maxImagery=0|e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&(t.maxTerrain=0|e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&(t.maxQuadtree=0|e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&(t.maxDioramaMetadata=0|e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&(t.maxDioramaData=0|e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&(t.maxConsumerFetchRatio=Number(e.maxConsumerFetchRatio)),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&(t.maxProEcFetchRatio=Number(e.maxProEcFetchRatio)),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&(t.safeOverallQps=Number(e.safeOverallQps)),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&(t.safeImageryQps=Number(e.safeImageryQps)),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&(t.domainsForHttps=String(e.domainsForHttps)),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&(t.hostsForHttp=String(e.hostsForHttp)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.maxRequestsPerQuery=1,r.forceMaxRequestsPerQuery=!1,r.sortBatches=!1,r.maxDrawable=2,r.maxImagery=2,r.maxTerrain=5,r.maxQuadtree=5,r.maxDioramaMetadata=1,r.maxDioramaData=0,r.maxConsumerFetchRatio=1,r.maxProEcFetchRatio=0,r.safeOverallQps=0,r.safeImageryQps=0,r.domainsForHttps="google.com gstatic.com",r.hostsForHttp=""),void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&e.hasOwnProperty("maxRequestsPerQuery")&&(r.maxRequestsPerQuery=e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&e.hasOwnProperty("forceMaxRequestsPerQuery")&&(r.forceMaxRequestsPerQuery=e.forceMaxRequestsPerQuery),void 0!==e.sortBatches&&null!==e.sortBatches&&e.hasOwnProperty("sortBatches")&&(r.sortBatches=e.sortBatches),void 0!==e.maxDrawable&&null!==e.maxDrawable&&e.hasOwnProperty("maxDrawable")&&(r.maxDrawable=e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&e.hasOwnProperty("maxImagery")&&(r.maxImagery=e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&e.hasOwnProperty("maxTerrain")&&(r.maxTerrain=e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&e.hasOwnProperty("maxQuadtree")&&(r.maxQuadtree=e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&e.hasOwnProperty("maxDioramaMetadata")&&(r.maxDioramaMetadata=e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&e.hasOwnProperty("maxDioramaData")&&(r.maxDioramaData=e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&e.hasOwnProperty("maxConsumerFetchRatio")&&(r.maxConsumerFetchRatio=e.maxConsumerFetchRatio),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&e.hasOwnProperty("maxProEcFetchRatio")&&(r.maxProEcFetchRatio=e.maxProEcFetchRatio),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&e.hasOwnProperty("safeOverallQps")&&(r.safeOverallQps=e.safeOverallQps),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&e.hasOwnProperty("safeImageryQps")&&(r.safeImageryQps=e.safeImageryQps),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&e.hasOwnProperty("domainsForHttps")&&(r.domainsForHttps=e.domainsForHttps),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&e.hasOwnProperty("hostsForHttp")&&(r.hostsForHttp=e.hostsForHttp),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.TimeMachineOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.serverUrl=e.string();break;case 2:o.isTimemachine=e.bool();break;case 3:o.dwellTimeMs=e.int32();break;case 4:o.discoverabilityAltitudeMeters=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.serverUrl||r.isString(e.serverUrl)?void 0!==e.isTimemachine&&"boolean"!=typeof e.isTimemachine?"isTimemachine: boolean expected":void 0===e.dwellTimeMs||r.isInteger(e.dwellTimeMs)?void 0===e.discoverabilityAltitudeMeters||r.isInteger(e.discoverabilityAltitudeMeters)?null:"discoverabilityAltitudeMeters: integer expected":"dwellTimeMs: integer expected":"serverUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return e;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return void 0!==e.serverUrl&&null!==e.serverUrl&&(t.serverUrl=String(e.serverUrl)),void 0!==e.isTimemachine&&null!==e.isTimemachine&&(t.isTimemachine=Boolean(e.isTimemachine)),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&(t.dwellTimeMs=0|e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&(t.discoverabilityAltitudeMeters=0|e.discoverabilityAltitudeMeters),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverUrl="",r.isTimemachine=!1,r.dwellTimeMs=500,r.discoverabilityAltitudeMeters=15e3),void 0!==e.serverUrl&&null!==e.serverUrl&&e.hasOwnProperty("serverUrl")&&(r.serverUrl=e.serverUrl),void 0!==e.isTimemachine&&null!==e.isTimemachine&&e.hasOwnProperty("isTimemachine")&&(r.isTimemachine=e.isTimemachine),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&e.hasOwnProperty("dwellTimeMs")&&(r.dwellTimeMs=e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&e.hasOwnProperty("discoverabilityAltitudeMeters")&&(r.discoverabilityAltitudeMeters=e.discoverabilityAltitudeMeters),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.AutopiaOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.metadataServerUrl=e.string();break;case 2:o.depthmapServerUrl=e.string();break;case 3:o.coverageOverlayUrl=e.string();break;case 4:o.maxImageryQps=e.float();break;case 5:o.maxMetadataDepthmapQps=e.float();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.metadataServerUrl||r.isString(e.metadataServerUrl)?void 0===e.depthmapServerUrl||r.isString(e.depthmapServerUrl)?void 0===e.coverageOverlayUrl||r.isString(e.coverageOverlayUrl)?void 0!==e.maxImageryQps&&"number"!=typeof e.maxImageryQps?"maxImageryQps: number expected":void 0!==e.maxMetadataDepthmapQps&&"number"!=typeof e.maxMetadataDepthmapQps?"maxMetadataDepthmapQps: number expected":null:"coverageOverlayUrl: string expected":"depthmapServerUrl: string expected":"metadataServerUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.AutopiaOptionsProto)return e;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&(t.metadataServerUrl=String(e.metadataServerUrl)),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&(t.depthmapServerUrl=String(e.depthmapServerUrl)),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&(t.coverageOverlayUrl=String(e.coverageOverlayUrl)),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&(t.maxImageryQps=Number(e.maxImageryQps)),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&(t.maxMetadataDepthmapQps=Number(e.maxMetadataDepthmapQps)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.metadataServerUrl="http://cbk0.google.com/cbk",r.depthmapServerUrl="http://cbk0.google.com/cbk",r.coverageOverlayUrl="",r.maxImageryQps=0,r.maxMetadataDepthmapQps=0),void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&e.hasOwnProperty("metadataServerUrl")&&(r.metadataServerUrl=e.metadataServerUrl),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&e.hasOwnProperty("depthmapServerUrl")&&(r.depthmapServerUrl=e.depthmapServerUrl),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&e.hasOwnProperty("coverageOverlayUrl")&&(r.coverageOverlayUrl=e.coverageOverlayUrl),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&e.hasOwnProperty("maxImageryQps")&&(r.maxImageryQps=e.maxImageryQps),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&e.hasOwnProperty("maxMetadataDepthmapQps")&&(r.maxMetadataDepthmapQps=e.maxMetadataDepthmapQps),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.CSIOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.samplingPercentage=e.int32();break;case 2:o.experimentId=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.samplingPercentage||r.isInteger(e.samplingPercentage)?void 0===e.experimentId||r.isString(e.experimentId)?null:"experimentId: string expected":"samplingPercentage: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CSIOptionsProto)return e;var t=new n.keyhole.dbroot.CSIOptionsProto;return void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&(t.samplingPercentage=0|e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&(t.experimentId=String(e.experimentId)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.samplingPercentage=0,r.experimentId=""),void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&e.hasOwnProperty("samplingPercentage")&&(r.samplingPercentage=e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&e.hasOwnProperty("experimentId")&&(r.experimentId=e.experimentId),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SearchTabProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.isVisible=e.bool();break;case 2:o.tabLabel=a[1].decode(e,e.uint32());break;case 3:o.baseUrl=e.string();break;case 4:o.viewportPrefix=e.string();break;case 5:o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(a[4].decode(e,e.uint32()));break;case 6:o.requirement=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if("boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.tabLabel&&null!==e.tabLabel){var t=a[1].verify(e.tabLabel);if(t)return"tabLabel."+t}if(void 0!==e.baseUrl&&!r.isString(e.baseUrl))return"baseUrl: string expected";if(void 0!==e.viewportPrefix&&!r.isString(e.viewportPrefix))return"viewportPrefix: string expected";if(void 0!==e.inputBox){if(!Array.isArray(e.inputBox))return"inputBox: array expected";for(var i=0;i>>3){case 1:o.label=a[0].decode(e,e.uint32());break;case 2:o.queryVerb=e.string();break;case 3:o.queryPrepend=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=a[0].verify(e.label);return t?"label."+t:r.isString(e.queryVerb)?void 0===e.queryPrepend||r.isString(e.queryPrepend)?null:"queryPrepend: string expected":"queryVerb: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return e;var t=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");t.label=a[0].fromObject(e.label)}return void 0!==e.queryVerb&&null!==e.queryVerb&&(t.queryVerb=String(e.queryVerb)),void 0!==e.queryPrepend&&null!==e.queryPrepend&&(t.queryPrepend=String(e.queryPrepend)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.label=null,r.queryVerb="",r.queryPrepend=""),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[0].toObject(e.label,t)),void 0!==e.queryVerb&&null!==e.queryVerb&&e.hasOwnProperty("queryVerb")&&(r.queryVerb=e.queryVerb),void 0!==e.queryPrepend&&null!==e.queryPrepend&&e.hasOwnProperty("queryPrepend")&&(r.queryPrepend=e.queryPrepend),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.CobrandProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.logoUrl=e.string();break;case 2:o.xCoord=a[1].decode(e,e.uint32());break;case 3:o.yCoord=a[2].decode(e,e.uint32());break;case 4:o.tiePoint=e.uint32();break;case 5:o.screenSize=e.double();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.logoUrl))return"logoUrl: string expected";if(void 0!==e.xCoord&&null!==e.xCoord){var t=a[1].verify(e.xCoord);if(t)return"xCoord."+t}if(void 0!==e.yCoord&&null!==e.yCoord){var t=a[2].verify(e.yCoord);if(t)return"yCoord."+t}if(void 0!==e.tiePoint)switch(e.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return void 0!==e.screenSize&&"number"!=typeof e.screenSize?"screenSize: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto)return e;var t=new n.keyhole.dbroot.CobrandProto;if(void 0!==e.logoUrl&&null!==e.logoUrl&&(t.logoUrl=String(e.logoUrl)),void 0!==e.xCoord&&null!==e.xCoord){if("object"!=typeof e.xCoord)throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=a[1].fromObject(e.xCoord)}if(void 0!==e.yCoord&&null!==e.yCoord){if("object"!=typeof e.yCoord)throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=a[2].fromObject(e.yCoord)}switch(e.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8}return void 0!==e.screenSize&&null!==e.screenSize&&(t.screenSize=Number(e.screenSize)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.logoUrl="",r.xCoord=null,r.yCoord=null,r.tiePoint=t.enums===String?"BOTTOM_LEFT":6,r.screenSize=0),void 0!==e.logoUrl&&null!==e.logoUrl&&e.hasOwnProperty("logoUrl")&&(r.logoUrl=e.logoUrl),void 0!==e.xCoord&&null!==e.xCoord&&e.hasOwnProperty("xCoord")&&(r.xCoord=a[1].toObject(e.xCoord,t)),void 0!==e.yCoord&&null!==e.yCoord&&e.hasOwnProperty("yCoord")&&(r.yCoord=a[2].toObject(e.yCoord,t)),void 0!==e.tiePoint&&null!==e.tiePoint&&e.hasOwnProperty("tiePoint")&&(r.tiePoint=t.enums===String?a[3][e.tiePoint]:e.tiePoint),void 0!==e.screenSize&&null!==e.screenSize&&e.hasOwnProperty("screenSize")&&(r.screenSize=e.screenSize),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Coord=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.value=e.double();break;case 2:o.isRelative=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.value?"value: number expected":void 0!==e.isRelative&&"boolean"!=typeof e.isRelative?"isRelative: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto.Coord)return e;var t=new n.keyhole.dbroot.CobrandProto.Coord;return void 0!==e.value&&null!==e.value&&(t.value=Number(e.value)),void 0!==e.isRelative&&null!==e.isRelative&&(t.isRelative=Boolean(e.isRelative)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.value=0,r.isRelative=!1),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),void 0!==e.isRelative&&null!==e.isRelative&&e.hasOwnProperty("isRelative")&&(r.isRelative=e.isRelative),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.TiePoint=function(){var e={},t=Object.create(e);return t.TOP_LEFT=0,t.TOP_CENTER=1,t.TOP_RIGHT=2,t.MID_LEFT=3,t.MID_CENTER=4,t.MID_RIGHT=5,t.BOTTOM_LEFT=6,t.BOTTOM_CENTER=7,t.BOTTOM_RIGHT=8,t}(),o}(),o.DatabaseDescriptionProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.databaseName=a[0].decode(e,e.uint32());break;case 2:o.databaseUrl=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}return r.isString(e.databaseUrl)?null:"databaseUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return e;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}return void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.databaseName=null,r.databaseUrl=""),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ConfigScriptProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.scriptName=e.string();break;case 2:o.scriptData=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isString(e.scriptName)?r.isString(e.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ConfigScriptProto)return e;var t=new n.keyhole.dbroot.ConfigScriptProto;return void 0!==e.scriptName&&null!==e.scriptName&&(t.scriptName=String(e.scriptName)),void 0!==e.scriptData&&null!==e.scriptData&&(t.scriptData=String(e.scriptData)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.scriptName="",r.scriptData=""),void 0!==e.scriptName&&null!==e.scriptName&&e.hasOwnProperty("scriptName")&&(r.scriptName=e.scriptName),void 0!==e.scriptData&&null!==e.scriptData&&e.hasOwnProperty("scriptData")&&(r.scriptData=e.scriptData),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SwoopParamsProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.startDistInMeters=e.double();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.startDistInMeters&&"number"!=typeof e.startDistInMeters?"startDistInMeters: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SwoopParamsProto)return e;var t=new n.keyhole.dbroot.SwoopParamsProto;return void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&(t.startDistInMeters=Number(e.startDistInMeters)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startDistInMeters=0),void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&e.hasOwnProperty("startDistInMeters")&&(r.startDistInMeters=e.startDistInMeters),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PostingServerProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.name=o[0].decode(e,e.uint32());break;case 2:a.baseUrl=o[1].decode(e,e.uint32());break;case 3:a.postWizardPath=o[2].decode(e,e.uint32());break;case 4:a.fileSubmitPath=o[3].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=o[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.baseUrl&&null!==e.baseUrl){var t=o[1].verify(e.baseUrl);if(t)return"baseUrl."+t}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){var t=o[2].verify(e.postWizardPath);if(t)return"postWizardPath."+t}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){var t=o[3].verify(e.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PostingServerProto)return e;var t=new n.keyhole.dbroot.PostingServerProto;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=o[0].fromObject(e.name)}if(void 0!==e.baseUrl&&null!==e.baseUrl){if("object"!=typeof e.baseUrl)throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=o[1].fromObject(e.baseUrl)}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){if("object"!=typeof e.postWizardPath)throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=o[2].fromObject(e.postWizardPath)}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){if("object"!=typeof e.fileSubmitPath)throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=o[3].fromObject(e.fileSubmitPath)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name=null,r.baseUrl=null,r.postWizardPath=null,r.fileSubmitPath=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[0].toObject(e.name,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=o[1].toObject(e.baseUrl,t)),void 0!==e.postWizardPath&&null!==e.postWizardPath&&e.hasOwnProperty("postWizardPath")&&(r.postWizardPath=o[2].toObject(e.postWizardPath,t)),void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath&&e.hasOwnProperty("fileSubmitPath")&&(r.fileSubmitPath=o[3].toObject(e.fileSubmitPath,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PlanetaryDatabaseProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=o[0].verify(e.url);if(t)return"url."+t;var t=o[1].verify(e.name);return t?"name."+t:null},r.fromObject=function(e){ if(e instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return e;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=o[1].fromObject(e.name)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.LogServerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.enable=e.bool();break;case 3:o.throttlingFactor=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}return void 0!==e.enable&&"boolean"!=typeof e.enable?"enable: boolean expected":void 0===e.throttlingFactor||r.isInteger(e.throttlingFactor)?null:"throttlingFactor: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LogServerProto)return e;var t=new n.keyhole.dbroot.LogServerProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=a[0].fromObject(e.url)}return void 0!==e.enable&&null!==e.enable&&(t.enable=Boolean(e.enable)),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&(t.throttlingFactor=0|e.throttlingFactor),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.enable=!1,r.throttlingFactor=1),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.enable&&null!==e.enable&&e.hasOwnProperty("enable")&&(r.enable=e.enable),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&e.hasOwnProperty("throttlingFactor")&&(r.throttlingFactor=e.throttlingFactor),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EndSnippetProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.model=a[0].decode(e,e.uint32());break;case 2:o.authServerUrl=a[1].decode(e,e.uint32());break;case 3:o.disableAuthentication=e.bool();break;case 4:o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(a[3].decode(e,e.uint32()));break;case 5:o.mfeLangParam=e.string();break;case 6:o.adsUrlPatterns=e.string();break;case 7:o.reverseGeocoderUrl=a[6].decode(e,e.uint32());break;case 8:o.reverseGeocoderProtocolVersion=e.int32();break;case 9:o.skyDatabaseIsAvailable=e.bool();break;case 10:o.skyDatabaseUrl=a[9].decode(e,e.uint32());break;case 11:o.defaultWebPageIntlUrl=a[10].decode(e,e.uint32());break;case 12:o.numStartUpTips=e.int32();break;case 13:o.startUpTipsUrl=a[12].decode(e,e.uint32());break;case 51:o.numProStartUpTips=e.int32();break;case 52:o.proStartUpTipsUrl=a[14].decode(e,e.uint32());break;case 64:o.startupTipsIntlUrl=a[15].decode(e,e.uint32());break;case 14:o.userGuideIntlUrl=a[16].decode(e,e.uint32());break;case 15:o.supportCenterIntlUrl=a[17].decode(e,e.uint32());break;case 16:o.businessListingIntlUrl=a[18].decode(e,e.uint32());break;case 17:o.supportAnswerIntlUrl=a[19].decode(e,e.uint32());break;case 18:o.supportTopicIntlUrl=a[20].decode(e,e.uint32());break;case 19:o.supportRequestIntlUrl=a[21].decode(e,e.uint32());break;case 20:o.earthIntlUrl=a[22].decode(e,e.uint32());break;case 21:o.addContentUrl=a[23].decode(e,e.uint32());break;case 22:o.sketchupNotInstalledUrl=a[24].decode(e,e.uint32());break;case 23:o.sketchupErrorUrl=a[25].decode(e,e.uint32());break;case 24:o.freeLicenseUrl=a[26].decode(e,e.uint32());break;case 25:o.proLicenseUrl=a[27].decode(e,e.uint32());break;case 48:o.tutorialUrl=a[28].decode(e,e.uint32());break;case 49:o.keyboardShortcutsUrl=a[29].decode(e,e.uint32());break;case 50:o.releaseNotesUrl=a[30].decode(e,e.uint32());break;case 26:o.hideUserData=e.bool();break;case 27:o.useGeLogo=e.bool();break;case 28:o.dioramaDescriptionUrlBase=a[33].decode(e,e.uint32());break;case 29:o.dioramaDefaultColor=e.uint32();break;case 53:o.dioramaBlacklistUrl=a[35].decode(e,e.uint32());break;case 30:o.clientOptions=a[36].decode(e,e.uint32());break;case 31:o.fetchingOptions=a[37].decode(e,e.uint32());break;case 32:o.timeMachineOptions=a[38].decode(e,e.uint32());break;case 33:o.csiOptions=a[39].decode(e,e.uint32());break;case 34:o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(a[40].decode(e,e.uint32()));break;case 35:o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(a[41].decode(e,e.uint32()));break;case 36:o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(a[42].decode(e,e.uint32()));break;case 37:o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(a[43].decode(e,e.uint32()));break;case 38:o.deauthServerUrl=a[44].decode(e,e.uint32());break;case 39:o.swoopParameters=a[45].decode(e,e.uint32());break;case 40:o.bbsServerInfo=a[46].decode(e,e.uint32());break;case 41:o.dataErrorServerInfo=a[47].decode(e,e.uint32());break;case 42:o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(a[48].decode(e,e.uint32()));break;case 43:o.logServer=a[49].decode(e,e.uint32());break;case 44:o.autopiaOptions=a[50].decode(e,e.uint32());break;case 54:o.searchConfig=a[51].decode(e,e.uint32());break;case 45:o.searchInfo=a[52].decode(e,e.uint32());break;case 46:o.elevationServiceBaseUrl=e.string();break;case 47:o.elevationProfileQueryDelay=e.int32();break;case 55:o.proUpgradeUrl=a[55].decode(e,e.uint32());break;case 56:o.earthCommunityUrl=a[56].decode(e,e.uint32());break;case 57:o.googleMapsUrl=a[57].decode(e,e.uint32());break;case 58:o.sharingUrl=a[58].decode(e,e.uint32());break;case 59:o.privacyPolicyUrl=a[59].decode(e,e.uint32());break;case 60:o.doGplusUserCheck=e.bool();break;case 61:o.rocktreeDataProto=a[61].decode(e,e.uint32());break;case 62:o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(a[62].decode(e,e.uint32()));break;case 63:o.showSigninButton=e.bool();break;case 65:o.proMeasureUpsellUrl=a[64].decode(e,e.uint32());break;case 66:o.proPrintUpsellUrl=a[65].decode(e,e.uint32());break;case 67:o.starDataProto=a[66].decode(e,e.uint32());break;case 68:o.feedbackUrl=a[67].decode(e,e.uint32());break;case 69:o.oauth2LoginUrl=a[68].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.model&&null!==e.model){var t=a[0].verify(e.model);if(t)return"model."+t}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){var t=a[1].verify(e.authServerUrl);if(t)return"authServerUrl."+t}if(void 0!==e.disableAuthentication&&"boolean"!=typeof e.disableAuthentication)return"disableAuthentication: boolean expected";if(void 0!==e.mfeDomains){if(!Array.isArray(e.mfeDomains))return"mfeDomains: array expected";for(var i=0;i>>0),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){if("object"!=typeof e.dioramaBlacklistUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=a[35].fromObject(e.dioramaBlacklistUrl)}if(void 0!==e.clientOptions&&null!==e.clientOptions){if("object"!=typeof e.clientOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=a[36].fromObject(e.clientOptions)}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){if("object"!=typeof e.fetchingOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=a[37].fromObject(e.fetchingOptions)}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){if("object"!=typeof e.timeMachineOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=a[38].fromObject(e.timeMachineOptions)}if(void 0!==e.csiOptions&&null!==e.csiOptions){if("object"!=typeof e.csiOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=a[39].fromObject(e.csiOptions)}if(e.searchTab){if(!Array.isArray(e.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var r=0;r>>3){case 1:o.searchServer&&o.searchServer.length||(o.searchServer=[]),o.searchServer.push(a[0].decode(e,e.uint32()));break;case 2:o.oneboxService&&o.oneboxService.length||(o.oneboxService=[]),o.oneboxService.push(a[1].decode(e,e.uint32()));break;case 3:o.kmlSearchUrl=a[2].decode(e,e.uint32());break;case 4:o.kmlRenderUrl=a[3].decode(e,e.uint32());break;case 6:o.searchHistoryUrl=a[4].decode(e,e.uint32());break;case 5:o.errorPageUrl=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.searchServer){if(!Array.isArray(e.searchServer))return"searchServer: array expected";for(var t=0;t>>3){case 1:o.name=a[0].decode(e,e.uint32());break;case 2:o.url=a[1].decode(e,e.uint32());break;case 3:o.type=e.uint32();break;case 4:o.htmlTransformUrl=a[3].decode(e,e.uint32());break;case 5:o.kmlTransformUrl=a[4].decode(e,e.uint32());break;case 6:o.supplementalUi=a[5].decode(e,e.uint32());break;case 9:o.suggestion&&o.suggestion.length||(o.suggestion=[]),o.suggestion.push(a[6].decode(e,e.uint32()));break;case 7:o.searchlet&&o.searchlet.length||(o.searchlet=[]),o.searchlet.push(a[7].decode(e,e.uint32()));break;case 8:o.requirements=a[8].decode(e,e.uint32());break;case 10:o.suggestServer=a[9].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=a[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.url&&null!==e.url){var t=a[1].verify(e.url);if(t)return"url."+t}if(void 0!==e.type)switch(e.type){default:return"type: enum value expected";case 0:case 1:}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){var t=a[3].verify(e.htmlTransformUrl);if(t)return"htmlTransformUrl."+t}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){var t=a[4].verify(e.kmlTransformUrl);if(t)return"kmlTransformUrl."+t}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){var t=a[5].verify(e.supplementalUi);if(t)return"supplementalUi."+t}if(void 0!==e.suggestion){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var r=0;r>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.label=a[1].decode(e,e.uint32());break;case 3:o.height=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.label&&null!==e.label){ var t=a[1].verify(e.label);if(t)return"label."+t}return void 0===e.height||r.isInteger(e.height)?null:"height: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");t.url=a[0].fromObject(e.url)}if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");t.label=a[1].fromObject(e.label)}return void 0!==e.height&&null!==e.height&&(t.height=0|e.height),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.label=null,r.height=160),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[1].toObject(e.label,t)),void 0!==e.height&&null!==e.height&&e.hasOwnProperty("height")&&(r.height=e.height),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.SearchletProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;case 3:a.requirements=o[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.name&&null!==e.name){var t=o[1].verify(e.name);if(t)return"name."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[2].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");t.name=o[1].fromObject(e.name)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");t.requirements=o[2].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[2].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.OneboxServiceProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.serviceUrl=o[0].decode(e,e.uint32());break;case 2:a.requirements=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.serviceUrl&&null!==e.serviceUrl){var t=o[0].verify(e.serviceUrl);if(t)return"serviceUrl."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[1].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(void 0!==e.serviceUrl&&null!==e.serviceUrl){if("object"!=typeof e.serviceUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");t.serviceUrl=o[0].fromObject(e.serviceUrl)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");t.requirements=o[1].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serviceUrl=null,r.requirements=null),void 0!==e.serviceUrl&&null!==e.serviceUrl&&e.hasOwnProperty("serviceUrl")&&(r.serviceUrl=o[0].toObject(e.serviceUrl,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[1].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.SearchInfoProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.defaultUrl=e.string();break;case 2:o.geocodeParam=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.defaultUrl||r.isString(e.defaultUrl)?void 0===e.geocodeParam||r.isString(e.geocodeParam)?null:"geocodeParam: string expected":"defaultUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return void 0!==e.defaultUrl&&null!==e.defaultUrl&&(t.defaultUrl=String(e.defaultUrl)),void 0!==e.geocodeParam&&null!==e.geocodeParam&&(t.geocodeParam=String(e.geocodeParam)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.defaultUrl="http://maps.google.com/maps",r.geocodeParam="q"),void 0!==e.defaultUrl&&null!==e.defaultUrl&&e.hasOwnProperty("defaultUrl")&&(r.defaultUrl=e.defaultUrl),void 0!==e.geocodeParam&&null!==e.geocodeParam&&e.hasOwnProperty("geocodeParam")&&(r.geocodeParam=e.geocodeParam),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.RockTreeDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.FilmstripConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.requirements=a[0].decode(e,e.uint32());break;case 2:o.alleycatUrlTemplate=a[1].decode(e,e.uint32());break;case 9:o.fallbackAlleycatUrlTemplate=a[2].decode(e,e.uint32());break;case 3:o.metadataUrlTemplate=a[3].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[4].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[5].decode(e,e.uint32());break;case 6:o.featuredToursUrl=a[6].decode(e,e.uint32());break;case 7:o.enableViewportFallback=e.bool();break;case 8:o.viewportFallbackDistance=e.uint32();break;case 10:o.imageryType&&o.imageryType.length||(o.imageryType=[]),o.imageryType.push(a[9].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[0].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){var t=a[1].verify(e.alleycatUrlTemplate);if(t)return"alleycatUrlTemplate."+t}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){var t=a[2].verify(e.fallbackAlleycatUrlTemplate);if(t)return"fallbackAlleycatUrlTemplate."+t}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[3].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[4].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[5].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){var t=a[6].verify(e.featuredToursUrl);if(t)return"featuredToursUrl."+t}if(void 0!==e.enableViewportFallback&&"boolean"!=typeof e.enableViewportFallback)return"enableViewportFallback: boolean expected";if(void 0!==e.viewportFallbackDistance&&!r.isInteger(e.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(void 0!==e.imageryType){if(!Array.isArray(e.imageryType))return"imageryType: array expected";for(var i=0;i>>0),e.imageryType){if(!Array.isArray(e.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");t.imageryType=[];for(var r=0;r>>3){case 1:o.imageryTypeId=e.int32();break;case 2:o.imageryTypeLabel=e.string();break;case 3:o.metadataUrlTemplate=a[2].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[3].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[4].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageryTypeId&&!r.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(void 0!==e.imageryTypeLabel&&!r.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[2].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[3].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[4].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&(t.imageryTypeId=0|e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&(t.imageryTypeLabel=String(e.imageryTypeLabel)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[2].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[3].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[4].fromObject(e.kmlUrlTemplate)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.imageryTypeId=0,r.imageryTypeLabel="",r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null),void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&e.hasOwnProperty("imageryTypeId")&&(r.imageryTypeId=e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&e.hasOwnProperty("imageryTypeLabel")&&(r.imageryTypeLabel=e.imageryTypeLabel),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[2].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[3].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[4].toObject(e.kmlUrlTemplate,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.StarDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.DbRootRefProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 2:o.url=e.string();break;case 1:o.isCritical=e.bool();break;case 3:o.requirements=a[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.url))return"url: string expected";if(void 0!==e.isCritical&&"boolean"!=typeof e.isCritical)return"isCritical: boolean expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[2].verify(e.requirements);if(t)return"requirements."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootRefProto)return e;var t=new n.keyhole.dbroot.DbRootRefProto;if(void 0!==e.url&&null!==e.url&&(t.url=String(e.url)),void 0!==e.isCritical&&null!==e.isCritical&&(t.isCritical=Boolean(e.isCritical)),void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=a[2].fromObject(e.requirements)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url="",r.isCritical=!1,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=e.url),void 0!==e.isCritical&&null!==e.isCritical&&e.hasOwnProperty("isCritical")&&(r.isCritical=e.isCritical),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[2].toObject(e.requirements,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.DatabaseVersionProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:o.quadtreeVersion=e.uint32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseVersionProto)return e;var t=new n.keyhole.dbroot.DatabaseVersionProto;return void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&(t.quadtreeVersion=e.quadtreeVersion>>>0),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.quadtreeVersion=0),void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&e.hasOwnProperty("quadtreeVersion")&&(r.quadtreeVersion=e.quadtreeVersion),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 15:o.databaseName=a[0].decode(e,e.uint32());break;case 1:o.imageryPresent=e.bool();break;case 14:o.protoImagery=e.bool();break;case 2:o.terrainPresent=e.bool();break;case 3:o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(a[4].decode(e,e.uint32()));break;case 4:o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(a[5].decode(e,e.uint32()));break;case 5:o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(a[6].decode(e,e.uint32()));break;case 6:o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(a[7].decode(e,e.uint32()));break;case 7:o.endSnippet=a[8].decode(e,e.uint32());break;case 8:o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(a[9].decode(e,e.uint32()));break;case 9:o.language=e.string();break;case 10:o.version=e.int32();break;case 11:o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(a[12].decode(e,e.uint32()));break;case 13:o.databaseVersion=a[13].decode(e,e.uint32());break;case 16:o.refreshTimeout=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}if(void 0!==e.imageryPresent&&"boolean"!=typeof e.imageryPresent)return"imageryPresent: boolean expected";if(void 0!==e.protoImagery&&"boolean"!=typeof e.protoImagery)return"protoImagery: boolean expected";if(void 0!==e.terrainPresent&&"boolean"!=typeof e.terrainPresent)return"terrainPresent: boolean expected";if(void 0!==e.providerInfo){if(!Array.isArray(e.providerInfo))return"providerInfo: array expected";for(var i=0;i>>3){case 1:o.encryptionType=e.uint32();break;case 2:o.encryptionData=e.bytes();break;case 3:o.dbrootData=e.bytes();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.encryptionType)switch(e.encryptionType){default:return"encryptionType: enum value expected";case 0:}return void 0===e.encryptionData||e.encryptionData&&"number"==typeof e.encryptionData.length||r.isString(e.encryptionData)?void 0===e.dbrootData||e.dbrootData&&"number"==typeof e.dbrootData.length||r.isString(e.dbrootData)?null:"dbrootData: buffer expected":"encryptionData: buffer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EncryptedDbRootProto)return e;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(e.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0}return void 0!==e.encryptionData&&null!==e.encryptionData&&("string"==typeof e.encryptionData?r.base64.decode(e.encryptionData,t.encryptionData=r.newBuffer(r.base64.length(e.encryptionData)),0):e.encryptionData.length&&(t.encryptionData=e.encryptionData)),void 0!==e.dbrootData&&null!==e.dbrootData&&("string"==typeof e.dbrootData?r.base64.decode(e.dbrootData,t.dbrootData=r.newBuffer(r.base64.length(e.dbrootData)),0):e.dbrootData.length&&(t.dbrootData=e.dbrootData)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,i.encryptionData=t.bytes===String?"":[],i.dbrootData=t.bytes===String?"":[]),void 0!==e.encryptionType&&null!==e.encryptionType&&e.hasOwnProperty("encryptionType")&&(i.encryptionType=t.enums===String?a[0][e.encryptionType]:e.encryptionType),void 0!==e.encryptionData&&null!==e.encryptionData&&e.hasOwnProperty("encryptionData")&&(i.encryptionData=t.bytes===String?r.base64.encode(e.encryptionData,0,e.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(e.encryptionData):e.encryptionData),void 0!==e.dbrootData&&null!==e.dbrootData&&e.hasOwnProperty("dbrootData")&&(i.dbrootData=t.bytes===String?r.base64.encode(e.dbrootData,0,e.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(e.dbrootData):e.dbrootData),i},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.EncryptionType=function(){var e={},t=Object.create(e);return t.ENCRYPTION_XOR=0,t}(),o}(),o}(),o}(),r.lazyResolve(n,i),n.keyhole.dbroot}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!=(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function r(e,t,r,i,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=r,this.terrainVersion=i,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var i=[1,2,4,8];return r.clone=function(t,i){return e(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new r(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i},r.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},r.prototype.hasSubtree=function(){return t(this._bits,16)},r.prototype.hasImagery=function(){return t(this._bits,64)},r.prototype.hasTerrain=function(){return t(this._bits,128)},r.prototype.hasChildren=function(){return t(this._bits,15)},r.prototype.hasChild=function(e){return t(this._bits,i[e])},r.prototype.getChildBitmask=function(){return 15&this._bits},r}),define("Core/GoogleEarthEnterpriseMetadata",["../ThirdParty/google-earth-dbroot-parser","../ThirdParty/when","./appendForwardSlash","./Check","./Credit","./defaultValue","./defined","./defineProperties","./GoogleEarthEnterpriseTileInformation","./isBitSet","./joinUrls","./loadArrayBuffer","./Math","./Request","./RequestType","./RuntimeError","./TaskProcessor"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=o(e,o.EMPTY_OBJECT),this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=h.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._url=r(e.url),this._proxy=e.proxy,this._tileInfo={},this._subtreePromises={};var i=this;this._readyPromise=b(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var r="An error occurred while accessing "+y(i,"",1)+".";return t.reject(new m(r))})}function _(e,r,i){var n=e._tileInfo,o=r,s=n[o];if(a(s)&&(!s.hasSubtree()||s.hasChildren()))return s;for(;void 0===s&&o.length>1;)o=o.substring(0,o.length-1),s=n[o];var l,u=e._subtreePromises,c=u[o];return a(c)?c.then(function(){return l=new p({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),_(e,r,l)}):a(s)&&s.hasSubtree()?(c=e.getQuadTreePacket(o,s.cnodeVersion,i),a(c)?(u[o]=c,c.then(function(){return l=new p({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),_(e,r,l)}).always(function(){delete u[o]})):void 0):t.reject(new m("Couldn't load metadata for tile "+r))}function y(e,t,r){return c(e._url,"flatfile?q2-0"+t+"-q."+r.toString())}function b(t){var r=c(t._url,"dbRoot.v5?output=proto"),i=t._proxy;return a(i)&&(r=i.getURL(r)),d(r).then(function(r){var i=e.EncryptedDbRootProto.decode(new Uint8Array(r)),n=i.encryptionData,o=n.byteOffset,a=o+n.byteLength,s=t.key=n.buffer.slice(o,a);n=i.dbrootData,o=n.byteOffset,a=o+n.byteLength;var l=n.buffer.slice(o,a);return w.scheduleTask({buffer:l,type:"DbRoot",key:s},[l])}).then(function(r){var i=e.DbRootProto.decode(new Uint8Array(r.buffer));if(t.imageryPresent=o(i.imageryPresent,t.imageryPresent),t.protoImagery=i.protoImagery,t.terrainPresent=o(i.terrainPresent,t.terrainPresent),a(i.endSnippet)&&a(i.endSnippet.model)){var s=i.endSnippet.model;t.negativeAltitudeExponentBias=o(s.negativeAltitudeExponentBias,t.negativeAltitudeExponentBias),t.negativeAltitudeThreshold=o(s.compressedNegativeAltitudeThreshold,t.negativeAltitudeThreshold)}a(i.databaseVersion)&&(t._quadPacketVersion=o(i.databaseVersion.quadtreeVersion,t._quadPacketVersion));for(var l=t.providers,u=o(i.providerInfo,[]),c=u.length,d=0;dmF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;ÁěðMª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');s(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},readyPromise:{get:function(){return this._readyPromise}}}),v.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<=0;--n){var o=1<1;){if(r=n.substring(n.length-1),n=n.substring(0,n.length-1),t=this.getTileInformationFromQuadKey(n),a(t)){t.hasSubtree()||t.hasChild(parseInt(r))||(i=!1);break}if(null===t){i=!1;break}}return i};var w=new g("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return v.prototype.getQuadTreePacket=function(e,t,r){t=o(t,1),e=o(e,"");var i=y(this,e,t),n=this._proxy;a(n)&&(i=n.getURL(i));var s=d(i,void 0,r);if(a(s)){var u=this._tileInfo,c=this.key;return s.then(function(t){return w.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:c},[t]).then(function(t){var r,i=-1;if(""!==e){i=e.length+1;var n=t[e];r=u[e],r._bits|=n._bits,delete t[e]}var o=Object.keys(t);o.sort(function(e,t){return e.length-t.length});for(var a=o.length,s=0;s1){var p=u[c.substring(0,c.length-1)];d.setParent(p)}u[c]=d}else u[c]=null}})})}},v.prototype.populateSubtree=function(e,t,r,i){return _(this,v.tileXYToQuadKey(e,t,r),i)},v.prototype.getTileInformation=function(e,t,r){var i=v.tileXYToQuadKey(e,t,r);return this._tileInfo[i]},v.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},v}),define("Core/GoogleEarthEnterpriseTerrainData",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=n(e,n.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=n(e.childTileMask,15),r=3&t;r|=4&t?8:0,r|=8&t?4:0,this._childTileMask=r,this._createdByUpsampling=n(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0,this._vertexCountWithoutSkirts=void 0,this._skirtIndex=void 0}function _(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function y(e,t,r,i){var n=e._buffer,o=0,a=0,s=0;r>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),d=0,h=0;h=-1e-15&&U.y>=-1e-15&&U.z>=-1e-15)return U.x*w[T]+U.y*w[E]+U.z*w[x]}}a(v.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var b=new f("createVerticesFromGoogleEarthEnterpriseBuffer"),C=new p,w=new p;v.prototype.createMesh=function(e,t,r,i,a){var s=e.ellipsoid;e.tileXYToNativeRectangle(t,r,i,C),e.tileXYToRectangle(t,r,i,w),a=n(a,1);var l=s.cartographicToCartesian(p.center(w)),u=40075.16/(1<0?r:1;var n=e.url+"flatfile?f1c-0"+t+"-t."+r.toString(),o=e._proxy;return i(o)&&(n=o.getURL(n)),n}var E={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},x=new d;C.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:d.now()}},C.prototype.get=function(e){var t=this._terrainCache,r=t[e];if(i(r))return delete this._terrainCache[e],r.buffer},C.prototype.tidy=function(){if(d.now(x),d.secondsDifference(x,this._lastTidy)>10){for(var e=this._terrainCache,t=Object.keys(e),r=t.length,i=0;i10&&delete e[n]}d.clone(x,this._lastTidy)}},n(w.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var P=new y("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return w.prototype.requestTileGeometry=function(t,r,n,o){var a=l.tileXYToQuadKey(t,r,n),s=this._terrainCache,d=this._metadata,p=d.getTileInformationFromQuadKey(a);if(!i(p))return e.reject(new _("Terrain tile doesn't exist"));var f=p.terrainState;i(f)||(f=p.terrainState=E.UNKNOWN);var m=s.get(a);if(i(m)){var v=d.providers[p.terrainProvider];return new u({buffer:m,childTileMask:S(a,p,d),credits:i(v)?[v]:void 0,negativeAltitudeExponentBias:d.negativeAltitudeExponentBias,negativeElevationThreshold:d.negativeAltitudeThreshold})}if(s.tidy(),!p.ancestorHasTerrain)return new c({buffer:new Uint8Array(256),width:16,height:16});if(f===E.NONE)return e.reject(new _("Terrain tile doesn't exist"));var y,b=a,C=-1;switch(f){case E.SELF:C=p.terrainVersion;break;case E.PARENT:b=b.substring(0,b.length-1),y=d.getTileInformationFromQuadKey(b),C=y.terrainVersion;break;case E.UNKNOWN:p.hasTerrain()?C=p.terrainVersion:(b=b.substring(0,b.length-1),y=d.getTileInformationFromQuadKey(b),i(y)&&y.hasTerrain()&&(C=y.terrainVersion))}if(C<0)return e.reject(new _("Terrain tile doesn't exist"));var w,x,A=this._terrainPromises,D=this._terrainRequests,I=T(this,b,C);if(i(A[b]))w=A[b],x=D[b];else{x=o;var O=h(I,void 0,x);if(!i(O))return;w=O.then(function(t){return i(t)?P.scheduleTask({buffer:t,type:"Terrain",key:d.key},[t]).then(function(e){var t=d.getTileInformationFromQuadKey(b);t.terrainState=E.SELF,s.add(b,e[0]);for(var r=t.terrainProvider,n=e.length-1,o=0;o0){for(l=0;l1){var A=o.isCompressedFormat(v)?o.compressedTextureSizeInBytes(v,y,b):o.textureSizeInBytes(v,y,b);P=new Uint8Array(P.buffer,P.byteOffset,A)}return new r(v,y,b,P)}var u=[171,75,84,88,32,49,49,187,13,10,26,10],c=67305985,d=4;return s}),define("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,r,i){return e({url:t,responseType:"document",headers:r,overrideMimeType:"text/xml",request:i})}return t}),define("Core/ManagedArray",["./Check","./defaultValue","./defineProperties"],function(e,t,r){"use strict";function i(e){e=t(e,0),this._array=new Array(e),this._length=e}return r(i.prototype,{length:{get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},values:{get:function(){return this._array}}}),i.prototype.get=function(e){return this._array[e]},i.prototype.set=function(e,t){e>=this.length&&(this.length=e+1),this._array[e]=t},i.prototype.push=function(e){var t=this.length++;this._array[t]=e},i.prototype.pop=function(){return this._array[--this.length]},i.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},i.prototype.resize=function(e){this.length=e},i.prototype.trim=function(e){e=t(e,this.length),this._array.length=e},i}),define("Core/MapboxApi",["./Credit","./defined"],function(e,t){"use strict";var r={};r.defaultAccessToken=void 0;var i,n=!1,o="This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.";return r.getAccessToken=function(e){return t(e)?e:t(r.defaultAccessToken)?r.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},r.getErrorCredit=function(n){if(!t(n)&&!t(r.defaultAccessToken))return t(i)||(i=new e(o)),i},r}),define("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError}}),r.prototype.project=t.throwInstantiationError,r.prototype.unproject=t.throwInstantiationError,r}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,r,i,n,o){"use strict";function a(e,t,i,n){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(t,0),this[3]=r(n,0)}a.packedLength=4,a.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},a.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},a.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3])},a.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.fromRotation=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new a(r,-n,n,r)},a.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,r){var i=2*t,n=e[i],o=e[i+1];return r.x=n,r.y=o,r},a.setColumn=function(e,t,r,i){i=a.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},a.getRow=function(e,t,r){var i=e[t],n=e[t+2];return r.x=i,r.y=n,r},a.setRow=function(e,t,r,i){return i=a.clone(e,i),i[t]=r.x,i[t+2]=r.y,i};var s=new e;a.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],s)),r.y=e.magnitude(e.fromElements(t[2],t[3],s)),r};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,r){var i=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return r[0]=i,r[1]=o,r[2]=n,r[3]=a,r},a.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r},a.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r},a.multiplyByVector=function(e,t,r){var i=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return r.x=i,r.y=n,r},a.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r},a.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.y,r[3]=e[3]*t.y,r},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.transpose=function(e,t){var r=e[0],i=e[2],n=e[1],o=e[3];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,t},a.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},a.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},a.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,n(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),define("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,n,s){var l,u,c=n-i+1,d=s-n,h=o,p=a;for(l=0;l=d||t(m,g,r)<=0)?(e[f]=m,++l):u=a)){var s=Math.floor(.5*(o+a));i(e,t,n,o,s),i(e,t,n,s+1,a),r(e,t,n,o,s,a)}}function n(e,t,r){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,i(e,t,r,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)}return i.clone=function(e,r){if(t(e))return t(r)?(r.near=e.near,r.nearValue=e.nearValue,r.far=e.far,r.farValue=e.farValue,r):new i(e.near,e.nearValue,e.far,e.farValue)},i.packedLength=4,i.pack=function(t,r,i){return i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue,r},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.near=r[n++],o.nearValue=r[n++],o.far=r[n++],o.farValue=r[n],o},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";return e({NONE:-1,PARTIAL:0,FULL:1})}),define("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=r}var d=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var r,i,n,o=t.subtract(this._occluderPosition,e,d),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){r=Math.sqrt(a-s),a=1/Math.sqrt(a),i=t.multiplyByScalar(o,a,d);var l=r*r*a;n=t.add(e,t.multiplyByScalar(i,l,d),d)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=i,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,r,n){return i(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=r,n):new c(e,r)};var h=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,h),i=this._occluderRadius;if((i=t.magnitudeSquared(r)-i*i)>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,p),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,h),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n));if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance)*o+l>a}return!0}return!1};var f=new t;c.prototype.computeVisibility=function(e){var r=t.clone(e.center),i=e.radius;if(i>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,f),o=this._occluderRadius-i,a=t.magnitudeSquared(n);if((o=a-o*o)>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+i*i0?(o=Math.sqrt(o)+this._horizonDistance,s-i?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,r,i){var n=t.clone(r),o=t.clone(e.center),a=e.radius,s=i.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[0]);if(h){for(var p,f=1;fn.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,r,i,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,a,a);if(t.magnitude(l)>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,b=new t,C=new t,w=new t;return c._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o,y),s=t.clone(e.center,b),l=e.radius,u=t.subtract(s,a,C),c=t.magnitudeSquared(u),d=l*l;if(c"+r,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas");p.width=o.width+100,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 m=p.width,g=p.height,v=g/2;f.fillStyle="white",f.fillRect(-1,-1,m+2,g+2),i&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(r,50,v)),n&&(f.fillStyle="black",f.fillText(r,50,v));for(var _=f.getImageData(0,0,m,g).data,y=0,b=4*m,C=_.length;++y0&&255===_[y];);var S=y/b|0;for(y=0;y=C&&(y=y-C+4);var T=y%b/4|0,E=1;for(y=C-3;y>=0&&255===_[y];)(y-=b)<0&&(y=C-3-4*E++);var x=y%b/4+1|0;o.ascent=v-w,o.descent=S-v,o.bounds={minx:T-50,maxx:x-50,miny:0,maxy:S-w},o.height=S-w+1}return o}}),define("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(n,o){if(""!==n){o=r(o,r.EMPTY_OBJECT);var s=r(o.font,"10px sans-serif"),l=r(o.stroke,!1),u=r(o.fill,!0),c=r(o.strokeWidth,1),d=r(o.backgroundColor,t.TRANSPARENT),h=r(o.padding,0),p=2*h,f=document.createElement("canvas");f.width=1,f.height=1,f.style.font=s;var m=f.getContext("2d");i(a)||(i(m.imageSmoothingEnabled)?a="imageSmoothingEnabled":i(m.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":i(m.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":i(m.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,m.textBaseline=r(o.textBaseline,"bottom"),f.style.visibility="hidden",document.body.appendChild(f);var g=e(m,n,l,u);f.dimensions=g,document.body.removeChild(f),f.style.visibility="";var v=-g.bounds.minx,_=Math.ceil(g.width)+v+p,y=g.height+p,b=y-g.ascent+p,C=y-b+p;if(f.width=_,f.height=y,m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,d!==t.TRANSPARENT&&(m.fillStyle=d.toCssColorString(),m.fillRect(0,0,f.width,f.height)),l){var w=r(o.strokeColor,t.BLACK);m.strokeStyle=w.toCssColorString(),m.strokeText(n,v+h,C)}if(u){var S=r(o.fillColor,t.WHITE);m.fillStyle=S.toCssColorString(),m.fillText(n,v+h,C)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,r,i,n,o){"use strict";function a(){this._cache={}}function s(e,t,r){e.save(),e.scale(r/24,r/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,r,i){var n=i/2.5,o=n,a=n;r.width>r.height?a=n*(r.height/r.width):r.width0&&i.y>0&&i.z>0}var i=new t;return r}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e,r,i,n){return t.subtract(r,e,_),t.multiplyByScalar(_,i/n,_),t.add(e,_,_),[_.x,_.y,_.z]}var v={};v.computeHierarchyPackedLength=function(e){for(var r=0,i=[e];i.length>0;){var o=i.pop();if(n(o)){r+=2;var a=o.positions,s=o.holes;if(n(a)&&(r+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(r[i++]=n(s)?s.length:0,r[i++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c0?new Array(n):void 0,s=0;s0?new Array(u):void 0;for(s=0;sC?(d=o.TWO_PI-w+C,n=Math.ceil(d/h)+1,a=Math.ceil(E/h)+1,u=d/(n-1),c=E/(a-1)):(d=C-w,n=Math.ceil(d/h)+1,a=Math.ceil(E/h)+1,u=d/(n-1),c=E/(a-1)),r=s.northwest(t,r);var x=s.center(t,m);0===_&&0===y||(x.longitude1||_>1))for(var C=0;C0;t-=d)q=3*t,Q=D(Q,J,q,b,E),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);for(t=d-1;t>=0;t--)q=3*t,Q=D(Q,J,q,b,E),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);var re=P(Q,n,p);n.st&&(re.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:K})),i&&(re.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:Z}));var ie,ne,oe,ae,se=g.createTypedArray(X,6*Y);C=Q.length/3;var le=0;for(t=0;t=0;t--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,v=d.createTypedArray(a.length/3,m),_=0,y=0;yO.mouseEmulationIgnoreMilliseconds}function _(e,r){if(v(e)){var n=r.button;e._buttonDown=n;var o;if(n===M.LEFT)o=u.LEFT_DOWN;else if(n===M.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==M.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,r,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(r),l=e.getInputAction(o,s);i(l)&&(t.clone(a,R.position),l(R),r.preventDefault())}}function y(e,r){if(v(e)){var n=r.button;e._buttonDown=void 0;var o,a;if(n===M.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===M.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==M.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=h(r),l=e.getInputAction(o,s),d=e.getInputAction(a,s);if(i(l)||i(d)){var p=c(e,r,e._primaryPosition);if(i(l)&&(t.clone(p,L.position),l(L)),i(d)){var f=e._primaryStartPosition,m=f.x-p.x,g=f.y-p.y;Math.sqrt(m*m+g*g)0?-120*t.detail:t.wheelDelta;if(i(r)){var o=h(t),a=e.getInputAction(u.WHEEL,o);i(a)&&(a(r),t.preventDefault())}}function S(e,r){g(e);var i,n,o,a=r.changedTouches,s=a.length,l=e._positions;for(i=0;iA;++i){a=o;o=a-(a-t*Math.sin(a)-e)/(1-t*Math.cos(a))}return a=o+r*n.TWO_PI}function f(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,i);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=r*n.TWO_PI}function m(e,r,i,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(r),u=Math.sin(r),c=Math.cos(i),d=Math.sin(i);return t(n)?(n[0]=c*a-d*s*l,n[1]=d*a+c*s*l,n[2]=s*u,n[3]=-c*s-d*a*l,n[4]=-d*s+c*a*l,n[5]=a*u,n[6]=d*u,n[7]=-c*u,n[8]=l):n=new o(c*a-d*s*l,-c*s-d*a*l,d*u,d*a+c*s*l,-d*s+c*a*l,-c*u,s*u,a*u,l),n}function g(e,t){u(e,xe);var r=xe.dayNumber-w.dayNumber+(xe.secondsOfDay-w.secondsOfDay)/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=D+V*Math.cos(M*n)+X*Math.sin(M*n)+z*Math.cos(R*n)+Q*Math.sin(R*n)+G*Math.cos(L*n)+Z*Math.sin(L*n)+H*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(k*n)+J*Math.sin(k*n)+j*Math.cos(F*n)+$*Math.sin(F*n)+q*Math.cos(B*n)+ee*Math.sin(B*n)+Y*Math.cos(U*n)+te*Math.sin(U*n),s=I+O*i+ce*Math.cos(re*n)+_e*Math.sin(re*n)+de*Math.cos(ie*n)+ye*Math.sin(ie*n)+he*Math.cos(ne*n)+be*Math.sin(ne*n)+pe*Math.cos(oe*n)+Ce*Math.sin(oe*n)+fe*Math.cos(ae*n)+we*Math.sin(ae*n)+me*Math.cos(se*n)+Se*Math.sin(se*n)+ge*Math.cos(le*n)+Te*Math.sin(le*n)+ve*Math.cos(ue*n)+Ee*Math.sin(ue*n);return c(o,.0167086342-.0004203654*i,469.97289*E*i,102.93734808*T+11612.3529*E*i,174.87317577*T-8679.27034*E*i,s,t)}function v(e,t){u(e,xe);var r=xe.dayNumber-w.dayNumber+(xe.secondsOfDay-w.secondsOfDay)/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,d=.055545526-1.6e-8*i,h=5.15668983*T,p=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*T,m=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,g=125.04455501*T,v=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*T,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,b=297.85019547*T+E*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),C=93.27209062*T+E*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),x=134.96340251*T+E*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*T+E*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),A=310.17137918*T-E*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),D=2*b,I=4*b,O=6*b,M=2*x,R=3*x,L=4*x,N=2*C;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-P)+181*Math.cos(D+x),d+=.014216*Math.cos(D-x)+.008551*Math.cos(D-M)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(I-R)-914e-6*Math.cos(I-M)+869e-6*Math.cos(D-P-x)-627e-6*Math.cos(D)-394e-6*Math.cos(I-L)+282e-6*Math.cos(D-P-M)-279e-6*Math.cos(b-x)-236e-6*Math.cos(M)+231e-6*Math.cos(I)+229e-6*Math.cos(O-L)-201e-6*Math.cos(M-N),p+=486.26*Math.cos(D-N)-40.13*Math.cos(D)+37.51*Math.cos(N)+25.73*Math.cos(M-N)+19.97*Math.cos(D-P-N),m+=-55609*Math.sin(D-x)-34711*Math.sin(D-M)-9792*Math.sin(x)+9385*Math.sin(I-R)+7505*Math.sin(I-M)+5318*Math.sin(D+x)+3484*Math.sin(I-L)-3417*Math.sin(D-P-x)-2530*Math.sin(O-L)-2376*Math.sin(D)-2075*Math.sin(D-R)-1883*Math.sin(M)-1736*Math.sin(O-5*x)+1626*Math.sin(P)-1370*Math.sin(O-R),v+=-5392*Math.sin(D-N)-540*Math.sin(P)-441*Math.sin(D)+423*Math.sin(N)-288*Math.sin(M-N),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(P)+396.3*Math.sin(x)-218*Math.sin(D-P);var k=2*A,F=3*A;p+=46.997*Math.cos(A)*i-.614*Math.cos(D-N+A)*i+.614*Math.cos(D-N-A)*i-.0297*Math.cos(k)*n-.0335*Math.cos(A)*n+.0012*Math.cos(D-N+k)*n-16e-5*Math.cos(A)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(k)*o;var B=2.116*Math.sin(A)*i-.111*Math.sin(D-N-A)*i-.0015*Math.sin(A)*n;return m+=B,y+=B,v+=-520.77*Math.sin(A)*i+13.66*Math.sin(D-N+A)*i+1.12*Math.sin(D-A)*i-1.06*Math.sin(N-A)*i+.66*Math.sin(k)*n+.371*Math.sin(A)*n-.035*Math.sin(D-N+k)*n-.015*Math.sin(D-N+A)*n+.0014*Math.sin(A)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(k)*o,l*=S,c(l,d,h+p*E,f+m*E,g+v*E,_+y*E,t)}function _(t,r){return r=v(t,r),e.multiplyByScalar(r,Pe,r)}var y={},b=32.184,C=2451545,w=new i(2451545,0,s.TAI),S=1e3,T=n.RADIANS_PER_DEGREE,E=n.RADIANS_PER_ARCSECOND,x=new o,P=50,A=n.EPSILON8,D=149598022260.7121,I=100.46645683*T,O=1295977422.83429*E,M=16002,R=21863,L=32004,N=10931,k=14529,F=16368,B=15318,U=32794,V=64e-7*14959787e4,z=-2273887.624,G=927506.794,H=14959787e4*-8e-7,W=32e-7*14959787e4,j=-613351.267,q=284235.953,Y=-164557.657,X=-2243968.05,Q=-688150.202,Z=1017265.516,K=807828.498,J=14e-7*14959787e4,$=359034.888,ee=14959787e4*-28e-7,te=329115.314,re=10,ie=16002,ne=21863,oe=10931,ae=1473,se=32004,le=4387,ue=73,ce=-325e-7,de=-322e-7,he=1e-7*-79,pe=232*1e-7,fe=1e-7*-52,me=97e-7,ge=55e-7,ve=-41e-7,_e=-105e-7,ye=-137e-7,be=258e-7,Ce=35e-7,we=1e-7*-116,Se=-88e-7,Te=-112e-7,Ee=-8e-6,xe=new i(0,0,s.TAI),Pe=-.01215058143522694,Ae=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),De=new e;return y.computeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=i.now()),t(n)||(n=new e),De=g(r,De),n=e.negate(De,n),_(r,De),e.subtract(n,De,n),o.multiplyByVector(Ae,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=i.now()),r=v(e,r),o.multiplyByVector(Ae,r,r),r},y}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t,i,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=i.red,d=i.green,h=i.blue,f=i.alpha,m=n.red,g=n.green,v=n.blue,_=n.alpha;if(r.equals(i,n)){for(l=0;l0?new Array(u):void 0;for(l=0;l0&&(t.pack(q,s,W),W+=3,C=S[a-1],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha)),D&&a===I-1)break;t.pack(q,s,W),W+=3,o(S)&&(C=S[a],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha))}}var Y=new c;Y.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(S)&&(Y.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),g=s.length/3;var X=2*(g-1),Q=d.createTypedArray(g,X),Z=0;for(a=0;a=1e3&&(o+=Math.floor(n/1e3),n%=1e3),o>=60&&(a+=Math.floor(o/60),o%=60),a>=60&&(l+=Math.floor(a/60),a%=60),l>=24&&(c+=Math.floor(l/24),l%=24),v[2]=s(h)?29:28;c>v[d]||d>=13;)c>v[d]&&(c-=v[d],++d),d>=13&&(--d,h+=Math.floor(d/12),d%=12,++d),v[2]=s(h)?29:28;return g.millisecond=n,g.second=o,g.minute=a,g.hour=l,g.day=c,g.month=d,g.year=h,u.fromGregorianDate(g,i)}function f(e,t){if(!r(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){var i=e.match(y);if(!r(i))return!1;if(r(i[1])&&(t.year=Number(i[1].replace(",","."))),r(i[2])&&(t.month=Number(i[2].replace(",","."))),r(i[3])&&(t.day=7*Number(i[3].replace(",","."))),r(i[4])&&(t.day+=Number(i[4].replace(",","."))),r(i[5])&&(t.hour=Number(i[5].replace(",","."))),r(i[6])&&(t.minute=Number(i[6].replace(",","."))),r(i[7])){var n=Number(i[7].replace(",","."));t.second=Math.floor(n),t.millisecond=n%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),u.toGregorianDate(u.fromIso8601(e,_),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}i(h.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),h.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof h))return!1;var r=this._intervals,i=e._intervals,n=r.length;if(n!==i.length)return!1;for(var o=0;o0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},h.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},h.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},h.prototype.contains=function(e){return this.indexOf(e)>=0};var m=new c;h.prototype.indexOf=function(t){var r=this._intervals;m.start=t,m.stop=t;var i=e(r,m,d);return i>=0?r[i].isStartIncluded?i:i>0&&r[i-1].stop.equals(t)&&r[i-1].isStopIncluded?i-1:~i:(i=~i,i>0&&i-10&&t.isStartIncluded&&a[o-1].isStartIncluded&&a[o-1].start.equals(t.start)?--o:o0&&((n=u.compare(a[o-1].stop,t.start))>0||0===n&&(a[o-1].isStopIncluded||t.isStartIncluded))&&((r(i)?i(a[o-1].data,t.data):a[o-1].data===t.data)?(t=new c(u.greaterThan(t.stop,a[o-1].stop)?{start:a[o-1].start,stop:t.stop,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:a[o-1].start,stop:a[o-1].stop,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:a[o-1].isStopIncluded||t.stop.equals(a[o-1].stop)&&t.isStopIncluded,data:t.data}),a.splice(o-1,1),--o):(n=u.compare(a[o-1].stop,t.stop),n>0||0===n&&a[o-1].isStopIncluded&&!t.isStopIncluded?a.splice(o-1,1,new c({start:a[o-1].start,stop:t.start,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:a[o-1].data}),new c({start:t.stop,stop:a[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:a[o-1].isStopIncluded,data:a[o-1].data})):a[o-1]=new c({start:a[o-1].start,stop:t.start,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:a[o-1].data})));o0||0===n&&(t.isStopIncluded||a[o].isStartIncluded));)if(r(i)?i(a[o].data,t.data):a[o].data===t.data)t=new c({start:t.start,stop:u.greaterThan(a[o].stop,t.stop)?a[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:u.greaterThan(a[o].stop,t.stop)?a[o].isStopIncluded:t.isStopIncluded,data:t.data}),a.splice(o,1);else{if(a[o]=new c({start:t.stop,stop:a[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:a[o].isStopIncluded,data:a[o].data}),!a[o].isEmpty)break;a.splice(o,1)}a.splice(o,0,t),this._changedEvent.raiseEvent(this)}},h.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var r=!1,i=this._intervals,n=e(i,t,d);n<0&&(n=~n);var o=t.start,a=t.stop,s=t.isStartIncluded,l=t.isStopIncluded;if(n>0){var h=i[n-1],p=h.stop;(u.greaterThan(p,o)||c.equals(p,o)&&h.isStopIncluded&&s)&&(r=!0,(u.greaterThan(p,a)||h.isStopIncluded&&!l&&c.equals(p,a))&&i.splice(n,0,new c({start:a,stop:p,isStartIncluded:!l,isStopIncluded:h.isStopIncluded,data:h.data})),i[n-1]=new c({start:h.start,stop:o,isStartIncluded:h.isStartIncluded,isStopIncluded:!s,data:h.data}))}var f=i[n];for(nh?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,i.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./Request","./RequestType","./TerrainProvider","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(e,t){this.rectangle=e,this.maxLevel=t}function b(i){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");m._tilingScheme=new l({ellipsoid:g});var r=e.getElementsByTagName("TileFormat")[0];m._heightmapWidth=parseInt(r.getAttribute("width"),10),m._heightmapHeight=parseInt(r.getAttribute("height"),10),m._levelZeroMaximumGeometricError=v.getEstimatedLevelZeroGeometricErrorForAHeightmap(g,Math.min(m._heightmapWidth,m._heightmapHeight),m._tilingScheme.getNumberOfXTilesAtLevel(0));for(var i=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=i.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=i.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var d,m=this,g=r(i.ellipsoid,a.WGS84);u()}function C(e,t,r,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,r,n),l=0,u=0;u=3){var v=r.fromPoints(s,e),_=v.projectPointsOntoPlane(s);n.computeWindingOrder2D(_)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,b,C=s.length,w=C-2,S=i.chordLength(d,e.maximumRadius),T=f;if(T.minDistance=S,T.ellipsoid=e,m){var E,x=0;for(E=0;E0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s=s&&(v=s-1);var _=g/h|0;return _>=l&&(_=l-1),r(n)?(n.x=v,n.y=_,n):new e(v,_)}},s}),define("Core/WeightSpline",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var r=e.weights,i=e.times;this._times=i,this._weights=r,this._count=r.length/i.length,this._lastTimeIndex=0}return i(a.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(e,t){var i=this.weights,n=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-n[o])/(n[o+1]-n[o]);r(t)||(t=new Array(this._count));for(var s=0;s-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new m(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT,MIN:t.MIN,MAX:t.MAX})}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,r){"use strict";return e({DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.ONE,functionSourceAlpha:r.ONE,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE,functionDestinationAlpha:r.ONE})})}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK})}),define("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this.material=e.material,this.translucent=r(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=r(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),i(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return i(this.material)&&this.material.isTranslucent()||!i(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=o.ALPHA_BLEND):r.depthMask=!0,r},s.getDefaultRenderState=function(e,r,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),r&&(s.cull={enabled:!0,face:a.BACK}),i(n)&&(s=t(n,s,!0)),s},s}),define("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),define("Renderer/CubeMapFace",["../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,r,i,n){"use strict";function o(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return r(o.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),o.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(this._targetFace,0,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},o.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),o=t(o,this._size),a=t(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,r,i,n,o,a),s.bindTexture(l,null)},o}),define("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===r.DONT_CARE||e===r.FASTEST||e===r.NICEST}};return e(r)}),define("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===r.NEAREST||e===r.LINEAR}};return e(r)}),define("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===r.NEAREST||e===r.LINEAR||e===r.NEAREST_MIPMAP_NEAREST||e===r.LINEAR_MIPMAP_NEAREST||e===r.NEAREST_MIPMAP_LINEAR||e===r.LINEAR_MIPMAP_LINEAR}};return e(r)}),define("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===r.CLAMP_TO_EDGE||e===r.REPEAT||e===r.MIRRORED_REPEAT}};return e(r)}),define("Renderer/Sampler",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=t(e.wrapS,s.CLAMP_TO_EDGE),n=t(e.wrapT,s.CLAMP_TO_EDGE),l=t(e.minificationFilter,a.LINEAR),u=t(e.magnificationFilter,o.LINEAR),c=r(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=i,this._wrapT=n,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(l.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}}}),l}),define("Renderer/CubeMap",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function i(e,t){t.arrayBufferView?_.texImage2D(e,0,p,c,c,0,p,f,t.arrayBufferView):_.texImage2D(e,0,p,p,f,t)}e=t(e,t.EMPTY_OBJECT);var n,o=e.context,a=e.source;if(r(a)){var l=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];n=l[0].width,l[0].height}else n=e.width,e.height;var c=n,p=t(e.pixelFormat,s.RGBA),f=t(e.pixelDatatype,d.UNSIGNED_BYTE),m=6*s.textureSizeInBytes(p,f,c,c),g=e.preMultiplyAlpha||p===s.RGB||p===s.LUMINANCE,v=t(e.flipY,!0),_=o._gl,y=_.TEXTURE_CUBE_MAP,b=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,b),r(a)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,v),i(_.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),i(_.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),i(_.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),i(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),i(_.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),i(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X,0,p,c,c,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X,0,p,c,c,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y,0,p,c,c,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,p,c,c,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z,0,p,c,c,0,p,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,p,c,c,0,p,f,null)),_.bindTexture(y,null),this._gl=_,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=p,this._pixelDatatype=f,this._size=c,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=g,this._flipY=v,this._sampler=void 0,this._positiveX=new u(_,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_X,p,f,c,g,v),this._negativeX=new u(_,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_X,p,f,c,g,v),this._positiveY=new u(_,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_Y,p,f,c,g,v),this._negativeY=new u(_,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,p,f,c,g,v),this._positiveZ=new u(_,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,p,f,c,g,v),this._negativeZ=new u(_,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z,p,f,c,g,v),this.sampler=r(e.sampler)?e.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 t=e.minificationFilter,i=e.magnificationFilter,n=t===f.NEAREST_MIPMAP_NEAREST||t===f.NEAREST_MIPMAP_LINEAR||t===f.LINEAR_MIPMAP_NEAREST||t===f.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===d.FLOAT&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,i=p.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,i),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE),this._hasMipmap=!0;var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=n(this._positiveX),this._negativeX=n(this._negativeX),this._positiveY=n(this._positiveY),this._negativeY=n(this._negativeY),this._positiveZ=n(this._positiveZ),this._negativeZ=n(this._negativeZ),n(this)},m}),define("Renderer/Texture",["../Core/Cartesian2","../Core/Check","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(t){t=i(t,i.EMPTY_OBJECT);var o=t.context,a=t.width,s=t.height,l=t.source;n(l)&&(n(a)||(a=i(l.videoWidth,l.width)),n(s)||(s=i(l.videoHeight,l.height)));var d=i(t.pixelFormat,u.RGBA),h=i(t.pixelDatatype,p.UNSIGNED_BYTE),m=d,g=u.isCompressedFormat(m) ;if(o.webgl2&&(d===u.DEPTH_STENCIL?m=c.DEPTH24_STENCIL8:d===u.DEPTH_COMPONENT&&(h===p.UNSIGNED_SHORT?m=c.DEPTH_COMPONENT16:h===p.UNSIGNED_INT&&(m=c.DEPTH_COMPONENT24)),h===p.FLOAT))switch(d){case u.RGBA:m=c.RGBA32F;break;case u.RGB:m=c.RGB32F;break;case u.RG:m=c.RG32F;break;case u.R:m=c.R32F}var v=t.preMultiplyAlpha||d===u.RGB||d===u.LUMINANCE,_=i(t.flipY,!0),y=o._gl,b=y.TEXTURE_2D,C=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(b,C),n(l)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,_),n(l.arrayBufferView)?g?y.compressedTexImage2D(b,0,m,a,s,0,l.arrayBufferView):y.texImage2D(b,0,m,a,s,0,d,h,l.arrayBufferView):n(l.framebuffer)?(l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._bind(),y.copyTexImage2D(b,0,m,l.xOffset,l.yOffset,a,s,0),l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._unBind()):y.texImage2D(b,0,m,d,h,l)):y.texImage2D(b,0,m,a,s,0,d,h,null),y.bindTexture(b,null);var w;w=g?u.compressedTextureSizeInBytes(d,a,s):u.textureSizeInBytes(d,h,a,s),this._id=r(),this._context=o,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=b,this._texture=C,this._pixelFormat=d,this._pixelDatatype=h,this._width=a,this._height=s,this._dimensions=new e(a,s),this._hasMipmap=!1,this._sizeInBytes=w,this._preMultiplyAlpha=v,this._flipY=_,this._sampler=void 0,this.sampler=n(t.sampler)?t.sampler:new f}return v.fromFramebuffer=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.context,r=t._gl,o=i(e.pixelFormat,u.RGB),a=i(e.framebufferXOffset,0),s=i(e.framebufferYOffset,0),l=i(e.width,r.drawingBufferWidth),c=i(e.height,r.drawingBufferHeight),d=e.framebuffer;return new v({context:t,width:l,height:c,pixelFormat:o,source:{framebuffer:n(d)?d:t.defaultFramebuffer,xOffset:a,yOffset:s,width:l,height:c}})},o(v.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,i=t===g.NEAREST_MIPMAP_NEAREST||t===g.NEAREST_MIPMAP_LINEAR||t===g.LINEAR_MIPMAP_NEAREST||t===g.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===p.FLOAT&&(t=i?g.NEAREST_MIPMAP_NEAREST:g.NEAREST,r=m.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),n(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),v.prototype.copyFrom=function(e,t,r){t=i(t,0),r=i(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,t,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,t,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},v.prototype.copyFromFramebuffer=function(e,t,r,n,o,a){e=i(e,0),t=i(t,0),r=i(r,0),n=i(n,0),o=i(o,this._width),a=i(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,t,r,n,o,a),s.bindTexture(l,null)},v.prototype.generateMipmap=function(e){e=i(e,h.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,r=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(r,this._texture),t.generateMipmap(r),t.bindTexture(r,null)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),a(this)},v}),define("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),define("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),define("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\nfloat base = 0.99;\n#endif\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineDashMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / dashLength);\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),define("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),define("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadCRN","../Core/loadImage","../Core/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineDashMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M){"use strict";function R(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,L(e,this),s(this,{type:{value:this.type,writable:!1}}),a(R._uniformList[this.type])||(R._uniformList[this.type]=Object.keys(this._uniforms))}function L(e,r){e=o(e,o.EMPTY_OBJECT),r._strict=o(e.strict,!1),r._count=o(e.count,0),r._template=t(o(e.fabric,o.EMPTY_OBJECT)),r._template.uniforms=t(o(r._template.uniforms,o.EMPTY_OBJECT)),r._template.materials=t(o(r._template.materials,o.EMPTY_OBJECT)),r.type=a(r._template.type)?r._template.type:n(),r.shaderSource="",r.materials={},r.uniforms={},r._uniforms={},r._translucentFunctions=[];var s,l=R._materialCache.getMaterial(r.type);if(a(l)){var u=t(l.fabric,!0);r._template=i(r._template,u,!0),s=l.translucent}B(r),a(l)||R._materialCache.addMaterial(r.type,r),U(r),G(r),j(r);var c=0===r._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var d=function(){return s(r)};r._translucentFunctions.push(d)}else r._translucentFunctions.push(s)}function N(e,t,r,i){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function k(e,t){}function F(e,t){}function B(e){var t=e._template,r=t.uniforms,i=t.materials,n=t.components;N(t,X,k,!0),N(n,Q,k,!0);var o=[];for(var a in i)i.hasOwnProperty(a)&&o.push(a);N(r,o,F,!1)}function U(e){var t=e._template.components,r=e._template.source;if(a(r))e.shaderSource+=r+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var i in t)t.hasOwnProperty(i)&&(e.shaderSource+="material."+i+" = "+t[i]+";\n");e.shaderSource+="return material;\n}\n"}}function V(e){var t;return function(r,i){var n=r.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=r._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===i.defaultTexture)return c=new _({context:i,source:o}),void(r._textures[e]=c);c.copyFrom(o)}else a(c)||(r._textures[e]=i.defaultTexture);else{if(o instanceof _&&o!==c){r._texturePaths[e]=void 0;var f=r._textures[e];return f!==r._defaultTexture&&f.destroy(),r._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}if(a(c)||(r._texturePaths[e]=void 0,a(r._defaultTexture)||(r._defaultTexture=i.defaultTexture),c=r._textures[e]=r._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==R.DefaultImageId&&o!==r._texturePaths[e]){if("string"==typeof o){var m;m=K.test(o)?p(o):J.test(o)?d(o):h(o),M(m,function(t){r._loadedImages.push({id:e,image:t})})}else o instanceof HTMLCanvasElement&&r._loadedImages.push({id:e,image:o});r._texturePaths[e]=o}}}}function z(e){return function(t,r){var i=t.uniforms[e];if(i instanceof v){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=i)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=r.defaultCubeMap),i!==R.DefaultCubeMapId){var o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){var s=[h(i.positiveX),h(i.negativeX),h(i.positiveY),h(i.negativeY),h(i.positiveZ),h(i.negativeZ)];M.all(s).then(function(r){t._loadedCubeMaps.push({id:e,images:r})}),t._texturePaths[e]=o}}}}function G(e){var t=e._template.uniforms;for(var r in t)t.hasOwnProperty(r)&&H(e,r)}function H(e,t){var r=(e._strict,e._template.uniforms),i=r[t],n=W(i);if("channels"===n)q(e,t,i,!1);else{if("sampler2D"===n){var o=t+"Dimensions";Y(e,o)>0&&(r[o]={type:"ivec3",x:1,y:1},H(e,o))}if(!new RegExp("uniform\\s+"+n+"\\s+"+t+"\\s*;").test(e.shaderSource)){var a="uniform "+n+" "+t+";";e.shaderSource=a+e.shaderSource}var s=t+"_"+e._count++;if(q(e,t,s),e.uniforms[t]=i,"sampler2D"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(z(t));else if(-1!==n.indexOf("mat")){var l=new Z[n];e._uniforms[s]=function(){return Z[n].fromColumnMajorArray(e.uniforms[t],l)}}else e._uniforms[s]=function(){return e.uniforms[t]}}}function W(e){var t=e.type;if(!a(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===R.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&i<=4?t="vec"+i:6===i&&(t="samplerCube")}}return t}function j(e){var t=e._strict,r=e._template.materials;for(var n in r)if(r.hasOwnProperty(n)){var o=new R({strict:t,fabric:r[n],count:e._count});e._count=o._count,e._uniforms=i(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial_"+e._count++;q(o,"czm_getMaterial",a),e.shaderSource=o.shaderSource+e.shaderSource;var s=a+"(materialInput)";q(e,n,s)}}function q(e,t,r,i){i=o(i,!0);var n=0,a="([\\w"+(i?".":"")+"])?",s=new RegExp(a+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(s,function(e,t,i){return t||i?e:(n+=1,r)}),n}function Y(e,t,r){return q(e,t,t,r)}R._uniformList={},R.fromType=function(e,t){var r=new R({fabric:{type:e}});if(a(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},R.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;i0&&console.log(C+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),r(d)&&d.length>0&&console.log(C+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),r(d)&&d.length>0&&console.log(C+"Shader program link log: "+d)),l}function m(e,t,r){for(var i={},n=0;n=0){if(f=i[d.slice(0,_)],!r(f))continue;m=f._locations,m.length<=1&&(g=f.value,null!==(v=e.getUniformLocation(t,d))&&(m.push(v),g.push(e.getUniform(t,v))))}else{m=[];for(var y=0;y=0;w--)c.splice(T,0,"#endif //"+E[w])}var P=!1;for(d=0;d=0}):i[f]=o.slice())}}return i}function u(e,t){var r="#extension\\s+GL_"+e+"\\s+:\\s+[a-zA-Z0-9]+\\s*$";n(new RegExp(r,"g"),"",t)}return r}),define("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),define("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),define("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),define("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),define("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),define("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),define("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),define("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),define("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),define("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),define("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),define("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),define("Shaders/Builtin/Constants/passCesium3DTile",[],function(){"use strict";return"const float czm_passCesium3DTile = 4.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassification",[],function(){"use strict";return"const float czm_passCesium3DTileClassification = 5.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow",[],function(){"use strict";return"const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n"}),define("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),define("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),define("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),define("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 7.0;\n"}),define("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 9.0;\n"}),define("Shaders/Builtin/Constants/passTerrainClassification",[],function(){"use strict";return"const float czm_passTerrainClassification = 3.0;\n"}),define("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 8.0;\n"}),define("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),define("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),define("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),define("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),define("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),define("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),define("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),define("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),define("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),define("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),define("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),define("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),define("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),define("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),define("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),define("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),define("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),define("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),define("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),define("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),define("Shaders/Builtin/Structs/shadowParameters",[],function(){"use strict";return"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n"}),define("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),define("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),define("Shaders/Builtin/Functions/cascadeColor",[],function(){"use strict";return"vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeDistance",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n"}),define("Shaders/Builtin/Functions/cascadeMatrix",[],function(){"use strict";return"uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeWeights",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n"}),define("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),define("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),define("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),define("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),define("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),define("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),define("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),define("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),define("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),define("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),define("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),define("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),define("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),define("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/HSBToRGB",[],function(){"use strict";return"const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n"}),define("Shaders/Builtin/Functions/HSLToRGB",[],function(){"use strict" ;return"vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n"}),define("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),define("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),define("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),define("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),define("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),define("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),define("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),define("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),define("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),define("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),define("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),define("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"});define("Shaders/Builtin/Functions/RGBToHSB",[],function(){"use strict";return"const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n"}),define("Shaders/Builtin/Functions/RGBToHSL",[],function(){"use strict";return"vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\n}\n"}),define("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),define("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),define("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),define("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),define("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),define("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n"}),define("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),define("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),define("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),define("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCesium3DTile","./Constants/passCesium3DTileClassification","./Constants/passCesium3DTileClassificationIgnoreShow","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTerrainClassification","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/HSBToRGB","./Functions/HSLToRGB","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToHSB","./Functions/RGBToHSL","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Te,Ee,xe,Pe,Ae,De,Ie,Oe,Me,Re,Le,Ne,ke,Fe,Be,Ue,Ve,ze,Ge){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:r,czm_epsilon2:i,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:d,czm_passCesium3DTile:h,czm_passCesium3DTileClassification:p,czm_passCesium3DTileClassificationIgnoreShow:f,czm_passCompute:m,czm_passEnvironment:g,czm_passGlobe:v,czm_passOpaque:_,czm_passOverlay:y,czm_passTerrainClassification:b,czm_passTranslucent:C,czm_pi:w,czm_piOverFour:S,czm_piOverSix:T,czm_piOverThree:E,czm_piOverTwo:x,czm_radiansPerDegree:P,czm_sceneMode2D:A,czm_sceneMode3D:D,czm_sceneModeColumbusView:I,czm_sceneModeMorphing:O,czm_solarRadius:M,czm_threePiOver2:R,czm_twoPi:L,czm_webMercatorMaxLatitude:N,czm_depthRangeStruct:k,czm_ellipsoid:F,czm_material:B,czm_materialInput:U,czm_ray:V,czm_raySegment:z,czm_shadowParameters:G,czm_alphaWeight:H,czm_antialias:W,czm_cascadeColor:j,czm_cascadeDistance:q,czm_cascadeMatrix:Y,czm_cascadeWeights:X,czm_columbusViewMorph:Q,czm_computePosition:Z,czm_cosineAndSine:K,czm_decompressTextureCoordinates:J,czm_eastNorthUpToEyeCoordinates:$,czm_ellipsoidContainsPoint:ee,czm_ellipsoidNew:te,czm_ellipsoidWgs84TextureCoordinates:re,czm_equalsEpsilon:ie,czm_eyeOffset:ne,czm_eyeToWindowCoordinates:oe,czm_fog:ae,czm_geodeticSurfaceNormal:se,czm_getDefaultMaterial:le,czm_getLambertDiffuse:ue,czm_getSpecular:ce,czm_getWaterNoise:de,czm_getWgs84EllipsoidEC:he,czm_HSBToRGB:pe,czm_HSLToRGB:fe,czm_hue:me,czm_isEmpty:ge,czm_isFull:ve,czm_latitudeToWebMercatorFraction:_e,czm_luminance:ye,czm_metersPerPixel:be,czm_modelToWindowCoordinates:Ce,czm_multiplyWithColorBalance:we,czm_nearFarScalar:Se,czm_octDecode:Te,czm_packDepth:Ee,czm_phong:xe,czm_pointAlongRay:Pe,czm_rayEllipsoidIntersectionInterval:Ae,czm_RGBToHSB:De,czm_RGBToHSL:Ie,czm_RGBToXYZ:Oe,czm_saturation:Me,czm_shadowDepthCompare:Re,czm_shadowVisibility:Le,czm_signNotZero:Ne,czm_tangentToEyeSpaceMatrix:ke,czm_translateRelativeToEye:Fe,czm_translucentPhong:Be,czm_transpose:Ue,czm_unpackDepth:Ve,czm_windowToEyeCoordinates:ze,czm_XYZToRGB:Ge}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Renderer/modernizeShader","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,r,i,n,o){"use strict";function a(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,r="",i=0;i0;){var i=e.pop();r.push(i),0===i.requiredBy.length&&t.push(i)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function d(e,r,n){var o,s,l="",u=e.sources;if(t(u))for(o=0,s=u.length;o0&&(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){}}e.push(c)}function m(e,t,r){for(var n=0;n0&&(d=!0),i(u[n].value)&&(h=!0);var _;o.vertexArrayObject&&(_=o.glCreateVertexArray(),o.glBindVertexArray(_),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=d,this._hasConstantAttributes=h,this._context=o,this._gl=a,this._vao=_,this._attributes=u,this._indexBuffer=l}function v(e){return e.values.length/e.componentsPerAttribute}function _(e){return t.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function y(e){var r,n,o,a=[];for(n in e)e.hasOwnProperty(n)&&i(e[n])&&i(e[n].values)&&(a.push(n),e[n].componentDatatype===t.DOUBLE&&(e[n].componentDatatype=t.FLOAT,e[n].values=t.createTypedArray(t.FLOAT,e[n].values)));var s,l=a.length;if(l>0)for(s=v(e[a[0]]),r=1;r0){var p=t.getSizeInBytes(e[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,g=new ArrayBuffer(m),y={};for(r=0;r0&&(t.glVertexAttribDivisor(i,0),n[i]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o=u.SIXTY_FOUR_KILOBYTES&&c.elementIndexUint?d.createIndexBuffer({context:c,typedArray:new Uint32Array(P),usage:f,indexDatatype:l.UNSIGNED_INT}):d.createIndexBuffer({context:c,typedArray:new Uint16Array(P),usage:f,indexDatatype:l.UNSIGNED_SHORT})),new g({context:c,attributes:b,indexBuffer:x})},n(g.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),g.prototype.getAttribute=function(e){return this._attributes[e]},g.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&b(this),this._hasConstantAttributes&&C(this,this._gl)):m(this._gl,this._attributes,this._indexBuffer)},g.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 i<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=i*e.x*k;return n+=i*e.y*F,(n+=i*e.z*B)*Math.pow(10,r)}function T(e,t,i){var n=r.unpack(e,t,L),o=S(n);n=r.unpack(e,t+4,L);var a=S(n);n=r.unpack(e,t+8,L);var s=S(n);n=r.unpack(e,t+12,L);var l=S(n);return r.fromElements(o,a,s,l,i)}function E(e,t){if(V[0]=e,0===(e=V[0]))return r.clone(r.ZERO,t);var i,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),i=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,i)):(e=.1,i=U);var o=e*N;return t.x=Math.floor(o),o=(o-t.x)*N,t.y=Math.floor(o),o=(o-t.y)*N,t.z=Math.floor(o),t.w=2*(i+U)+n,t}function x(e,t,i){var n=E(e.x,L);r.pack(n,t,i),n=E(e.y,n),r.pack(n,t,i+4),n=E(e.z,n),r.pack(n,t,i+8),n=E(e.w,n),r.pack(n,t,i+12)}function P(e,t){var r=e._textureDimensions;e._texture=new m({context:t,pixelFormat:d.RGBA,pixelDatatype:e._pixelDatatype,width:r.x,height:r.y,sampler:new f({minificationFilter:v.NEAREST,magnificationFilter:g.NEAREST})})}function A(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function I(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+U+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+k+"); \n unpacked += sign * value.y * float("+F+"); \n unpacked += sign * value.z * float("+B+"); \n return unpacked * pow(10.0, exponent); \n} \n":""}function O(e){return 1===e?"float":"vec"+e}function M(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function R(e,t){var r=e._attributes,i=r[t],o=i.componentsPerAttribute,a=i.functionName,s=O(o),l=M(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 e._packFloats&&i.componentDatatype!==p.UNSIGNED_BYTE?c+="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":c+=" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||i.componentDatatype!==n.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===p.FLOAT&&i.componentDatatype===n.UNSIGNED_BYTE&&i.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(_.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var L=new r,N=256,k=1/N,F=1/65536,B=1/16777216,U=38;if(u.supportsTypedArrays()){var V=new Float32Array(1),z=new r;_.prototype.getBatchedAttribute=function(e,t,i){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?T(this._batchValues,u,z):r.unpack(this._batchValues,u,z);var c=b(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,i):o(c.clone)?c.clone(n,i):n.x};var G=[void 0,void 0,new e,new t,new r],H=new r;return _.prototype.setBatchedAttribute=function(e,t,i){var n=this._attributes,a=G[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=b(this._attributes,t);if(!(o(l.equals)?l.equals(s,i):s===i)){var u=H;u.x=o(i.x)?i.x:i,u.y=o(i.y)?i.y:0,u.z=o(i.z)?i.z:0,u.w=o(i.w)?i.w:0;var c=this._offsets[t],d=this._stride,h=4*d*e+4*c;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(u,this._batchValues,h):r.pack(u,this._batchValues,h),this._batchValuesDirty=!0}},_.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||P(this,e.context),A(this))},_.prototype.getUniformMapCallback=function(){var e=this;return function(t){return 0===e._attributes.length?t:i(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}},_.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=I(this)+"\n";for(var r=e.length,i=0;i1){var s=e[0].modelMatrix;for(n=1;n=0){var u=n[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,d=0;da&&(o=0,a=i[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var r=[];return _(e,"geometry",t,r),_(e,"westHemisphereGeometry",t,r),_(e,"eastHemisphereGeometry",t,r),r}function b(e,t){var i=e.attributes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o)&&r(o.values)&&t.push(o.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function C(e,t){for(var r=e.length,i=0;i0&&(i=v(t),i.length>0&&(n=c.createAttributeLocations(i[0]),t.createPickOffsets&&(o=y(a,i))));for(var l=new Array(s),u=new Array(s),d=0;d0&&(n.set(c.indices,l),l+=b)}}return i.push(n.buffer),{stringTable:o,packedData:n}},P.unpackCreateGeometryResults=function(r){for(var i,n=r.stringTable,o=r.packedData,a=new Array(o[0]),c=0,h=1;h0){var P=_.length/y;for(x=d.createTypedArray(P,v),i=0;i1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(i){c+="vec2 st;\n";d+=" st = czm_decompressTextureCoordinates("+(a>1?l+".x":l)+");\n"}r&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",d+=" czm_octDecode("+l+"."+(i?"yz":"xy")+", normal, tangent, bitangent);\n"):(r&&(c+="vec3 normal;\n",d+=" normal = czm_octDecode("+l+(a>1?"."+(i?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",d+=" tangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",d+=" bitangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"));var h=t;return h=h.replace(/attribute\s+vec3\s+normal;/g,""),h=h.replace(/attribute\s+vec2\s+st;/g,""),h=h.replace(/attribute\s+vec3\s+tangent;/g,""),h=h.replace(/attribute\s+vec3\s+bitangent;/g,""),h=I.replaceMain(h,"czm_non_compressed_main"),[u,c,h,"void main() \n{ \n"+d+" czm_non_compressed_main(); \n}"].join("\n")}function X(e){var t=I.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n vec4 position = gl_Position;\n v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n position.z = min(position.z, position.w);\n gl_Position = position;}\n"}function Q(e){var t=I.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+t}function Z(e,t){e.vertexAttributes}function K(e,t){return function(){return e[t]}}function J(e,t){var r,i,n,o,a=e._instanceIds;if(e._state===F.READY){r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=r.length,l=[],d=[];for(n=0;n0){var v=new Float64Array(p);for(g=[v.buffer],o=0;o0?e._state=F.COMBINED:ce(e,t,F.FAILED,void 0)}).otherwise(function(r){ce(e,t,F.FAILED,r)})}}function $(e,t){var r,i,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(i=0;i0?e._state=F.COMBINED:ce(e,t,F.FAILED,void 0)}function ee(t,r){if(c(t._batchTableAttributeIndices.distanceDisplayCondition)&&!t._batchTableBoundingSpheresUpdated){for(var i=t._batchTableBoundingSphereAttributeIndices,n=i.center3DHigh,o=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,l=i.radius,u=r.mapProjection,d=u.ellipsoid,h=t._batchTable,p=t._instanceBoundingSpheres,m=p.length,g=0;g0){if(0===E.maximumVertexTextureImageUnits)throw new C("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==F.COMPLETE&&this._state!==F.COMBINED&&(this.asynchronous?J(this,e):$(this,e)),this._state===F.COMBINED&&(ee(this,e),te(this,e)),this.show&&this._state===F.COMPLETE){var r=this.appearance,i=r.material,n=!1,o=!1;this._appearance!==r?(this._appearance=r,this._material=i,n=!0,o=!0):this._material!==i&&(this._material=i,o=!0);var a=this.depthFailAppearance,s=c(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,n=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);var l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,n=!0),c(this._material)&&this._material.update(t);var d=r.closed&&l;if(n){u(this._createRenderStatesFunction,re)(this,t,r,d)}if(o){u(this._createShaderProgramFunction,ie)(this,e,r)}if(n||o){u(this._createCommandsFunction,oe)(this,r,i,l,d,this._colorCommands,this._pickCommands,e)}u(this._updateAndQueueCommandsFunction,ae)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)}}}},V.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,o=0;o-1;c--)i=n[c],u(e,C,p,i);for(r=g-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,C,p,i);var w=b.getById(i.id);t(w)||(w=y.getById(i.id),t(w)?s(w):(f.id=i.id,w=new o(f)),b.add(w)),w.merge(i)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var S=b.values;for(r=0;r=0;h--)p=n[h].getById(b),t(p)&&(t(m)||(m=c.getById(b),s(m)),m.merge(p));t(m)||c.removeById(b),m=void 0}var C=r.length;for(d=0;d=0;h--)p=n[h].getById(S),t(p)&&(t(m)||(m=c.getById(S),t(m)?s(m):(f.id=S,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,r,i,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[r],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[r];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&-1===u.propertyNames.indexOf(r)&&u.addProperty(r),u[r]=c},d}),define("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,i,n){function o(){i.raiseEvent(t)}var a=[];r.removeAll();for(var s=n.length,l=0;l1&&(i=F),this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._primitiveOptions={geometryInstances:void 0,appearance:n,vertexCacheOptimize:t(e.vertexCacheOptimize,!1),interleave:t(e.interleave,!1),releaseGeometryInstances:t(e.releaseGeometryInstances,!0),allowPicking:t(e.allowPicking,!0),asynchronous:t(e.asynchronous,!0),compressVertices:t(e.compressVertices,!0),_readOnlyInstanceAttributes:i,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function E(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:w.ALWAYS,frontOperation:{fail:S.KEEP,zFail:S.DECREMENT_WRAP,zPass:S.DECREMENT_WRAP},backFunction:w.ALWAYS,backOperation:{fail:S.KEEP,zFail:S.INCREMENT_WRAP,zPass:S.INCREMENT_WRAP},reference:U,mask:B},depthTest:{enabled:!1},depthMask:!1}}function x(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:w.ALWAYS,frontOperation:{fail:S.KEEP,zFail:S.KEEP,zPass:S.INCREMENT_WRAP},backFunction:w.ALWAYS,backOperation:{fail:S.KEEP,zFail:S.KEEP,zPass:S.DECREMENT_WRAP},reference:U,mask:B},depthTest:{enabled:!0,func:_.LESS_OR_EQUAL},depthMask:!1}}function P(e){return{stencilTest:{enabled:e,frontFunction:w.NOT_EQUAL,frontOperation:{fail:S.KEEP,zFail:S.KEEP,zPass:S.DECREMENT_WRAP},backFunction:w.NOT_EQUAL,backOperation:{fail:S.KEEP,zFail:S.KEEP,zPass:S.DECREMENT_WRAP},reference:U,mask:B},depthTest:{enabled:!1},depthMask:!1,blending:g.ALPHA_BLEND}}function A(e,t,i,n){if(!r(e._rsStencilPreloadPass)){var o=!e.debugShowShadowVolume;e._rsStencilPreloadPass=c.fromCache(E(o)),e._rsStencilDepthPass=c.fromCache(x(o)),e._rsColorPass=c.fromCache(P(o)),e._rsPickPass=c.fromCache(V)}}function D(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){var r=t;r=r.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),r=h.replaceMain(r,"czm_non_compressed_main");return["attribute vec2 compressedAttributes;","vec3 extrudeDirection;\n",r,"void main() \n{ \n extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);\n czm_non_compressed_main(); \n}"].join("\n")}}function I(e,t,i){if(!r(e._sp)){var n=t.context,o=e._primitive,a=f;a=e._primitive._batchTable.getVertexShaderCallback()(a),a=b._appendDistanceDisplayConditionToShader(o,a),a=b._modifyShaderPosition(e,a,t.scene3DOnly),a=b._updateColorAttribute(o,a),e._extruded&&(a=D(o,a));var s=e._extruded?"EXTRUDED_GEOMETRY":"",l=new h({defines:[s],sources:[a]}),u=new h({sources:[p]}),c=e._primitive._attributeLocations;if(e._spStencil=d.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c}),e._primitive.allowPicking){ var m=h.createPickVertexShaderSource(a);m=b._updatePickColorAttribute(m);var g=new h({defines:[s],sources:[m]}),v=new h({sources:[p],pickColorQualifier:"varying"});e._spPick=d.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:c})}else e._spPick=d.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c});a=b._appendShowToShader(o,a),l=new h({defines:[s],sources:[a]}),e._sp=d.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c})}}function O(e,t){var i=e._primitive,n=3*i._va.length;t.length=2*n;var o,a,s=0,c=i._batchTable.getUniformMapCallback()(e._uniformMap);for(o=0;os?s:t-1}}function x(e,t,r){var n=E(t),o=C._defaultMinTerrainHeight,s=C._defaultMaxTerrainHeight;if(a(n)){var l=n.level+"-"+n.x+"-"+n.y,u=C._terrainHeights[l];a(u)&&(o=u[0],s=u[1]),r.cartographicToCartesian(g.northeast(t,H),z),r.cartographicToCartesian(g.southwest(t,H),G),i.subtract(G,z,W),i.add(z,i.multiplyByScalar(W,.5,W),W);var c=r.scaleToGeodeticSurface(W,j);if(a(c)){var d=i.distance(W,c);o=Math.min(o,-d)}else o=C._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(C._defaultMinTerrainHeight,o),e._maxTerrainHeight=s}function P(t,r){var i=E(t),n=C._defaultMaxTerrainHeight;if(a(i)){var o=i.level+"-"+i.x+"-"+i.y,s=C._terrainHeights[o];a(s)&&(n=s[1])}var l=e.fromRectangle3D(t,r,0);return e.fromRectangle3D(t,r,n,q),e.union(l,q,l)}function A(t,r,n){var o=r.mapProjection.ellipsoid,a=T(r,n);if(a.width=E.clientWidth)A=!0;else{if(B.x>.5*E.clientWidth){x.width=B.x,P.frustum.right=O.x-k,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,_),x.x+=B.x,P.position.x=-P.position.x;var U=P.frustum.right;P.frustum.right=-P.frustum.left,P.frustum.left=-U,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,y)}else{x.x+=B.x,x.width-=B.x,P.frustum.left=-O.x-k,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,_),x.x=x.x-x.width,P.position.x=-P.position.x;var V=P.frustum.left;P.frustum.left=-P.frustum.right,P.frustum.right=-V,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,y)}r.clone(M,P.position),P.frustum=R.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=y.x)}}if(b.mode!==h.SCENE2D||A){if(g=p(C,n,P,g),g.z<0&&!(P.frustum instanceof u)&&!(P.frustum instanceof c))return;a=f.clipToGLWindowCoordinates(x,g,a)}return a.y=E.clientHeight-a.y,a}},f.wgs84ToDrawingBufferCoordinates=function(e,t,r){if(r=f.wgs84ToWindowCoordinates(e,t,r),o(r))return f.transformWindowToDrawingBuffer(e,r,r)};var E=new r,x=new n;f.computeActualWgs84Position=function(e,t,i){var n=e.mode;if(n===h.SCENE3D)return r.clone(t,i);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,x);if(o(l)){if(a.project(l,E),n===h.COLUMBUS_VIEW)return r.fromElements(E.z,E.x,E.y,i);if(n===h.SCENE2D)return r.fromElements(0,E.x,E.y,i);var u=e.morphTime;return r.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),i)}};var P=new r,A=new r,D=new l;f.clipToGLWindowCoordinates=function(e,i,n){return r.divideByScalar(i,i.w,P),l.computeViewportTransformation(e,0,1,D),l.multiplyByPoint(D,P,A),t.fromCartesian3(A,n)},f.transformWindowToDrawingBuffer=function(e,r,i){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(r.x*o,r.y*a,i)};var I=new i,O=new i;return f.drawingBufferToWgs84Coordinates=function(e,t,n,a){var s=e.context,u=s.uniformState,c=e._passState.viewport,d=i.clone(i.UNIT_W,I);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*n-1,d.w=1;var h,p=e.camera.frustum;if(o(p.fovy)){h=l.multiplyByVector(u.inverseViewProjection,d,O);var f=1/h.w;r.multiplyByScalar(h,f,h)}else{o(p._offCenterFrustum)&&(p=p._offCenterFrustum);var m=u.currentFrustum;h=O,h.x=.5*(d.x*(p.right-p.left)+p.left+p.right),h.y=.5*(d.y*(p.top-p.bottom)+p.bottom+p.top),h.z=.5*(d.z*(m.x-m.y)-m.x-m.y),h.w=1,h=l.multiplyByVector(u.inverseView,h,h)}return r.fromCartesian4(h,a)},f}),define("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(e,i){e=s(e,s.EMPTY_OBJECT);var n=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,c=e.scaleByDistance,h=e.distanceDisplayCondition;l(n)&&(n=p.clone(n)),l(u)&&(u=p.clone(u)),l(c)&&(c=p.clone(c)),l(h)&&(h=d.clone(h)),this._show=s(e.show,!0),this._position=r.clone(s(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=r.clone(s(e.eyeOffset,r.ZERO)),this._heightReference=s(e.heightReference,f.NONE),this._verticalOrigin=s(e.verticalOrigin,_.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=r.clone(s(e.alignedAxis,r.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=c,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=u,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=h,this._disableDepthTestDistance=s(e.disableDepthTestDistance,0),this._id=e.id,this._collection=s(e.collection,i),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=i,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var v=e.image,y=e.imageId;l(v)&&(l(y)||(y="string"==typeof v?v:l(v.src)?v.src:a()),this._imageId=y,this._image=v),l(e.imageSubRegion)&&(this._imageId=y,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=g.SCENE3D,this._clusterShow=!0,this._updateClamping()}function b(e,t){var r=e._billboardCollection;l(r)&&(r._updateBillboard(e,t),e._dirty=!0)}var C=y.SHOW_INDEX=0,w=y.POSITION_INDEX=1,S=y.PIXEL_OFFSET_INDEX=2,T=y.EYE_OFFSET_INDEX=3,E=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,P=y.SCALE_INDEX=6,A=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,I=y.ROTATION_INDEX=9,O=y.ALIGNED_AXIS_INDEX=10,M=y.SCALE_BY_DISTANCE_INDEX=11,R=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,L=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,N=y.DISTANCE_DISPLAY_CONDITION=14,k=y.DISABLE_DEPTH_DISTANCE=15;y.NUMBER_OF_PROPERTIES=16,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,b(this,C))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),this._updateClamping(),b(this,w))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),b(this,w))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;t.equals(r,e)||(t.clone(e,r),b(this,S))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance ;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),b(this,M))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),b(this,R))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),b(this,L))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;r.equals(t,e)||(r.clone(e,t),b(this,T))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,b(this,E))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,b(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,b(this,P))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),b(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,b(this,I))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;r.equals(t,e)||(r.clone(e,t),b(this,O))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,b(this,A))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,b(this,A))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,b(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),b(this,N))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,b(this,k))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,b(this,A))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=r.clone(e,this._actualClampedPosition),b(this,w)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,b(this,C))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var F=new n,B=new r;y._updateClamping=function(e,t){function i(e){if(t._heightReference===f.RELATIVE_TO_GROUND)if(t._mode===g.SCENE3D){var i=s.cartesianToCartographic(e,F);i.height+=h.height,s.cartographicToCartesian(i,e)}else e.x+=h.height;t._clampedPosition=r.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===f.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==f.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(!l(h))return void(t._actualClampedPosition=void 0);l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,i),n.clone(h,F);var p=a.getHeight(h);l(p)&&(F.height=p),s.cartographicToCartesian(F,B),i(B)}}},y.prototype._loadImage=function(){var t,r=this._billboardCollection._textureAtlas,i=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=r.addImage(i,n)),l(o)&&(t=r.addSubRegion(i,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===i&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=r.textureCoordinates[t];a._imageWidth=r.texture.width*s.width,a._imageHeight=r.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,b(a,A)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,r){this._imageId===t&&e.equals(this._imageSubRegion,r)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(r),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var r=this._translate;t.equals(r,e)||(t.clone(e,r),b(this,S))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||r.clone(e,this._actualPosition),b(this,w)};var U=new i;y._computeActualPosition=function(e,t,r,i){return l(e._clampedPosition)?(r.mode!==e._mode&&e._updateClamping(),e._clampedPosition):r.mode===g.SCENE3D?t:(h.multiplyByPoint(i,t,U),v.computeActualWgs84Position(r,U))};var V=new r;y._computeScreenSpacePosition=function(e,r,i,n,o,a){var s=h.multiplyByPoint(e,r,V),u=v.wgs84WithEyeOffsetToWindowCoordinates(o,s,i,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,r){var i=this._billboardCollection;l(r)||(r=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=i.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==g.SCENE3D)){var a=e.mapProjection,s=a.ellipsoid,u=a.unproject(o,F);o=s.cartographicToCartesian(u,V),n=h.IDENTITY}return y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,r)},y.getScreenSpaceBoundingBox=function(t,r,i){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=r.x;t.horizontalOrigin===m.RIGHT?s-=n:t.horizontalOrigin===m.CENTER&&(s-=.5*n);var u=r.y;return t.verticalOrigin===_.BOTTOM||t.verticalOrigin===_.BASELINE?u-=o:t.verticalOrigin===_.CENTER&&(u-=.5*o),l(i)||(i=new e),i.x=s,i.y=u,i.width=n,i.height=o,i},y.prototype.equals=function(i){return this===i||l(i)&&this._id===i._id&&r.equals(this._position,i._position)&&this._imageId===i._imageId&&this._show===i._show&&this._scale===i._scale&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._heightReference===i._heightReference&&e.equals(this._imageSubRegion,i._imageSubRegion)&&o.equals(this._color,i._color)&&t.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._translate,i._translate)&&r.equals(this._eyeOffset,i._eyeOffset)&&p.equals(this._scaleByDistance,i._scaleByDistance)&&p.equals(this._translucencyByDistance,i._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)&&d.equals(this._distanceDisplayCondition,i._distanceDisplayCondition)&&this._disableDepthTestDistance===i._disableDepthTestDistance},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),define("Renderer/VertexArrayFacade",["../Core/Check","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,n,o,a){function s(e,r){return t.getSizeInBytes(r.componentDatatype)-t.getSizeInBytes(e.componentDatatype)}var l=c._verifyAttributes(n);o=r(o,0);for(var u,d,h=[],p={},f=l.length,m=0;m0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function p(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n0?t.getSizeInBytes(e[0].componentDatatype):0,s=a>0?r%a:0;return r+=0===s?0:a-s},c._createArrayViews=function(e,r){for(var i=[],n=0,o=e.length,a=0;a0){var n=new ArrayBuffer(r*e.vertexSizeInBytes);if(i(e.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length,l=0;l= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos( sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y) );\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate /= czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";return e({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2})}),define("Renderer/Framebuffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._target,r._texture,0)}function u(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}function c(e){e=t(e,t.EMPTY_OBJECT);var i=e.context._gl;s.maximumColorAttachments;this._gl=i,this._framebuffer=i.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=t(e.destroyAttachments,!0);r(e.depthTexture)||r(e.depthRenderbuffer),r(e.depthStencilTexture)||r(e.depthStencilRenderbuffer);this._bind();var n,o,a,c,d;if(r(e.colorTextures)){var h=e.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=h.length,a=0;a0){for(var s=e._texture.width,l=e._texture.height,u=2*(s+r.width+a),c=2*(l+r.height+a),p=s/u,m=l/c,g=new f(new t(s+a,a),new t(u,l)),v=new f(new t,new t(u,l),e._root,g),_=new f(new t(a,l+a),new t(u,c)),y=new f(new t,new t(u,c),v,_),b=0;bl){r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var u=r.bottomLeft.x+i.width+e._borderWidthInPixels;u0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),e._instanced?(o=n._index,a(o,l,u,d)):(o=4*n._index,a(o+0,l,u,d),a(o+1,l,u,d),a(o+2,l,u,d),a(o+3,l,u,d))}function Q(e,t,r,i,n){z(e,t,r,i,n),G(e,t,r,i,n),H(e,t,r,i,n),W(e,t,r,i,n),j(e,t,r,i,n),q(e,t,r,i,n),Y(e,t,r,i,n),X(e,t,r,i,n)}function Z(e,r,i,n,o,a){var l;n.mode===O.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c0){this._vaf=V(n,i,this._buffersUsage,this._instanced),g=this._vaf.writers;for(var D=0;D0){var R=Le;R.length=0,(d[te]||d[ue]||d[ae])&&R.push(z),(d[se]||d[re]||d[ne]||d[oe]||d[ee])&&(R.push(G),this._instanced&&R.push(j)),(d[se]||d[ce]||d[he])&&(R.push(H),R.push(W)),(d[se]||d[le])&&R.push(W),d[ie]&&R.push(j),d[de]&&R.push(q),d[pe]&&R.push(Y),(d[fe]||d[me])&&R.push(X);var L=R.length;if(g=this._vaf.writers,c/i>.1){for(var N=0;N1.5*i&&(u.length=i),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,Te=f.IDENTITY;e.mode===O.SCENE3D?(Te=this.modelMatrix,Se=t.clone(this._baseVolumeWC,this._boundingVolume)):Se=t.clone(this._baseVolume2D,this._boundingVolume),J(this,e,Se);var Ee=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,Ee){this._blendOption===A.OPAQUE||this._blendOption===A.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=b.fromCache({depthTest:{enabled:!0,func:m.LESS},depthMask:!0}):this._rsOpaque=void 0;var xe=this._blendOption===A.TRANSLUCENT;this._blendOption===A.TRANSLUCENT||this._blendOption===A.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=b.fromCache({depthTest:{enabled:!0,func:xe?m.LEQUAL:m.LESS},depthMask:xe,blending:P.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;var Pe,Ae;(Ee||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(Pe=new w({sources:[E]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Pe.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===A.OPAQUE_AND_TRANSLUCENT&&(Ae=new w({defines:["OPAQUE"],sources:[T]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:Ae,attributeLocations:$}),Ae=new w({defines:["TRANSLUCENT"],sources:[T]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:Ae,attributeLocations:$})),this._blendOption===A.OPAQUE&&(Ae=new w({sources:[T]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:Ae,attributeLocations:$})),this._blendOption===A.TRANSLUCENT&&(Ae=new w({sources:[T]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:Ae,attributeLocations:$})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance),s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick&&this._shaderDisableDepthDistance===this._compiledShaderDisableDepthDistancePick||(Pe=new w({defines:["RENDER_FOR_PICK"],sources:[E]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Pe.defines.push("DISABLE_DEPTH_DISTANCE"),Ae=new w({defines:["RENDER_FOR_PICK"],sources:[T]}),this._spPick=C.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:Pe,fragmentShaderSource:Ae,attributeLocations:$}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var De,Ie,Oe,Me,Re=e.commandList;if(v.render){var Ne=this._colorCommands,ke=this._blendOption===A.OPAQUE,Fe=this._blendOption===A.OPAQUE_AND_TRANSLUCENT;De=this._vaf.va,Ie=De.length,Ne.length=Ie;var Be=Fe?2*Ie:Ie;for(Me=0;Me]/,n=[],o="",a=T.LTR,s="",l=e.length,u=0;u";case">":return"<"}}function S(e){for(var t=e.split("\n"),r="",i=0;iu+1?a[u+1].Type===T.RTL?(l=d+l,s=0):(l=C(l,s,c.Word),s+=c.Word.length):l=C(l,0,d)):c.Type===T.RTL?l=C(l,s,b(c.Word)):c.Type===T.LTR?(l+=c.Word,s=l.length):c.Type!==T.WEAK&&c.Type!==T.BRACKETS||(u>0&&a[u-1].Type===T.RTL?a.length>u+1?a[u+1].Type===T.RTL?l=C(l,s,d):(l+=c.Word,s=l.length):l+=c.Word:(l+=c.Word,s=l.length))}r+=l,i0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(i(h)||(h=p.add({collection:e,image:A,imageSubRegion:I}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance):i(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache;for(o=0;o0&&O.height>0&&C(e._textureAtlas,P,O,D)}if(r=l[o],i(r)?-1===D.index?b(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new g,l[o]=r),r.textureInfo=D,r.dimensions=D.dimensions,-1!==D.index){var M=r.billboard,R=e._spareBillboards;i(M)||(M=R.length>0?R.pop():e._billboardCollection.add({collection:e}),r.billboard=M),M.show=t._show,M.position=t._position,M.eyeOffset=t._eyeOffset,M.pixelOffset=t._pixelOffset,M.horizontalOrigin=d.LEFT,M.verticalOrigin=t._verticalOrigin,M.heightReference=t._heightReference,M.scale=t._scale,M.pickPrimitive=t,M.id=t._id,M.image=P,M.translucencyByDistance=t._translucencyByDistance,M.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,M.scaleByDistance=t._scaleByDistance,M.distanceDisplayCondition=t._distanceDisplayCondition,M.disableDepthTestDistance=t._disableDepthTestDistance}}t._repositionAllGlyphs=!0}function S(e,t,r){return t===d.CENTER?-e/2:t===d.RIGHT?-(e+r.x):r.x}function T(e,r){var n,o,a=e._glyphs,s=e._renderedText,l=0,u=0,c=[],h=Number.NEGATIVE_INFINITY,p=0,f=1,g=0,v=a.length,_=e._backgroundBillboard,y=R;for(t.clone(i(_)?e._backgroundPadding:t.ZERO,y),g=0;g0&&(A=w===d.CENTER?-u/2-y.x:w===d.RIGHT?-(u+2*y.x):0,M.x=A*C*r,T===m.TOP?M.y=b-p-h:T===m.CENTER?M.y=(b-p)/2-h:T===m.BASELINE?M.y=-y.y-h:M.y=0,M.y=M.y*C*r,_.width=u+2*y.x,_.height=b+I+2*y.y,_._setTranslate(M))}function E(e,t){for(var r=t._glyphs,n=0,a=r.length;n0?c.TRANSLUCENT:this.blendOption;t.blendOption=g,r.blendOption=g,this._labelsToUpdate.length=0,r.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),o(this)},x}),define("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT);var i=e.translucencyByDistance,s=e.scaleByDistance,l=e.distanceDisplayCondition;a(i)&&(i=d.clone(i)),a(s)&&(s=d.clone(s)),a(l)&&(l=u.clone(l)),this._show=o(e.show,!0),this._position=r.clone(o(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=s,this._translucencyByDistance=i,this._distanceDisplayCondition=l,this._disableDepthTestDistance=o(e.disableDepthTestDistance,0),this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function m(e,t){var r=e._pointPrimitiveCollection;a(r)&&(r._updatePointPrimitive(e,t),e._dirty=!0)}var g=f.SHOW_INDEX=0,v=f.POSITION_INDEX=1,_=f.COLOR_INDEX=2,y=f.OUTLINE_COLOR_INDEX=3,b=f.OUTLINE_WIDTH_INDEX=4,C=f.PIXEL_SIZE_INDEX=5,w=f.SCALE_BY_DISTANCE_INDEX=6,S=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,T=f.DISTANCE_DISPLAY_CONDITION_INDEX=8,E=f.DISABLE_DEPTH_DISTANCE_INDEX=9;f.NUMBER_OF_PROPERTIES=10,s(f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,g))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),m(this,v))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),m(this,w))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),m(this,S))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,C))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),m(this,_))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),m(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,b))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),m(this,T))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,m(this,E))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,m(this,g))}}}),f.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){r.clone(e,this._actualPosition),m(this,v)};var x=new i;f._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(r,e,x),p.computeActualWgs84Position(t,x))};var P=new i;return f._computeScreenSpacePosition=function(e,t,r,n){var o=c.multiplyByVector(e,i.fromElements(t.x,t.y,t.z,1,P),P);return p.wgs84ToWindowCoordinates(r,o,n)},f.prototype.computeScreenSpacePosition=function(e,r){var i=this._pointPrimitiveCollection;a(r)||(r=new t);var n=i.modelMatrix,o=f._computeScreenSpacePosition(n,this._actualPosition,e,r);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},f.getScreenSpaceBoundingBox=function(t,r,i){var n=t.pixelSize,o=.5*n,s=r.x-o,l=r.y-o,u=n,c=n;return a(i)||(i=new e),i.x=s,i.y=l,i.width=u,i.height=c,i},f.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&r.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&d.equals(this._scaleByDistance,e._scaleByDistance)&&d.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},f}),define("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),define("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x){"use strict";function P(t){t=i(t,i.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(Z),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(i(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=i(t.debugShowBoundingVolume,!1),this.blendOption=i(t.blendOption,T.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=x.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var r=this;this._uniforms={u_maxTotalPointSize:function(){return r._maxTotalPointSize}}}function A(e){for(var t=e.length,r=0;r0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),a(o,s,l,c)}function k(e,t,r,i){O(e,t,r,i),M(e,t,r,i),R(e,t,r,i),L(e,t,r,i),N(e,t,r,i)}function F(t,r,i,o,a,s){var l;o.mode===x.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c0){this._vaf=I(p,o,this._buffersUsage),r=this._vaf.writers;for(var A=0;A0){var J=te;J.length=0,(l[z]||l[W]||l[j])&&J.push(O),(l[G]||l[H])&&J.push(M),(l[V]||l[Y])&&J.push(R),l[q]&&J.push(L),(l[X]||l[Q])&&J.push(N);var $=J.length;if(r=this._vaf.writers,s/o>.1){for(var ee=0;ee1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var se,le=c.IDENTITY;t.mode===x.SCENE3D?(le=this.modelMatrix,se=e.clone(this._baseVolumeWC,this._boundingVolume)):se=e.clone(this._baseVolume2D,this._boundingVolume),U(this,t,se);var ue=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,ue&&(this._blendOption===T.OPAQUE||this._blendOption===T.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=v.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===T.TRANSLUCENT||this._blendOption===T.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=v.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:S.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==t.minimumDisableDepthTestDistance;var ce,de;(ue||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(ce=new y({sources:[w]}),this._shaderScaleByDistance&&ce.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&ce.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&ce.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&ce.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===T.OPAQUE_AND_TRANSLUCENT&&(de=new y({defines:["OPAQUE"],sources:[C]}),this._sp=_.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K}),de=new y({defines:["TRANSLUCENT"],sources:[C]}),this._spTranslucent=_.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._blendOption===T.OPAQUE&&(de=new y({sources:[C]}),this._sp=_.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._blendOption===T.TRANSLUCENT&&(de=new y({sources:[C]}),this._spTranslucent=_.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistancePick)&&(ce=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._shaderScaleByDistance&&ce.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&ce.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&ce.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&ce.defines.push("DISABLE_DEPTH_DISTANCE"),de=new y({defines:["RENDER_FOR_PICK"],sources:[C]}),this._spPick=_.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition, this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var he,pe,fe,me,ge=t.commandList;if(b.render){var ve=this._colorCommands,_e=this._blendOption===T.OPAQUE,ye=this._blendOption===T.OPAQUE_AND_TRANSLUCENT;he=this._vaf.va,pe=he.length,ve.length=pe;var be=ye?2*pe:pe;for(me=0;me=r&&s<=n&&l>=i&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[m]);var g=(d+1)%2;(0===d?r<=s:i<=l)&&(u.push(p),u.push(m-1),u.push(g)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}function o(e,t,r,i,n,s){if(!(n-i<=r)){var l=Math.floor((i+n)/2);a(e,t,l,i,n,s%2),o(e,t,r,i,l-1,s+1),o(e,t,r,l+1,n,s+1)}}function a(e,t,r,i,n,o){for(;n>i;){if(n-i>600){var l=n-i+1,u=r-i+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1);a(e,t,r,Math.max(i,Math.floor(r-u*d/l+h)),Math.min(n,Math.floor(r+(l-u)*d/l+h)),o)}var p=t[2*r+o],f=i,m=n;for(s(e,t,i,r),t[2*n+o]>p&&s(e,t,i,n);fp;)m--}t[2*i+o]===p?s(e,t,i,m):(m++,s(e,t,m,n)),m<=r&&(i=m+1),r<=m&&(n=m-1)}}function s(e,t,r,i){l(e,r,i),l(t,2*r,2*i),l(t,2*r+1,2*i+1)}function l(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function u(e,t,r,i,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),d=a.pop(),h=a.pop();if(d-h<=o)for(var p=h;p<=d;p++)c(t[2*p],t[2*p+1],r,i)<=l&&s.push(e[p]);else{var f=Math.floor((h+d)/2),m=t[2*f],g=t[2*f+1];c(m,g,r,i)<=l&&s.push(e[f]);var v=(u+1)%2;(0===u?r-n<=m:i-n<=g)&&(a.push(h),a.push(f-1),a.push(v)),(0===u?r+n>=m:i+n>=g)&&(a.push(f+1),a.push(d),a.push(v))}}return s}function c(e,t,r,i){var n=e-r,o=t-i;return n*n+o*o}return t.prototype={range:function(e,t,r,i){return n(this.ids,this.coords,e,t,r,i,this.nodeSize)},within:function(e,t,r){return u(this.ids,this.coords,e,t,r,this.nodeSize)}},e}),define("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../Scene/SceneMode","../ThirdParty/kdbush"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=i(e,i.EMPTY_OBJECT),this._enabled=i(e.enabled,!1),this._pixelRange=i(e.pixelRange,80),this._minimumClusterSize=i(e.minimumClusterSize,2),this._clusterBillboards=i(e.clusterBillboards,!0),this._clusterLabels=i(e.clusterLabels,!0),this._clusterPoints=i(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function _(e){return e.coord.x}function y(e){return e.coord.y}function b(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,r,i,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=d.getScreenSpaceBoundingBox(t,r,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,r,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,r,a)),b(a,i),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&T(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,r,O);b(c,i),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&T(t,e.id)&&n(e.id._label)){var r=t._collectionIndicesByEntity[e.id];t._labelCollection.get(r).clusterShow=!0}}function S(e,t,r,i){var n={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.label.id=r,n.billboard.position=n.label.position=n.point.position=e,i._clusterEvent.raiseEvent(r,n)}function T(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function E(e,t,r,i,o){if(n(e))for(var a=e.length,s=0;s=P)for(S(J.position,X,Y,i),D.push(J),V=0;V=P){var pe=r.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,i),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),V=0;V0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[i]=l,this._clusterDirty=!0,u}}function A(e,t){var r=e._collectionIndicesByEntity[t];n(r.billboardIndex)||n(r.labelIndex)||n(r.pointIndex)||delete e._collectionIndicesByEntity[t]}function D(e){if(n(e))for(var t=e.length,r=0;r0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),n(this._billboardCollection)&&this._billboardCollection.length>0&&!n(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,I(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},v.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},v}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new i,this._error=new i,this._isLoading=!1,this._loading=new i,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),define("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(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 E(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(E.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(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 T(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),O=new b(e.BLACK),M=new b(_.DISABLED),R=new b(new u),L=new e;return a(E,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),a(E.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),E.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},E.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},E.prototype.createFillGeometryInstance=function(i){var n,a,s=this._entity,l=s.isAvailable(i),u=new f(l&&s.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var g=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(g=this._materialProperty.color.getValue(i)),a=t.fromColor(g),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:new r(this._options),modelMatrix:s.computeModelMatrix(p.MINIMUM_VALUE),attributes:n})},E.prototype.createOutlineGeometryInstance=function(r){var n=this._entity,o=n.isAvailable(r),a=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(r);return new h({id:n,geometry:new i(this._options),modelMatrix:n.computeModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){this._entitySubscription(),s(this)},E.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.length,f=a.topRadius,v=a.bottomRadius,_=a.show;if(o(_)&&_.isConstant&&!_.getValue(p.MINIMUM_VALUE)||!o(d)||!o(h)||!o(f)||!o(v))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var b=n(a.material,P),C=b instanceof y;this._materialProperty=b,this._fillProperty=n(s,D),this._showProperty=n(_,A),this._showOutlineProperty=n(a.outline,I),this._outlineColorProperty=c?n(a.outlineColor,O):void 0,this._shadowsProperty=n(a.shadows,M),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,R);var w=a.slices,T=a.outlineWidth,E=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&S.isConstant(e.orientation)&&h.isConstant&&f.isConstant&&v.isConstant&&S.isConstant(w)&&S.isConstant(T)&&S.isConstant(E)){var x=this._options;x.vertexFormat=C?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,x.length=h.getValue(p.MINIMUM_VALUE),x.topRadius=f.getValue(p.MINIMUM_VALUE),x.bottomRadius=v.getValue(p.MINIMUM_VALUE),x.slices=o(w)?w.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(E)?E.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(T)?T.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},E.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&S.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l.computeModelMatrix(n),f=S.getValueOrUndefined(u.length,n),_=S.getValueOrUndefined(u.topRadius,n),y=S.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(f)&&o(_)&&o(y)){d.length=f,d.topRadius=_,d.bottomRadius=y,d.slices=S.getValueOrUndefined(u.slices,n),d.numberOfVerticalLines=S.getValueOrUndefined(u.numberOfVerticalLines,n);var b=this._geometryUpdater.shadowsProperty.getValue(n),C=this._geometryUpdater.distanceDisplayConditionProperty,T=C.getValue(n),E=c.fromDistanceDisplayCondition(T);if(S.getValueOrDefault(u.fill,n,!0)){var x=w.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var P=new m({material:x,translucent:x.isTranslucent(),closed:!0});d.vertexFormat=P.vertexFormat,this._primitive=a.add(new v({geometryInstances:new h({id:l,geometry:new r(d),modelMatrix:p,attributes:{distanceDisplayCondition:E}}),appearance:P,asynchronous:!1,shadows:b}))}if(S.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=g.VERTEX_FORMAT;var A=S.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,L),D=S.getValueOrDefault(u.outlineWidth,n,1),I=1!==A.alpha;this._outlinePrimitive=a.add(new v({geometryInstances:new h({id:l,geometry:new i(d),modelMatrix:p,attributes:{color:t.fromColor(A),distanceDisplayCondition:E}}),appearance:new g({flat:!0,translucent:I,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:b}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},E}),define("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var r={HIGHLIGHT:0,REPLACE:1,MIX:2};return r.getColorBlend=function(e,i){return e===r.HIGHLIGHT?0:e===r.REPLACE?1:e===r.MIX?t.clamp(i,t.EPSILON4,1):void 0},e(r)}),define("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return i(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return r(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(i){return r(i)||(i=new e),i.startTime=t(this.startTime,i.startTime),i.stopTime=t(this.stopTime,i.stopTime),i.currentTime=t(this.currentTime,i.currentTime),i.clockRange=t(this.clockRange,i.clockRange),i.multiplier=t(this.multiplier,i.multiplier),i.clockStep=t(this.clockStep,i.clockStep),i},l}),define("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=new e(8,8),d=new e(0,0),h=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,.1),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,c,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,h,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}),define("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/PolylineDashMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}var l=e.WHITE,u=e.TRANSPARENT;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._gapColor)&&a.isConstant(this._dashLength)&&a.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),gapColor:o("gapColor"),dashLength:o("dashLength"),dashPattern:o("dashPattern")}),s.prototype.getType=function(e){return"PolylineDash"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.gapColor=a.getValueOrClonedDefault(this._gapColor,e,u,t.gapColor),t.dashLength=a.getValueOrDefault(this._dashLength,e,16,t.dashLength),t.dashPattern=a.getValueOrDefault(this._dashPattern,e,255,t.dashPattern),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._gapColor,e._gapColor)&&a.equals(this._dashLength,e._dashLength)&&a.equals(this._dashPattern,e._dashPattern)},s}),define("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,.25,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),define("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0, this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,1),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),define("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)}return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;i=t;i--)e[i]=e[s--]}for(i=0;i=0||r(v)&&s.compare(g,v)>=0));){for(f[y++]=g,_+=1,l=0;l0&&(m.length=b,u(n,p,m),f.length=y,u(i,h,f))}else{for(l=0;ll)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,i)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,i)}var f=this._xTable,m=this._yTable,g=this._interpolationAlgorithm,v=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(g.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*v)}var b=this._numberOfPoints-1;if(b<1)return;var C=0,w=o-1;if(w-C+1>=b+1){var S=d-(b/2|0)-1;Sw&&(T=w,(S=T-b)0){n=new Array(i);for(var s=0;sh&&e!==Object);var _="function"==typeof e.unpack&&e!==Te;if(!p&&!v)return void(t[r]=g?new K(_?e.unpack(f,0):f):ke(e,a,i));var y,C=t[r],S=i.epoch;if(c(S)&&(y=w.fromIso8601(S)),p&&!v)return C instanceof xe||(C=new xe(e),t[r]=C),C.addSamplesPackedArray(f,y),void Ke(i,C);var T;if(!p&&v)return l=l.clone(),l.data=g?_?e.unpack(f,0):f:ke(e,a,i),c(C)||(C=g?new Ie:new Q,t[r]=C), void(g&&C instanceof Ie?C.intervals.addInterval(l):C instanceof Q?(g&&(l.data=new K(l.data)),C.intervals.addInterval(l)):(T=b.MAXIMUM_INTERVAL.clone(),T.data=C,C=new Q,t[r]=C,C.intervals.addInterval(T),g&&(l.data=new K(l.data)),C.intervals.addInterval(l)));c(C)||(C=new Q,t[r]=C),C instanceof Q||(T=b.MAXIMUM_INTERVAL.clone(),T.data=C,C=new Q,t[r]=C,C.intervals.addInterval(T));var E=C.intervals;T=E.findInterval(l),c(T)&&T.data instanceof xe||(T=l.clone(),T.data=new xe(e),E.addInterval(T)),T.data.addSamplesPackedArray(f,y),Ke(i,T.data)}function $e(e,t,r,i,n,o,a,s){if(c(i))if(y(i))for(var l=0,u=i.length;lv),!m&&!y)return void(e[t]=_?new Z(r.unpack(p),h):Ne(a,i.reference));var C,S=e[t],T=i.epoch;if(c(T)&&(C=w.fromIso8601(T)),m&&!y)return S instanceof Ee&&(!c(h)||S.referenceFrame===h)||(S=new Ee(h,g),e[t]=S),S.addSamplesPackedArray(p,C),void Ke(i,S);var E;if(!m&&y)return l=l.clone(),l.data=_?r.unpack(p):Ne(a,i.reference),c(S)||(S=_?new De(h):new X(h),e[t]=S),void(_&&S instanceof De&&c(h)&&S.referenceFrame===h?S.intervals.addInterval(l):S instanceof X?(_&&(l.data=new Z(l.data,h)),S.intervals.addInterval(l)):(E=b.MAXIMUM_INTERVAL.clone(),E.data=S,S=new X(S.referenceFrame),e[t]=S,S.intervals.addInterval(E),_&&(l.data=new Z(l.data,h)),S.intervals.addInterval(l)));c(S)?S instanceof X||(E=b.MAXIMUM_INTERVAL.clone(),E.data=S,S=new X(S.referenceFrame),e[t]=S,S.intervals.addInterval(E)):(S=new X(h),e[t]=S);var x=S.intervals;E=x.findInterval(l),c(E)&&E.data instanceof Ee&&(!c(h)||E.data.referenceFrame===h)||(E=l.clone(),E.data=new Ee(h,g),x.addInterval(E)),E.data.addSamplesPackedArray(p,C),Ke(i,E.data)}function tt(e,t,r,i,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s. 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 Ct(e,t,r,i,n){var o=t.ellipse;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.ellipse;c(u)||(e.ellipse=u=new re),$e(Boolean,u,"show",o.show,s,i,r,n),$e(Number,u,"semiMajorAxis",o.semiMajorAxis,s,i,r,n),$e(Number,u,"semiMinorAxis",o.semiMinorAxis,s,i,r,n),$e(Number,u,"height",o.height,s,i,r,n),$e(Number,u,"extrudedHeight",o.extrudedHeight,s,i,r,n),$e(Te,u,"rotation",o.rotation,s,i,r,n),$e(Te,u,"stRotation",o.stRotation,s,i,r,n),$e(Number,u,"granularity",o.granularity,s,i,r,n),$e(Boolean,u,"fill",o.fill,s,i,r,n),it(u,"material",o.material,s,i,r,n),$e(Boolean,u,"outline",o.outline,s,i,r,n),$e(a,u,"outlineColor",o.outlineColor,s,i,r,n),$e(Number,u,"outlineWidth",o.outlineWidth,s,i,r,n),$e(Number,u,"numberOfVerticalLines",o.numberOfVerticalLines,s,i,r,n),$e(V,u,"shadows",o.shadows,s,i,r,n)}}function wt(e,t,i,n,o){var s=t.ellipsoid;if(c(s)){var l,u=s.interval;c(u)&&(jt.iso8601=u,l=L.fromIso8601(jt));var d=e.ellipsoid;c(d)||(e.ellipsoid=d=new ie),$e(Boolean,d,"show",s.show,l,n,i,o),$e(r,d,"radii",s.radii,l,n,i,o),$e(Boolean,d,"fill",s.fill,l,n,i,o),it(d,"material",s.material,l,n,i,o),$e(Boolean,d,"outline",s.outline,l,n,i,o),$e(a,d,"outlineColor",s.outlineColor,l,n,i,o),$e(Number,d,"outlineWidth",s.outlineWidth,l,n,i,o),$e(Number,d,"stackPartitions",s.stackPartitions,l,n,i,o),$e(Number,d,"slicePartitions",s.slicePartitions,l,n,i,o),$e(Number,d,"subdivisions",s.subdivisions,l,n,i,o),$e(V,d,"shadows",s.shadows,l,n,i,o)}}function St(e,i,n,o,s){var l=i.label;if(c(l)){var u,d=l.interval;c(d)&&(jt.iso8601=d,u=L.fromIso8601(jt));var h=e.label;c(h)||(e.label=h=new le),$e(Boolean,h,"show",l.show,u,o,n,s),$e(String,h,"text",l.text,u,o,n,s),$e(String,h,"font",l.font,u,o,n,s),$e(U,h,"style",l.style,u,o,n,s),$e(Number,h,"scale",l.scale,u,o,n,s),$e(Boolean,h,"showBackground",l.showBackground,u,o,n,s),$e(a,h,"backgroundColor",l.backgroundColor,u,o,n,s),$e(t,h,"backgroundPadding",l.backgroundPadding,u,o,n,s),$e(t,h,"pixelOffset",l.pixelOffset,u,o,n,s),$e(r,h,"eyeOffset",l.eyeOffset,u,o,n,s),$e(B,h,"horizontalOrigin",l.horizontalOrigin,u,o,n,s),$e(z,h,"verticalOrigin",l.verticalOrigin,u,o,n,s),$e(F,h,"heightReference",l.heightReference,u,o,n,s),$e(a,h,"fillColor",l.fillColor,u,o,n,s),$e(a,h,"outlineColor",l.outlineColor,u,o,n,s),$e(Number,h,"outlineWidth",l.outlineWidth,u,o,n,s),$e(P,h,"translucencyByDistance",l.translucencyByDistance,u,o,n,s),$e(P,h,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,o,n,s)}}function Tt(e,t,r,i,n){var o=t.model;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.model;c(u)||(e.model=u=new ue),$e(Boolean,u,"show",o.show,s,i,r,n),$e(G,u,"uri",o.gltf,s,i,r,n),$e(Number,u,"scale",o.scale,s,i,r,n),$e(Number,u,"minimumPixelSize",o.minimumPixelSize,s,i,r,n),$e(Number,u,"maximumScale",o.maximumScale,s,i,r,n),$e(Boolean,u,"incrementallyLoadTextures",o.incrementallyLoadTextures,s,i,r,n),$e(Boolean,u,"runAnimations",o.runAnimations,s,i,r,n),$e(V,u,"shadows",o.shadows,s,i,r,n),$e(F,u,"heightReference",o.heightReference,s,i,r,n),$e(a,u,"silhouetteColor",o.silhouetteColor,s,i,r,n),$e(Number,u,"silhouetteSize",o.silhouetteSize,s,i,r,n),$e(a,u,"color",o.color,s,i,r,n),$e(k,u,"colorBlendMode",o.colorBlendMode,s,i,r,n),$e(Number,u,"colorBlendAmount",o.colorBlendAmount,s,i,r,n);var d=o.nodeTransformations;if(c(d))if(y(d))for(var h=0,p=d.length;h-1;d--)r[d](s,e,t,i,o)}Bt=void 0}function Rt(e){var t,r=e._documentPacket.clock;if(!c(r)){if(!c(e._clock)){var i=e._entityCollection.computeAvailability();if(!i.start.equals(b.MINIMUM_VALUE)){var a=i.start,s=i.stop,l=w.secondsDifference(s,a),d=Math.round(l/120);return t=new te,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=d,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new te,t.startTime=b.MINIMUM_VALUE.clone(),t.stopTime=b.MAXIMUM_VALUE.clone(),t.currentTime=b.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(r.interval)){jt.iso8601=r.interval;var h=L.fromIso8601(jt);t.startTime=h.start,t.stopTime=h.stop}return c(r.currentTime)&&(t.currentTime=w.fromIso8601(r.currentTime)),c(r.range)&&(t.clockRange=u(n[r.range],n.LOOP_STOP)),c(r.step)&&(t.clockStep=u(o[r.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(r.multiplier)&&(t.multiplier=r.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function Lt(e,t,r,i){r=u(r,u.EMPTY_OBJECT);var n=t,o=r.sourceUri,a=c(r.query)?A(r.query):void 0;return"string"==typeof t&&(c(a)&&(t=C(t,"?"+a,!1)),n=E(t),o=u(o,t)),ee.setLoading(e,!0),H(n,function(t){return Nt(e,t,o,i,a)}).otherwise(function(t){return ee.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),H.reject(t)})}function Nt(e,t,r,i,n){ee.setLoading(e,!0);var o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new kt,o.removeAll()),Ft._processCzml(t,o,r,void 0,e,n);var a=Rt(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,a=!0):!c(e._name)&&c(r)&&(e._name=v(r),a=!0),ee.setLoading(e,!1),a&&e._changed.raiseEvent(e),e}function kt(){this.name=void 0,this.clock=void 0}function Ft(e){this._name=e,this._changed=new f,this._error=new f,this._isLoading=!1,this._loading=new f,this._clock=void 0,this._documentPacket=new kt,this._version=void 0,this._entityCollection=new oe(this),this._entityCluster=new ne}Le.packedLength=r.packedLength,Le.unpack=r.unpack,Le.pack=r.pack;var Bt,Ut=new r,Vt=new R,zt=new i,Gt=new L,Ht=new D,Wt={HERMITE:_,LAGRANGE:S,LINEAR:T},jt={iso8601:void 0};return Ft.load=function(e,t){return(new Ft).load(e,t)},d(Ft.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}}}),Ft.updaters=[gt,vt,_t,yt,Ct,wt,St,Tt,nt,ot,xt,Pt,At,Dt,ut,It,at,st,Ot,lt,ft],Ft.prototype.process=function(e,t){return Lt(this,e,t,!1)},Ft.prototype.load=function(e,t){return Lt(this,e,t,!0)},Ft.processPacketData=$e,Ft.processPositionPacketData=tt,Ft.processMaterialPacketData=it,Ft._processCzml=function(e,t,r,i,n,o){if(i=c(i)?i:Ft.updaters,y(e))for(var a=0,s=e.length;a=0;i--){var n=e[i];if(n.remove(t)&&0===n.updaters.length)return e.splice(i,1),n.destroy(),!0}return!1}function m(e,t,r){for(var i=!1,n=t.length,o=0;o0)for(o=0;o=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u0){for(i(m)&&(i(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),h=0;h<_;h++){var C=v[h],w=C.attributes;l=this.attributes.get(C.id.id),i(l)&&(i(w.show)&&(w.show.value=l.show),i(w.color)&&(w.color.value=l.color),i(w.depthFailColor)&&(w.depthFailColor.value=l.depthFailColor))}var S;i(this.depthFailAppearanceType)&&(i(this.depthFailMaterialProperty)&&(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),S=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),m=new s({asynchronous:!0,geometryInstances:v,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:S,shadows:this.shadows}),g.add(m),p=!1}else{i(m)&&(g.remove(m),m=void 0);var T=this.oldPrimitive;i(T)&&(g.remove(T),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(m)&&m.ready){i(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0),!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var E=this.updatersWithAttributes.values,x=E.length,P=this.waitingOnCreate;for(h=0;h0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),h=0;h=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},p.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s0){for(r(m)&&(r(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),u=0;u<_;u++){var y=v[u],b=y.attributes;s=this.attributes.get(y.id.id),r(s)&&(r(b.show)&&(b.show.value=s.show),r(b.color)&&(b.color.value=s.color))}m=new a({asynchronous:!0,geometryInstances:v}),g.add(m),c=!1}else{r(m)&&(g.remove(m),m=void 0);var C=this.oldPrimitive;r(C)&&(g.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(m)&&m.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var w=this.updatersWithAttributes.values,S=w.length,T=this.waitingOnCreate;for(u=0;u0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),d=0;d0)for(d=!0,t=0;t0)for(d=!0,t=0;t-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),n.entity===r?(p(this,n),f(this,e,n)):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaters.get(i),p(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene),this._updaters.set(i,n),f(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,g=h.length;for(t=0;t-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),define("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){this.entity=e,this.label=void 0,this.index=void 0}function v(t,r){r.collectionChanged.addEventListener(v.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function _(e,t,r){o(e)&&(e.label=void 0,r.removeLabel(t))}var y=h.FILL,b=i.WHITE,C=i.BLACK,w=new i(.165,.165,.165,.8),S=new t(7,5),T=t.ZERO,E=r.ZERO,x=c.NONE,P=d.CENTER,A=p.CENTER,D=new r,I=new i,O=new i,M=new i,R=new t,L=new r,N=new t,k=new u,F=new u,B=new u,U=new l;return v.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new g(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new g(a)):(_(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],_(s.get(a.id),a,l),s.remove(a.id)},v}),define("ThirdParty/GltfPipeline/addToArray",[],function(){"use strict";function e(e,t){return e.push(t),e.length-1}return e}),define("ThirdParty/GltfPipeline/ForEach",["../../Core/defined"],function(e){"use strict";var t={};return t.object=function(t,r){if(e(t))for(var i=0;i0){var l=o[0];if("object"==typeof l)for(var u=s.length,c=0;c0){var a=e.accessors,s=e.bufferViews;t.mesh(e,function(e){if(t.meshPrimitive(e,function(e){var l=e.indices;if(n(l)){var u=a[l],c=u.bufferView;if(r[c]){var d=s[c];n(d)&&(d.target=o.ELEMENT_ARRAY_BUFFER,r[c]=!1,i--)}}t.meshPrimitiveAttribute(e,function(e){var t=a[e],l=t.bufferView;if(r[l]){var u=s[l];n(u)&&(u.target=o.ARRAY_BUFFER,r[l]=!1,i--)}}),t.meshPrimitiveTargetAttribute(e,function(e){var t=a[e].bufferView;if(r[t]){var l=s[t];n(l)&&(l.target=o.ARRAY_BUFFER,r[t]=!1,i--)}})}),0===i)return!0})}}function p(e,t){return t=i(t,{}),a(e,f),s(e),l(e),u(e),c(e),h(e),t.optimizeForCesium&&d(e),e}var f={accessors:[],animations:[{channels:[],samplers:[{interpolation:"LINEAR"}]}],asset:{},buffers:[{byteLength:0,type:"arraybuffer"}],bufferViews:[{byteLength:0}],cameras:[],images:[],materials:[{values:function(e){var t=i(e.extensions,{}),r=t.KHR_materials_common;if(!n(r))return{}},extensions:function(e){var t=i(e.extensions,{}),r=t.KHR_materials_common;if(n(r)){var o=r.technique,a={ambient:[0,0,0,1],emission:[0,0,0,1],transparency:1};return"CONSTANT"!==o&&(a.diffuse=[0,0,0,1],"LAMBERT"!==o&&(a.specular=[0,0,0,1],a.shininess=0)),{KHR_materials_common:{doubleSided:!1,transparent:!1,values:a}}}}}],meshes:[{primitives:[{attributes:{},mode:o.TRIANGLES}]}],nodes:[{children:[],matrix:function(e){if(!n(e.translation)&&!n(e.rotation)&&!n(e.scale))return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},rotation:function(e){if(n(e.translation)||n(e.scale))return[0,0,0,1]},scale:function(e){if(n(e.translation)||n(e.rotation))return[1,1,1]},translation:function(e){if(n(e.rotation)||n(e.scale))return[0,0,0]}}],programs:[{attributes:[]}],samplers:[{magFilter:o.LINEAR,minFilter:o.NEAREST_MIPMAP_LINEAR,wrapS:o.REPEAT,wrapT:o.REPEAT}],scenes:[{nodes:[]}],shaders:[],skins:[{bindShapeMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}],techniques:[{parameters:{},attributes:{},uniforms:{},states:{enable:[]}}],textures:[{format:o.RGBA,internalFormat:o.RGBA,target:o.TEXTURE_2D,type:o.UNSIGNED_BYTE}],extensionsUsed:[],extensionsRequired:[]},m={values:{emission:[.5,.5,.5,1]}},g={attributes:{a_position:"position"},parameters:{modelViewMatrix:{semantic:"MODELVIEW",type:o.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:o.FLOAT_MAT4},emission:{type:o.FLOAT_VEC4,value:[.5,.5,.5,1]},position:{semantic:"POSITION",type:o.FLOAT_VEC3}},states:{enable:[o.CULL_FACE,o.DEPTH_TEST]},uniforms:{u_modelViewMatrix:"modelViewMatrix",u_projectionMatrix:"projectionMatrix",u_emission:"emission"}},v={attributes:["a_position"]},_={type:o.VERTEX_SHADER,extras:{_pipeline:{extension:".vert",source:"precision highp float;\n\nuniform mat4 u_modelViewMatrix;\nuniform mat4 u_projectionMatrix;\n\nattribute vec3 a_position;\n\nvoid main (void)\n{\n gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_position, 1.0);\n}\n"}}},y={type:o.FRAGMENT_SHADER,extras:{_pipeline:{extension:".frag",source:"precision highp float;\n\nuniform vec4 u_emission;\n\nvoid main(void)\n{\n gl_FragColor = u_emission;\n}\n"}}};return p}),define("ThirdParty/GltfPipeline/addPipelineExtras",["../../Core/defaultValue","../../Core/defined"],function(e,t){"use strict";function r(r){var n=[];for(var o in r)if(r.hasOwnProperty(o))for(var a=r[o],s=a.length,l=0;l0;){var c=n.pop();for(var d in c)if(c.hasOwnProperty(d)){var h=c[d];t(h)&&"object"==typeof h&&"extras"!==d&&(n.push(h),i[d]||Array.isArray(h)||(h.extras=e(h.extras,{}),h.extras._pipeline=e(h.extras._pipeline,{})))}}return r.extras=e(r.extras,{}),r.extras._pipeline=e(r.extras._pipeline,{}),r.asset=e(r.asset,{}),r.asset.extras=e(r.asset.extras,{}),t(r.asset.extras)&&"object"!=typeof r.asset.extras&&(r.asset.extras={extras:r.asset.extras}),r.asset.extras._pipeline=e(r.asset.extras._pipeline,{}),r}var i={attributes:!0,uniforms:!0,extensions:!0,values:!0,samplers:!0};return r}),define("ThirdParty/GltfPipeline/byteLengthForComponentType",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:return 2;case e.FLOAT:case e.UNSIGNED_INT:return 4}}return t}),define("ThirdParty/GltfPipeline/numberOfComponentsForType",[],function(){"use strict";function e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}return e}),define("ThirdParty/GltfPipeline/getAccessorByteStride",["./byteLengthForComponentType","./numberOfComponentsForType","../../Core/defined"],function(e,t,r){"use strict";function i(i,n){var o=i.bufferViews[n.bufferView];return r(o.byteStride)&&o.byteStride>0?o.byteStride:e(n.componentType)*t(n.type)}return i}),define("ThirdParty/GltfPipeline/removeExtensionsRequired",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.extensionsRequired;if(e(i)){var n=i.indexOf(r);n>=0&&i.splice(n,1),0===i.length&&delete t.extensionsRequired}}return t}),define("ThirdParty/GltfPipeline/removeExtensionsUsed",["./removeExtensionsRequired","../../Core/defined"],function(e,t){"use strict";function r(r,i){var n=r.extensionsUsed;if(t(n)){var o=n.indexOf(i);o>=0&&n.splice(o,1),e(r,i),0===n.length&&delete r.extensionsUsed}}return r}),define("ThirdParty/GltfPipeline/addExtensionsUsed",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.extensionsUsed;e(i)||(i=[],t.extensionsUsed=i),i.indexOf(r)<0&&i.push(r)}return t}),define("ThirdParty/GltfPipeline/addExtensionsRequired",["./addExtensionsUsed","../../Core/defined"],function(e,t){"use strict";function r(r,i){var n=r.extensionsRequired;t(n)||(n=[],r.extensionsRequired=n),n.indexOf(i)<0&&n.push(i),e(r,i)}return r}),define("ThirdParty/GltfPipeline/updateVersion",["./addExtensionsRequired","./addToArray","./ForEach","./getAccessorByteStride","./numberOfComponentsForType","../../Core/Cartesian3","../../Core/Math","../../Core/clone","../../Core/ComponentDatatype","../../Core/defaultValue","../../Core/defined","../../Core/Quaternion","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t){t=u(t,{});var r=t.targetVersion,i=e.version;e.asset=u(e.asset,{version:"1.0"}),i=u(i,e.asset.version),F.hasOwnProperty(i)||(c(i)&&(i=(""+i).substring(0,3)),F.hasOwnProperty(i)||(i="1.0"));for(var n=F[i];c(n)&&i!==r;)n(e),i=e.asset.version,n=F[i];return e}function f(e){var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.instanceTechnique;c(n)&&(i.technique=n.technique,i.values=n.values,delete i.instanceTechnique)}}function m(e){var t=e.meshes;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.primitives;if(c(n))for(var o=n.length,a=0;a0)for(r.mesh=o.meshes[s[0]],i=1;i0&&c(r.skin)){e.skins[o.skins[r.skin]].skeleton=o.nodes[h[0]]}delete r.skeletons}c(r.skin)&&(r.skin=o.skins[r.skin]),c(r.jointName)&&delete r.jointName}),r.skin(e,function(e){c(e.inverseBindMatrices)&&(e.inverseBindMatrices=o.accessors[e.inverseBindMatrices]);var t=[],r=e.jointNames;if(c(r)){for(i=0;i=0&&(n=r.substring(0,i)),!c(U[n])){var o="_"+r;t[r]=o}}});for(var i in t)if(t.hasOwnProperty(i)){var n=t[i],o=e.attributes[i];c(o)&&(delete e.attributes[i],e.attributes[n]=o)}})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var r=t[e.semantic];c(r)&&(e.semantic=r)})})}function A(e){r.technique(e,function(e){var t=e.states;if(c(t)){var r=t.functions;c(r)&&delete r.scissor;var i=t.enable;if(c(i)){var n=i.indexOf(h.SCISSOR_TEST);n>=0&&i.splice(n,1)}}})}function D(e){r.technique(e,function(e){var t=e.states;if(c(t)){var r=t.functions;if(c(r)){var i=r.blendColor;if(c(i))for(var n=0;n<4;n++)i[n]=a.clamp(i[n],0,1);var o=r.depthRange;c(o)&&(o[1]=a.clamp(o[1],0,1),o[0]=a.clamp(o[0],0,o[1]))}}})}function I(e){r.camera(e,function(e){var t=e.perspective;if(c(t)){var r=t.aspectRatio;c(r)&&0===r&&delete t.aspectRatio;var i=t.yfov;c(i)&&0===i&&(t.yfov=1)}})} function O(e){r.buffer(e,function(e){c(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),r.bufferView(e,function(t){if(!c(t.byteLength)){var r=t.buffer,i=e.buffers[r];t.byteLength=i.byteLength}})}function M(e){var n=e.bufferViews,o={};r.accessor(e,function(r){var a=r.bufferView;if(c(a)){c(o[a])||(o[a]=!0);var l=s(n[a]),u=c(r.byteStride)&&0!==r.byteStride?r.byteStride:i(e,r);c(u)&&(l.byteStride=u,0!==l.byteStride&&(l.byteLength=r.count*u),l.byteOffset+=r.byteOffset,r.byteOffset=0,delete r.byteStride),r.bufferView=t(n,l)}});var a={},l=0;r.bufferView(e,function(e,t){c(o[t])?l++:a[t]=t-l});var u=0;for(var d in o)if(c(d)){var h=parseInt(d)-u;n.splice(h,1),u++}r.accessor(e,function(e){var t=e.bufferView;c(t)&&(e.bufferView=a[t])}),r.shader(e,function(e){var t=e.bufferView;c(t)&&(e.bufferView=a[t])}),r.image(e,function(e){var t=e.bufferView;if(c(t)&&(e.bufferView=a[t]),c(e.extras)){var r=e.extras.compressedImage3DTiles;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i],o=n.bufferView;c(o)&&(n.bufferView=a[o])}}})}function R(e){r.technique(e,function(e){r.techniqueAttribute(e,function(t){var r=e.parameters[t];c(r.value)&&delete r.value})})}function L(e){r.technique(e,function(e){r.techniqueParameter(e,function(e){if(c(e.count)){var t=e.semantic;(!c(t)||"JOINTMATRIX"!==t&&0!==t.indexOf("_"))&&delete e.count}})})}function N(t){var r=t.techniques;c(r)&&r.length>0&&e(t,"KHR_technique_webgl")}function k(e){c(e.asset)||(e.asset={}),e.asset.version="2.0",f(e),b(e),w(e),S(e),T(e),O(e),M(e),E(e),x(e),P(e),A(e),D(e),I(e),R(e),L(e),N(e)}var F={.8:y,"1.0":k,"2.0":void 0},B={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0},U={POSITION:!0,NORMAL:!0,TEXCOORD:!0,COLOR:!0,JOINT:!0,WEIGHT:!0};return p}),define("ThirdParty/GltfPipeline/parseBinaryGltf",["./addPipelineExtras","./removeExtensionsUsed","./updateVersion","../../Core/ComponentDatatype","../../Core/defined","../../Core/DeveloperError","../../Core/getMagic","../../Core/getStringFromTypedArray","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(u){var c=i.createArrayBufferView(l.INT,u.buffer,u.byteOffset,5);if("glTF"!==a(u))throw new o("File is not valid binary glTF");var d=c[1];if(1!==d&&2!==d)throw new o("Binary glTF version is not 1 or 2");var h,p,f;if(1===d){f=c[2];var m=c[3];if(0!==c[4])throw new o("Binary glTF scene format is not JSON");var g=20+m,v=s(u,20,m);h=JSON.parse(v);var _=u.subarray(g,f);if(p=h.buffers,n(p)&&Object.keys(p).length>0){var y=p.binary_glTF;n(y)||(y=p.KHR_binary_glTF),n(y)&&(y.extras={_pipeline:{source:_}})}r(h),t(h,"KHR_binary_glTF"),e(h)}if(2===d){f=c[2];for(var b,C=12;C0)){p[0].extras._pipeline.source=b}}return h}return u}),define("ThirdParty/GltfPipeline/techniqueParameterForSemantic",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.parameters;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n],a=o.semantic;if(e(a)&&a===r)return n}}return t}),define("ThirdParty/GltfPipeline/webGLConstantToGlslType",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case e.FLOAT:return"float";case e.FLOAT_VEC2:return"vec2";case e.FLOAT_VEC3:return"vec3";case e.FLOAT_VEC4:return"vec4";case e.FLOAT_MAT2:return"mat2";case e.FLOAT_MAT3:return"mat3";case e.FLOAT_MAT4:return"mat4";case e.SAMPLER_2D:return"sampler2D";case e.BOOL:return"bool"}}return t}),define("ThirdParty/GltfPipeline/glslTypeToWebGLConstant",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case"float":return e.FLOAT;case"vec2":return e.FLOAT_VEC2;case"vec3":return e.FLOAT_VEC3;case"vec4":return e.FLOAT_VEC4;case"mat2":return e.FLOAT_MAT2;case"mat3":return e.FLOAT_MAT3;case"mat4":return e.FLOAT_MAT4;case"sampler2D":return e.SAMPLER_2D}}return t}),define("ThirdParty/GltfPipeline/processModelMaterialsCommon",["./addToArray","./ForEach","./numberOfComponentsForType","./techniqueParameterForSemantic","./webGLConstantToGlslType","./glslTypeToWebGLConstant","../../Core/clone","../../Core/defined","../../Core/defaultValue","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){if(r=l(r,{}),s(e)){var i=!1,n=e.extensionsRequired,o=e.extensionsUsed;if(s(o)){var a=o.indexOf("KHR_materials_common");a>=0&&(o.splice(a,1),i=!0),s(n)&&(a=n.indexOf("KHR_materials_common"))>=0&&n.splice(a,1)}if(i){s(e.programs)||(e.programs=[]),s(e.shaders)||(e.shaders=[]),s(e.techniques)||(e.techniques=[]),m(e);var u=d(e);y(e);var c={};t.material(e,function(t){if(s(t.extensions)&&s(t.extensions.KHR_materials_common)){var i=t.extensions.KHR_materials_common,n=f(i),o=c[n];s(o)||(o=h(e,i,u,r),c[n]=o),t.values={};var a=i.values;for(var l in a)if(a.hasOwnProperty(l)){var d=a[l];t.values[l]=d}t.technique=o,delete t.extensions.KHR_materials_common,0===Object.keys(t.extensions).length&&delete t.extensions}}),s(e.extensions)&&(delete e.extensions.KHR_materials_common,0===Object.keys(e.extensions).length&&delete e.extensions),_(e)}return e}}function d(e){var t,r={};if(s(e.extensions)&&s(e.extensions.KHR_materials_common)&&(t=e.extensions.KHR_materials_common.lights),s(t)){var i=e.nodes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];if(s(o.extensions)&&s(o.extensions.KHR_materials_common)){var a=o.extensions.KHR_materials_common.light;s(a)&&s(t[a])&&(t[a].node=n),delete o.extensions.KHR_materials_common}}var l=0;for(var c in t)if(t.hasOwnProperty(c)){var d=t[c],h=d.type;if("ambient"!==h&&!s(d.node)){delete t[c];continue}var p="light"+l.toString();switch(d.baseName=p,h){case"ambient":var f=d.ambient;r[p+"Color"]={type:u.FLOAT_VEC3,value:f.color};break;case"directional":var m=d.directional;r[p+"Color"]={type:u.FLOAT_VEC3,value:m.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4});break;case"point":var g=d.point;r[p+"Color"]={type:u.FLOAT_VEC3,value:g.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4}),r[p+"Attenuation"]={type:u.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]};break;case"spot":var v=d.spot;r[p+"Color"]={type:u.FLOAT_VEC3,value:v.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4},r[p+"InverseTransform"]={node:d.node,semantic:"MODELVIEWINVERSE",type:u.FLOAT_MAT4,useInFragment:!0}),r[p+"Attenuation"]={type:u.FLOAT_VEC3,value:[v.constantAttenuation,v.linearAttenuation,v.quadraticAttenuation]},r[p+"FallOff"]={type:u.FLOAT_VEC2,value:[v.fallOffAngle,v.fallOffExponent]}}++l}}return r}function h(t,i,a,c){var d,h=l(c.optimizeForCesium,!1),f=s(t.extensions)&&s(t.extensions.CESIUM_RTC),m=l(c.addBatchIdToGeneratedShaders,!1),v=t.techniques,_=t.shaders,y=t.programs,b=i.technique.toUpperCase();s(t.extensions)&&s(t.extensions.KHR_materials_common)&&(d=t.extensions.KHR_materials_common.lights);var C=i.values;s(i.transparent)&&(C.transparent=i.transparent),s(i.doubleSided)&&(C.doubleSided=i.doubleSided);var w=l(i.jointCount,0),S=w>0,T={};S&&(T=i.extras._pipeline.skinning);var E="precision highp float;\n",x="precision highp float;\n",P="CONSTANT"!==b,A={modelViewMatrix:{semantic:f?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:u.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:u.FLOAT_MAT4}};P&&(A.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:u.FLOAT_MAT3}),S&&(A.jointMatrix={count:w,semantic:"JOINTMATRIX",type:u.FLOAT_MAT4});var D,I=!1;for(var O in C)if(C.hasOwnProperty(O)&&"transparent"!==O&&"doubleSided"!==O){var M=p(O,C[O]);D=O.toLowerCase(),I||M!==u.SAMPLER_2D||(I=!0),A[D]={type:M}}if(s(A.diffuse)&&h&&(A.diffuse.semantic="_3DTILESDIFFUSE"),s(a))for(var R in a)a.hasOwnProperty(R)&&(A[R]=a[R]);var L={};for(var N in A)if(A.hasOwnProperty(N)&&"extras"!==N){var k=A[N];L["u_"+N]=N;var F=s(k.count)?"["+k.count+"]":"";k.type!==u.FLOAT_MAT3&&k.type!==u.FLOAT_MAT4||k.useInFragment?(x+="uniform "+n(k.type)+" u_"+N+F+";\n",delete k.useInFragment):E+="uniform "+n(k.type)+" u_"+N+F+";\n"}var B="";if(S){var U,V,z=r(T.type),G=!1;if(0===T.type.indexOf("MAT")&&(G=!0,z=Math.sqrt(z)),G)for(U=0;U0,X=!1,Q=!1,Z="";for(var K in d)if(d.hasOwnProperty(K)){var J=d[K],$=J.type.toLowerCase(),ee=J.baseName;Z+=" {\n";var te,re,ie="u_"+ee+"Color";"ambient"===$?(Q=!0,Z+=" ambientLight += "+ie+";\n"):P&&(X=!0,te="v_"+ee+"Direction",re="v_"+ee+"Position","point"!==$&&(E+="varying vec3 "+te+";\n",x+="varying vec3 "+te+";\n",B+=" "+te+" = mat3(u_"+ee+"Transform) * vec3(0.,0.,1.);\n","directional"===$&&(Z+=" vec3 l = normalize("+te+");\n")),"directional"!==$?(E+="varying vec3 "+re+";\n",x+="varying vec3 "+re+";\n",B+=" "+re+" = u_"+ee+"Transform[3].xyz;\n",Z+=" vec3 VP = "+re+" - v_positionEC;\n",Z+=" vec3 l = normalize(VP);\n",Z+=" float range = length(VP);\n",Z+=" float attenuation = 1.0 / (u_"+ee+"Attenuation.x + ",Z+="(u_"+ee+"Attenuation.y * range) + ",Z+="(u_"+ee+"Attenuation.z * range * range));\n"):Z+=" float attenuation = 1.0;\n","spot"===$&&(Z+=" float spotDot = dot(l, normalize("+te+"));\n",Z+=" if (spotDot < cos(u_"+ee+"FallOff.x * 0.5))\n",Z+=" {\n",Z+=" attenuation = 0.0;\n",Z+=" }\n",Z+=" else\n",Z+=" {\n",Z+=" attenuation *= max(0.0, pow(spotDot, u_"+ee+"FallOff.y));\n",Z+=" }\n"),Z+=" diffuseLight += "+ie+"* max(dot(normal,l), 0.) * attenuation;\n",Y&&("BLINN"===b?(Z+=" vec3 h = normalize(l + viewDir);\n",Z+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(Z+=" vec3 reflectDir = reflect(-l, normal);\n",Z+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),Z+=" specularLight += "+ie+" * specularIntensity;\n")),Z+=" }\n"}if(Q||(Z+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),!X&&"CONSTANT"!==b){Z+=h?" vec3 l = normalize(czm_sunDirectionEC);\n":" vec3 l = vec3(0.0, 0.0, 1.0);\n";Z+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), "+(h?"0.2":"0.0")+");\n",Y&&("BLINN"===b?(Z+=" vec3 h = normalize(l + viewDir);\n",Z+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(Z+=" vec3 reflectDir = reflect(-l, normal);\n",Z+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),Z+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")}E+="void main(void) {\n",E+=B,E+="}\n",x+="void main(void) {\n";var ne=" vec3 color = vec3(0.0, 0.0, 0.0);\n";P&&(x+=" vec3 normal = normalize(v_normal);\n",i.doubleSided&&(x+=" if (gl_FrontFacing == false)\n",x+=" {\n",x+=" normal = -normal;\n",x+=" }\n"));var oe;"CONSTANT"!==b?(s(A.diffuse)&&(A.diffuse.type===u.SAMPLER_2D?x+=" vec4 diffuse = texture2D(u_diffuse, "+W+");\n":x+=" vec4 diffuse = u_diffuse;\n",x+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",ne+=" color += diffuse.rgb * diffuseLight;\n"),Y&&(A.specular.type===u.SAMPLER_2D?x+=" vec3 specular = texture2D(u_specular, "+W+").rgb;\n":x+=" vec3 specular = u_specular.rgb;\n",x+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",ne+=" color += specular * specularLight;\n"),oe=s(A.transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):oe=s(A.transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",s(A.emission)&&(A.emission.type===u.SAMPLER_2D?x+=" vec3 emission = texture2D(u_emission, "+W+").rgb;\n":x+=" vec3 emission = u_emission.rgb;\n",ne+=" color += emission;\n"),(s(A.ambient)||"CONSTANT"!==b)&&(s(A.ambient)?A.ambient.type===u.SAMPLER_2D?x+=" vec3 ambient = texture2D(u_ambient, "+W+").rgb;\n":x+=" vec3 ambient = u_ambient.rgb;\n":x+=" vec3 ambient = diffuse.rgb;\n",ne+=" color += ambient * ambientLight;\n"),x+=" vec3 viewDir = -normalize(v_positionEC);\n",x+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",x+=Z,x+=ne,x+=oe,x+="}\n";var ae;ae=C.transparent?{enable:[u.DEPTH_TEST,u.BLEND],functions:{depthMask:[!1],blendEquationSeparate:[u.FUNC_ADD,u.FUNC_ADD],blendFuncSeparate:[u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA]}}:i.doubleSided?{enable:[u.DEPTH_TEST]}:{enable:[u.CULL_FACE,u.DEPTH_TEST]};var se=e(_,{type:u.VERTEX_SHADER,extras:{_pipeline:{source:E,extension:".glsl"}}}),le=e(_,{type:u.FRAGMENT_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),ue=Object.keys(H),ce=e(y,{attributes:ue,fragmentShader:le,vertexShader:se});return e(v,{attributes:H,parameters:A,program:ce,states:ae,uniforms:L})}function p(e,t){var r;switch(r=s(t.value)?t.value:s(t.index)?[t.index]:t,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===r.length?u.SAMPLER_2D:u.FLOAT_VEC4;case"shininess":case"transparency":return u.FLOAT;case"transparent":case"doubleSided":return u.BOOL}}function f(e){var t="";t+="technique:"+e.technique+";";for(var r=e.values,i=Object.keys(r).sort(),n=i.length,o=0;o0){t+=e.extras._pipeline.skinning.type+";"}return t}function m(e){s(e.extensions)||(e.extensions={});var t=e.extensions;s(t.KHR_materials_common)||(t.KHR_materials_common={});var r=t.KHR_materials_common;s(r.lights)||(r.lights={});for(var i=r.lights,n=i.length,o=0;o=0||b.indexOf("Factor")>=0)||"doubleSided"===b)&&(y[b]=a[b]);var C,w="precision highp float;\n",S="precision highp float;\n";s(i.skins)&&(C=i.skins[0]);var T,E=s(C)?C.joints:[],x=E.length,P=a.extras._pipeline.skinning,A=s(P.type),D=!1,I=!1;t.mesh(i,function(e){t.meshPrimitive(e,function(e){var t=e.targets;!I&&s(t)&&(I=!0,T=t);var r=e.attributes;for(var i in r)i.indexOf("TANGENT")>=0&&(D=!0)})});var O={modelViewMatrix:{semantic:f?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:u.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:u.FLOAT_MAT4}};O.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:u.FLOAT_MAT3},A&&(O.jointMatrix={count:x,semantic:"JOINTMATRIX",type:u.FLOAT_MAT4}),I&&(O.morphWeights={count:T.length,semantic:"MORPHWEIGHTS",type:u.FLOAT});var M=!1;for(var R in y)if(y.hasOwnProperty(R)){var L=h(R);M||L!==u.SAMPLER_2D||(M=!0),O[R]={type:L}}var N={};for(var k in O)if(O.hasOwnProperty(k)&&"extras"!==k){var F=O[k];N["u_"+k]=k;var B=s(F.count)?"["+F.count+"]":"";F.type!==u.FLOAT_MAT3&&F.type!==u.FLOAT_MAT4&&"morphWeights"!==k||F.useInFragment?(S+="uniform "+n(F.type)+" u_"+k+B+";\n",delete F.useInFragment):w+="uniform "+n(F.type)+" u_"+k+B+";\n"}var U="";if(A){var V,z,G=r(P.type),H=!1;if(0===P.type.indexOf("MAT")&&(H=!0,G=Math.sqrt(G)),H)for(V=0;V= "+$+"));\n":S+=" gl_FragColor = vec4(color, 1.0);\n"}else S+="BLEND"===J?" gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":" gl_FragColor = vec4(color, 1.0);\n";else S+=" gl_FragColor = vec4(color, 1.0);\n";S+="}\n";var ee;ee=s(J)&&"OPAQUE"!==J?{enable:[u.DEPTH_TEST,u.BLEND],functions:{depthMask:[!1],blendEquationSeparate:[u.FUNC_ADD,u.FUNC_ADD],blendFuncSeparate:[u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA]}}:y.doubleSided?{enable:[u.DEPTH_TEST]}:{enable:[u.CULL_FACE,u.DEPTH_TEST]};var te=e(v,{type:u.VERTEX_SHADER,extras:{_pipeline:{source:w,extension:".glsl"}}}),re=e(v,{type:u.FRAGMENT_SHADER,extras:{_pipeline:{source:S,extension:".glsl"}}}),ie=Object.keys(W),ne=e(_,{attributes:ie,fragmentShader:re,vertexShader:te});return e(g,{attributes:W,parameters:O,program:ne,states:ee,uniforms:N})}function h(e){switch(e){case"baseColorFactor":return u.FLOAT_VEC4;case"metallicFactor":case"roughnessFactor":return u.FLOAT;case"baseColorTexture":case"metallicRoughnessTexture":case"normalTexture":case"occlusionTexture":case"emissiveTexture":return u.SAMPLER_2D;case"emissiveFactor":return u.FLOAT_VEC3;case"doubleSided":return u.BOOL}}function p(e){return"SCALAR"===e?"float":e.toLowerCase()}function f(e,t){var r=e.accessors,n=e.materials,o=e.techniques,a=e.programs,l=e.shaders,u=t.targets,c=t.attributes;for(var d in u)if(s(d)){var h=u[d];for(var f in h)"extras"!==f&&(c[f+"_"+d]=h[f])}var m=n[t.material],g=o[m.technique],v=a[g.program],_=l[v.vertexShader];for(var y in c)if(c.hasOwnProperty(y)&&!s(i(g,y))){var b=c[y],C=r[b];"_"===y.charAt(0)&&(y=y.slice(1));var w="a_"+y;g.parameters[y]={semantic:y,type:C.componentType},g.attributes[w]=y,v.attributes.push(w);var S=_.extras._pipeline,T=S.source;T="attribute "+p(C.type)+" "+w+";\n"+T,S.source=T}}function m(e){t.mesh(e,function(r){t.meshPrimitive(r,function(t){f(e,t)})})}function g(r){var i=r.accessors,n=r.materials;t.mesh(r,function(r){t.meshPrimitive(r,function(t){var r,o,l=t.material,u=n[l],c=t.attributes.JOINTS_0;if(s(c)){var d=i[c];r=d.componentType,o=d.type}var h=s(c),p=u.extras._pipeline.skinning;if(s(p)){if(p.skinned!==h||p.type!==o){var f=a(u,!0);f.material.extras._pipeline.skinning={skinned:h,componentType:r,type:o},l=e(n,f),t.material=l}}else u.extras._pipeline.skinning={skinned:h,componentType:r,type:o}})})}return c}),define("ThirdParty/GltfPipeline/removePipelineExtras",["../../Core/defined"],function(e){"use strict";function t(r){if(e(r)&&"object"==typeof r){ e(r.extras)&&e(r.extras._pipeline)&&(delete r.extras._pipeline,0===Object.keys(r.extras).length&&delete r.extras);for(var i in r)r.hasOwnProperty(i)&&t(r[i])}return r}return t}),define("Scene/AttributeType",["../Core/freezeObject"],function(e){"use strict";return e({SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"})}),define("Scene/Axis",["../Core/Check","../Core/freezeObject","../Core/Math","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n){"use strict";var o={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationX(r.PI_OVER_TWO)),Z_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationX(-r.PI_OVER_TWO)),X_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationY(-r.PI_OVER_TWO)),Z_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationY(r.PI_OVER_TWO)),X_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationZ(r.PI_OVER_TWO)),Y_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationZ(-r.PI_OVER_TWO)),fromName:function(e){return o[e]}};return t(o)}),define("Scene/getAttributeOrUniformBySemantic",["../Core/defined"],function(e){"use strict";function t(t,r){var i,n=t.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],s=a.parameters,l=a.attributes,u=a.uniforms;for(var c in l)if(l.hasOwnProperty(c)&&(i=s[l[c]],e(i)&&i.semantic===r))return c;for(var d in u)if(u.hasOwnProperty(d)&&(i=s[u[d]],e(i)&&i.semantic===r))return d}}return t}),define("Scene/JobType",["../Core/freezeObject"],function(e){"use strict";return e({TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3})}),define("Scene/ModelAnimationCache",["./AttributeType","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","../Core/WeightSpline","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(){}function f(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,o=n[t.bufferView],a=i[o.buffer],s=o.byteOffset+t.byteOffset,l=t.count*h(t.type),u=v.test(a.uri)?"":a.uri;return e.cacheKey+"//"+u+"/"+s+"/"+l}function m(e,t,r){return e.cacheKey+"//"+t+"/"+r}function g(e){this._value=e}var v=/^data\:/i,_={};p.getAnimationParameterValues=function(e,o){var a=f(e,o),l=_[a];if(!n(l)){var u=e.gltf,c=u.buffers,p=u.bufferViews,m=p[o.bufferView],g=m.buffer,v=c[g],y=v.extras._pipeline.source,b=o.componentType,C=o.type,w=h(C),S=o.count,T=d(u,o);l=new Array(S);for(var E=i(o.byteOffset,0),x=m.byteOffset+E,P=0;P=0,S=g.loop===u.REPEAT||g.loop===u.MIRRORED_REPEAT;if((w||S&&!r(g.startTime))&&(C<=1||S)&&(!r(b)||a.lessThanOrEquals(l,b))){if(g._state===c.STOPPED&&(g._state=c.ANIMATING,g.start.numberOfListeners>0&&e.afterRender.push(g._raiseStartEvent)),g.loop===u.REPEAT)C-=Math.floor(C);else if(g.loop===u.MIRRORED_REPEAT){var T=Math.floor(C),E=C-T;C=T%2==1?1-E:E}g.reverse&&(C=1-C);var x=C*y*g.speedup;x=s.clamp(x,v.startTime,v.stopTime),p(v,x),g.update.numberOfListeners>0&&(g._updateEventTime=x,e.afterRender.push(g._raiseUpdateEvent)),o=!0}else w&&g._state===c.ANIMATING&&(g._state=c.STOPPED,g.stop.numberOfListeners>0&&e.afterRender.push(g._raiseStopEvent),g.removeOnStop&&m.push(g))}n=m.length;for(var P=0;P0;){p=l.pop();var f=p._transformToRoot,m=p.mesh;if(u(m))for(var g=o[m],v=g.primitives,_=v.length,y=0;y<_;++y){var b=v[y].attributes.POSITION;if(u(b)){var C=Ie(i,b),w=r.fromArray(C.min,0,Ir),S=r.fromArray(C.max,0,Or);u(c)&&u(d)&&(I.multiplyByPoint(f,w,w),I.multiplyByPoint(f,S,S),r.minimumByComponent(c,w,c),r.maximumByComponent(d,S,d))}}for(var T=p.children,E=T.length,x=0;x0&&(Ur.set(o.peek(),e,n),t.jobScheduler.execute(Ur,fe.BUFFER));)o.dequeue();for(;a.length>0&&(i=a.peek(),Vr.set(i.id,i.componentType,e,n),t.jobScheduler.execute(Vr,fe.BUFFER));)a.dequeue()}else{for(;o.length>0;)Xe(o.dequeue(),e,n);for(;a.length>0;)i=a.dequeue(),Qe(i.id,i.componentType,e,n)}}}function Ke(e,t){var r,i={},n=t.length;for(r=1;r2?"vec"+(y-1):"float",e=b+" "+_+";\n"+e;var C="";5===y?(e="uniform mat4 "+p+";\n"+e,e="uniform vec4 "+f+";\n"+e,C="\nvoid main() {\n "+_+" = "+p+" * "+c+" + "+f+";\n "+v+"();\n}\n",n[p]={mat:4},n[f]={vec:4}):(e="uniform mat"+y+" "+h+";\n"+e,C="\nvoid main() {\n "+_+" = "+b+"("+h+" * vec"+y+"("+c+",1.0));\n "+v+"();\n}\n",n[h]={mat:y}),e=j.replaceMain(e,v),e+=C}}}}return r._programPrimitives[t]=void 0,e}function it(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function nt(e,t){return e=j.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function ot(e,t,r){return u(r)&&(e=r(e,t)),e}function at(e,t,r){var i=t.gltf.programs,n=t.gltf.shaders,o=i[e],a=Ke(t,o.attributes),s=n[o.vertexShader].extras._pipeline.source,l=n[o.fragmentShader].extras._pipeline.source,c=o.attributes.length,d=t._precreatedAttributes;if(u(d))for(var h in d)d.hasOwnProperty(h)&&(a[h]=c++);t.extensionsUsed.WEB3D_quantized_attributes&&(s=rt(s,e,t,r));var p=it(t),f=nt(l,p),m=ot(s,e,t._vertexShaderLoaded),g=ot(f,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=W.fromCache({context:r,vertexShaderSource:m,fragmentShaderSource:g,attributeLocations:a}),t.allowPicking){var v=ot(s,e,t._pickVertexShaderLoaded),_=ot(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(_=j.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=W.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:_,attributeLocations:a})}}function st(e,t){var r=e._loadResources,i=r.programsToCreate;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;i.length>0&&(Gr.set(i.peek(),e,n),t.jobScheduler.execute(Gr,fe.PROGRAM));)i.dequeue();else for(;i.length>0;)at(i.dequeue(),e,n)}}function lt(e,t){return function(r){e.texturesToCreate.enqueue({id:t.id,image:r,bufferView:void 0}),--e.pendingBufferViewToImage}}function ut(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var r=t.texturesToCreateFromBufferView.dequeue(),i=e.gltf,n=i.bufferViews[r.bufferView],o=i.textures[r.id].source,a=Me(e,"image","id: "+r.id+", bufferView: "+r.bufferView);if("image/ktx"===r.mimeType)E(t.getBuffer(n)).then(Ve(e,r.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else if("image/crn"===r.mimeType)w(t.getBuffer(n)).then(Ve(e,r.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else{var s=lt(t,r);T(t.getBuffer(n),r.mimeType).then(s).otherwise(a),++t.pendingBufferViewToImage}}}function ct(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=new H({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function dt(e,t,r){var i=t.gltf.textures,n=i[e.id],o=t._rendererResources.samplers,a=o[n.sampler];a=l(a,new H({wrapS:X.REPEAT,wrapT:X.REPEAT}));var s,c=e.internalFormat,d=!(u(c)&&O.isCompressedFormat(c)||a.minificationFilter!==Y.NEAREST_MIPMAP_NEAREST&&a.minificationFilter!==Y.NEAREST_MIPMAP_LINEAR&&a.minificationFilter!==Y.LINEAR_MIPMAP_NEAREST&&a.minificationFilter!==Y.LINEAR_MIPMAP_LINEAR),h=d||a.wrapS===X.REPEAT||a.wrapS===X.MIRRORED_REPEAT||a.wrapT===X.REPEAT||a.wrapT===X.MIRRORED_REPEAT,p=e.image;if(u(c)&&n.target===F.TEXTURE_2D)s=new q({context:r,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:c,sampler:a});else if(u(p)){var f=!P.isPowerOfTwo(p.width)||!P.isPowerOfTwo(p.height);if(h&&f){var m=document.createElement("canvas");m.width=P.nextPowerOfTwo(p.width),m.height=P.nextPowerOfTwo(p.height);var g=m.getContext("2d");g.drawImage(p,0,0,p.width,p.height,0,0,m.width,m.height),p=m}n.target===F.TEXTURE_2D&&(s=new q({context:r,source:p,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1}),d&&s.generateMipmap())}u(s)&&(t._rendererResources.textures[e.id]=s,t._texturesByteLength+=s.sizeInBytes)}function ht(e,t){var r=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(Wr.set(i.peek(),e,r),t.jobScheduler.execute(Wr,fe.TEXTURE));)i.dequeue();else for(;i.length>0;)dt(i.dequeue(),e,r)}function pt(e,t){var r,i,n=e.gltf,o=n.techniques,a=n.materials,s={},l=o[a[t.material].technique],c=l.parameters,d=l.attributes,h=e._rendererResources.programs[l.program],p=h.vertexAttributes,f=h._attributeLocations;for(r in p)if(p.hasOwnProperty(r)){var m=d[r];if(i=p[r].index,u(m)){var g=c[m];s[g.semantic]=i}}var v=e._precreatedAttributes;if(u(v))for(r in v)v.hasOwnProperty(r)&&(i=f[r],s[r]=i);return s}function ft(e,t){for(var r=e.length,i={},n=0;n0;){var a=o.pop(),s=t[a];u(s)&&(i[a]=a);for(var l=s.children,c=l.length,d=0;d0;){var _=f.pop();m[_.id]=!0;var y=_.parentRuntimeNode,b=_.gltfNode,C=a[_.id];if(0===C.parents.length)if(u(b.matrix))C.matrix=I.fromColumnMajorArray(b.matrix);else{var w=b.rotation;C.translation=r.fromArray(b.translation),C.rotation=R.unpack(w),C.scale=r.fromArray(b.scale)}u(y)?(y.children.push(C),C.parents.push(y)):o.push(C),u(b.mesh)&&jt(e,b,C,t,i);for(var S=b.children,T=S.length,E=0;E0;){_=h.pop();var y=_.transformToRoot,b=_.commands;if(_.dirtyNumber===s||n||o){var C=I.multiplyTransformation(p,y,_.computedMatrix),w=b.length;if(w>0)for(var S=0;S0;){o=i.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u0&&i<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 cr(e){for(var t=e._nodeCommands,r=t.length,i=0;i0&&e.color.alpha<1}function hr(e){return 0===e.color.alpha}function pr(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function fr(e,t){for(var r=++$r%255,i=cr(e)||dr(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,d=0;d=o&&i<=a}if(!f.supportsTypedArrays())return{};var Pr=new r,Ar={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};we.prototype.getBuffer=function(e){return Pe(this.buffers[e.buffer],e.byteOffset,e.byteLength)},we.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},we.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},we.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},we.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},we.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},we.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(Te.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),Te.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,r=t.length,i=0;iz||k.center.y-k.radiusz||k.center.y-k.radiusz||k.center.y-k.radius-1;i--)m(this,e[i],t,r);return n(this)},f.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return h.FAILED;var o=n.modelPrimitive;if(!i(o)||!o.show)return h.FAILED;if(!o.ready)return h.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,r);else{if(!i(o._clampedModelMatrix))return h.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,r)}return h.DONE},f.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(g(a,l),s.set(a.id,a)):(m(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],m(this,a,l,u),s.remove(a.id)},f}),define("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n#ifdef POLYLINE_DASH\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),define("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),define("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),define("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=d.fromType(d.ColorType,{color:new i(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,r.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(r.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var h;o(s)&&(h=u.clone(s.modelMatrix)),this._modelMatrix=h,this._segments=c.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(b),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var r=e._polylineCollection;o(r)&&(r._updatePolyline(e,t),e._dirty=!0)}var f=h.POSITION_INDEX=0,m=h.SHOW_INDEX=1,g=h.WIDTH_INDEX=2,v=h.MATERIAL_INDEX=3,_=h.POSITION_SIZE_INDEX=4,y=h.DISTANCE_DISPLAY_CONDITION=5,b=h.NUMBER_OF_PROPERTIES=6;return a(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,m))}},positions:{get:function(){return this._positions},set:function(i){var n=e(i,r.equalsEpsilon);this._loop&&n.length>2&&(n===i&&(n=i.slice()),n.push(r.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,_),this._positions=i,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,f),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,v))}},width:{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,p(this,g))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!r.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(r.clone(t[0]))):t.length>2&&r.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,_)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),h.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,i=this._segments.lengths,n=this._propertiesChanged[f]>0||this._propertiesChanged[_]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=u.clone(e,this._modelMatrix),this._segments.positions.length!==r)p(this,_);else for(var a=i.length,s=0;s0){var F=E.isTranslucent();c>=u?(x=new w({owner:t}),i.push(x)):x=i[c],++c,x.boundingVolume=e.clone(ce,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=_.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(E._uniforms),x.count=M,x.offset=A,A+=M,M=0,d=!0,s.push(x)}E=L._material,E.update(a),T=N}for(var B=L._locatorBuckets,U=B.length,V=0;V0&&(c>=u?(x=new w({owner:t}),i.push(x)):x=i[c],++c,x.boundingVolume=e.clone(ce,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=_.va,x.renderState=E.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=E.isTranslucent()?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(E._uniforms),x.count=M,x.offset=A,d=!0,s.push(x)),T=void 0}i.length=c}function V(e){var t=!1,r=e._propertiesChanged,i=e._positionBufferUsage;return r[te]?i.bufferUsage!==b.STREAM_DRAW?(t=!0,i.bufferUsage=b.STREAM_DRAW,i.frameCount=100):i.frameCount=100:i.bufferUsage!==b.STATIC_DRAW&&(0===i.frameCount?(t=!0,i.bufferUsage=b.STATIC_DRAW):i.frameCount--),t}function z(e,t,r){e._createVertexArray=!1,Y(e),X(e),W(e);var i,n,o=[[]],s=o[0],u=e._batchTable,c=[0],d=0,h=[[]],f=0,g=e._polylineBuckets;for(i in g)g.hasOwnProperty(i)&&(n=g[i],n.updateShader(t,u),f+=n.lengthOfPositions);if(f>0){var v,_=e._mode,C=new Float32Array(6*f*3),w=new Float32Array(4*f),S=0,T=0,E=0;for(i in g)if(g.hasOwnProperty(i)){n=g[i],n.write(C,w,S,T,E,u,t,r),_===k.MORPHING&&(l(v)||(v=new Float32Array(6*f*3)),n.writeForMorph(v,S));var x=n.lengthOfPositions;S+=6*x*3,T+=4*x,E+=4*x,d=n.updateIndices(o,c,h,d)}var P=e._positionBufferUsage.bufferUsage,D=b.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:C,usage:P});var I;l(v)&&(I=y.createVertexBuffer({context:t,typedArray:v,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:D});for(var O=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,R=0,L=o.length,N=0;N0){var F=new Uint16Array(s),B=y.createIndexBuffer({context:t,typedArray:F,usage:b.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});R+=c[N];var U,V,z,G,H=6*(N*(O*m.SIXTY_FOUR_KILOBYTES)-R*O),j=O+H,q=O+j,Q=O+q,Z=O+Q,K=O+Z,J=N*(M*m.SIXTY_FOUR_KILOBYTES)-R*M,$=[{index:ae.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*O},{index:ae.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:j,strideInBytes:6*O},{index:ae.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*O},{index:ae.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:j,strideInBytes:6*O},{index:ae.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:q,strideInBytes:6*O},{index:ae.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*O},{index:ae.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:q,strideInBytes:6*O},{index:ae.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*O},{index:ae.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*O},{index:ae.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*O},{index:ae.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*O},{index:ae.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*O},{index:ae.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];_===k.SCENE3D?(U=e._positionBuffer,V="vertexBuffer",z=he,G="value"):_===k.SCENE2D||_===k.COLUMBUS_VIEW?(U=he,V="value",z=e._positionBuffer,G="vertexBuffer"):(U=I,V="vertexBuffer",z=e._positionBuffer,G="vertexBuffer"),$[0][V]=U,$[1][V]=U,$[2][G]=z,$[3][G]=z,$[4][V]=U,$[5][V]=U,$[6][G]=z,$[7][G]=z,$[8][V]=U,$[9][V]=U,$[10][G]=z,$[11][G]=z;var ee=new A({context:t,attributes:$,indexBuffer:B});e._vertexArrays.push({va:ee,buckets:h[N]})}}}function G(e,t){return t instanceof P?t.id:t}function H(e){var t=L._uniformList[e.type],r=t.length;pe.length=2*r;for(var i=0,n=0;n1){s.update();var u=s.material,c=i[u.type];l(c)||(c=i[u.type]=new K(u,t,r)),c.addPolyline(s)}}}function j(e,t){var r=t.mode;e._mode===r&&g.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=g.clone(e.modelMatrix),e._createVertexArray=!0)}function q(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],r=e._polylines.length,i=0,n=0;i2){if(a[te]||a[ie]){var b=e.mode===k.SCENE2D?r._boundingVolume2D:r._boundingVolumeWC,w=h.fromCartesian(b.center,se),S=i.fromElements(w.low.x,w.low.y,w.low.z,b.radius,le);this._batchTable.setBatchedAttribute(r._index,2,w.high),this._batchTable.setBatchedAttribute(r._index,3,S)}if(a[ne]){var E=ue;E.x=0,E.y=Number.MAX_VALUE;var x=r.distanceDisplayCondition;l(x)&&(E.x=x.near,E.y=x.far),this._batchTable.setBatchedAttribute(r._index,4,E)}}r._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var P=0;P0,S=b._index,T=this.getSegments(b,d),E=T.positions,x=T.lengths,P=E.length,A=b.getPickId(c).color,D=0,I=0,O=0;O0||fe.x>0&&me.x<0)&&r.clone(fe,me),(fe.x<0&&ge.x>0||fe.x>0&&ge.x<0)&&r.clone(fe,ge));for(var N=R?2:0,F=L?2:4,B=N;B2&&(u.setBatchedAttribute(S,2,W),u.setBatchedAttribute(S,3,j),u.setBatchedAttribute(S,4,q))}};var be=new r,Ce=new r,we=new r,Se=new r;K.prototype.writeForMorph=function(e,t){for(var i=this.modelMatrix,n=this.polylines,o=n.length,a=0;a0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d0))continue;p[0]=f}else p=h._segments.lengths;var g=p.length;if(g>0){for(var v=0,_=0;_m.SIXTY_FOUR_KILOBYTES&&(h._locatorBuckets.push({locator:o,count:v}),v=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new Z(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),v+=6,a+=6,i+=6,l+=4;h._locatorBuckets.push({locator:o,count:v}),l+4>m.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new Z(0,0,this),r[++n]=[o])}h._clean()}return o.count=a,i},K.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;n0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new r(h.z,h.x,h.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var De;return K.prototype.writeUpdate=function(e,t,i,n){var o=this.mode,a=n.ellipsoid.maximumRadius*m.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=De,c=6*s*3;!l(u)||u.lengthc&&(u=new Float32Array(u.buffer,0,c));var d,p=this.getSegments(t,n),f=p.positions,g=p.lengths,v=0,_=0,y=0;s=f.length;for(var b=0;b0||fe.x>0&&me.x<0)&&r.clone(fe,me),(fe.x<0&&ge.x>0||fe.x>0&&ge.x<0)&&r.clone(fe,ge));for(var T=w?2:0,E=S?2:4,x=T;x0&&!C){var w=n[v+1],S=o.secondsDifference(w,y);C=S>l,C&&(p=Math.ceil(S/l),f=0,m=S/Math.max(p,2),p=Math.max(p-1,1))}if(C&&f0){var S=w.pop();c=this._polylineCollection.get(S),t.index=S}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=g.getValueOrDefault(s._resolution,e,60);c.show=!0,c.positions=A(l,i,n,e,this._referenceFrame,T,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=g.getValueOrDefault(s._width,e,1),c.distanceDisplayCondition=g.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;r(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)},I.prototype.update=function(e){var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);for(var n=this._items.values,o=0,a=n.length;o-1;o--)a=t[o],r(a._path)&&r(a._position)&&l.set(a.id,new C(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._path)&&r(a._position)?l.contains(a.id)||l.set(a.id,new C(a)):(s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=i.length-1;o>-1;o--)a=i[o],s=l.get(a.id),r(s)&&(r(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},I._subSample=A,I}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,r){r.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function p(e,t,r){if(i(e)){var n=e.pointPrimitive;if(i(n))return e.pointPrimitive=void 0,void r.removePoint(t);var o=e.billboard;i(o)&&(e.billboard=void 0,r.removeBillboard(t))}}function f(e,t,r,i,n){return function(o){var a=document.createElement("canvas"),s=n+2*i;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==i&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=r,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var m=r.WHITE,g=r.BLACK,v=new r,_=new t,y=new r,b=new s,C=new s,w=new a;return h.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o0?(S.scale=1,x=x||D!==s.outlineWidth||I!==s.pixelSize||!r.equals(P,s.color)||!r.equals(A,s.outlineColor)):(S.scale=I/50,I=50,x=x||D!==s.outlineWidth||!r.equals(P,s.color)||!r.equals(A,s.outlineColor)),x){s.color=r.clone(P,s.color),s.outlineColor=r.clone(A,s.outlineColor),s.pixelSize=I,s.outlineWidth=D;var O=P.alpha,M=P.toCssColorString(),R=A.toCssColorString(),L=JSON.stringify([M,I,R,D]);S.setImage(L,f(O,M,R,D,I))}}}else p(s,u,n)}return!0},h.prototype.getBoundingSphere=function(e,r){var n=this._items.get(e.id);if(!i(n)||!i(n.pointPrimitive)&&!i(n.billboard))return u.FAILED;if(i(n.pointPrimitive))r.center=t.clone(n.pointPrimitive.position,r.center);else{var o=n.billboard;if(!i(o._clampedPosition))return u.PENDING;r.center=t.clone(o._clampedPosition,r.center)}return r.radius=0,u.DONE},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t-1;o--)a=t[o],i(a._point)&&i(a._position)&&s.set(a.id,new d(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._point)&&i(a._position)?s.contains(a.id)||s.set(a.id,new d(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],p(s.get(a.id),a,l),s.remove(a.id)},h}),define("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P){"use strict";function A(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new A(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function I(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new A(r._entity)}var O=new S(e.WHITE),M=new T(!0),R=new T(!0),L=new T(!1),N=new T(e.BLACK),k=new T(w.DISABLED),F=new T(new s),B=new e;return n(D,{perInstanceColorAppearanceType:{value:b},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&P.isConstant(this._showProperty)&&P.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&P.isConstant(this._showProperty)&&P.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new v(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof S){var p=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(r)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new f(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=P.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new g(this._options),attributes:{show:new v(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.perPositionHeight,c=i(u)&&(!u.isConstant||u.getValue(h.MINIMUM_VALUE)),f=a.outline,g=i(f);if(g&&f.isConstant&&(g=f.getValue(h.MINIMUM_VALUE)),!l&&!g)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=a.hierarchy,C=a.show;if(i(C)&&C.isConstant&&!C.getValue(h.MINIMUM_VALUE)||!i(v))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var w=r(a.material,O),T=w instanceof S;this._materialProperty=w,this._fillProperty=r(s,R),this._showProperty=r(C,M),this._showOutlineProperty=r(a.outline,L),this._outlineColorProperty=g?r(a.outlineColor,N):void 0,this._shadowsProperty=r(a.shadows,k),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,F);var E=a.height,x=a.extrudedHeight,A=a.granularity,D=a.stRotation,I=a.outlineWidth,B=l&&!i(E)&&!i(x)&&T&&!c&&_.isSupported(this._scene);g&&B&&(p(p.geometryOutlines),g=!1);var U=a.perPositionHeight,V=a.closeTop,z=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=B,this._outlineEnabled=g,v.isConstant&&P.isConstant(E)&&P.isConstant(x)&&P.isConstant(A)&&P.isConstant(D)&&P.isConstant(I)&&P.isConstant(u)&&P.isConstant(U)&&P.isConstant(V)&&P.isConstant(z)&&(!B||P.isConstant(w))){var G=this._options;G.vertexFormat=T?b.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var H=v.getValue(h.MINIMUM_VALUE);d(H)&&(H=new m(H));var W=P.getValueOrUndefined(E,h.MINIMUM_VALUE),j=P.getValueOrDefault(V,h.MINIMUM_VALUE,!0),q=P.getValueOrDefault(z,h.MINIMUM_VALUE,!0),Y=P.getValueOrUndefined(x,h.MINIMUM_VALUE);G.polygonHierarchy=H,G.height=W,G.extrudedHeight=Y,G.granularity=P.getValueOrUndefined(A,h.MINIMUM_VALUE),G.stRotation=P.getValueOrUndefined(D,h.MINIMUM_VALUE),G.perPositionHeight=P.getValueOrUndefined(U,h.MINIMUM_VALUE),G.closeTop=j,G.closeBottom=q,this._outlineWidth=P.getValueOrDefault(I,h.MINIMUM_VALUE,1),this._isClosed=i(Y)&&Y!==W&&j&&q,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new I(e,t,this)},I.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(r)&&P.getValueOrDefault(u.show,r,!0)){var h=this._options,p=P.getValueOrUndefined(u.hierarchy,r);if(i(p)){d(p)?h.polygonHierarchy=new m(p):h.polygonHierarchy=p;var v=P.getValueOrDefault(u.closeTop,r,!0),w=P.getValueOrDefault(u.closeBottom,r,!0);h.height=P.getValueOrUndefined(u.height,r),h.extrudedHeight=P.getValueOrUndefined(u.extrudedHeight,r),h.granularity=P.getValueOrUndefined(u.granularity,r),h.stRotation=P.getValueOrUndefined(u.stRotation,r),h.perPositionHeight=P.getValueOrUndefined(u.perPositionHeight,r),h.closeTop=v,h.closeBottom=w;var S=this._geometryUpdater.shadowsProperty.getValue(r);if(P.getValueOrDefault(u.fill,r,!0)){var T=n.fillMaterialProperty,E=x.getValue(r,T,this._material);if(this._material=E,o){var A=e.WHITE;i(T.color)&&(A=T.color.getValue(r)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new f(h),attributes:{color:t.fromColor(A)}}),asynchronous:!1,shadows:S}))}else{var D=new y({material:E,translucent:E.isTranslucent(),closed:i(h.extrudedHeight)&&h.extrudedHeight!==h.height&&v&&w});h.vertexFormat=D.vertexFormat,this._primitive=a.add(new C({geometryInstances:new c({id:l,geometry:new f(h)}),appearance:D,asynchronous:!1,shadows:S}))}}if(!o&&P.getValueOrDefault(u.outline,r,!1)){h.vertexFormat=b.VERTEX_FORMAT;var I=P.getValueOrClonedDefault(u.outlineColor,r,e.BLACK,B),O=P.getValueOrDefault(u.outlineWidth,r,1),M=1!==I.alpha;this._outlinePrimitive=a.add(new C({geometryInstances:new c({id:l,geometry:new g(h),attributes:{color:t.fromColor(I)}}),appearance:new b({flat:!0,translucent:M,renderState:{lineWidth:n._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:S}))}}}},I.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),define("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),i=s.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(r,!1,t.renderState),this._closed=!1,this._vertexFormat=i}var l=o+"\n"+n,u=i;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=r.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),define("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:l.fromType(l.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,c),this._fragmentShaderSource=e(r.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,!1,r.renderState),this._closed=!1,this._vertexFormat=n}var c=o+"\n"+n,d=a;return r(u.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e="#define POLYLINE_DASH\n"+e),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=i.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),define("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._depthFailMaterialProperty=void 0,this._options=new E(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function P(e,t){var r=t._scene.id,i=A[r];!n(i)||i.isDestroyed()?(i=new g,A[r]=i,e.add(i)):e.contains(i)||e.add(i);var o=i.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[]}var A={},D=new C(t.WHITE),I=new w(!0),O=new w(y.DISABLED),M=new w(new l);o(x,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:_}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&T.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var i,o=this._entity,a=o.isAvailable(e),s=new m(a&&o.isShowing&&this._showProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),c=u.fromDistanceDisplayCondition(l),h={show:s,distanceDisplayCondition:c};return this._materialProperty instanceof C&&(i=t.WHITE,n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||a)&&(i=this._materialProperty.color.getValue(e)),h.color=r.fromColor(i)), n(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof C&&(i=t.WHITE,n(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||a)&&(i=this._depthFailMaterialProperty.color.getValue(e)),h.depthFailColor=r.fromColor(i)),new d({id:o,geometry:new p(this._options),attributes:h})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,r,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=i(a.material,D),c=u instanceof C;this._materialProperty=u,this._depthFailMaterialProperty=a.depthFailMaterial,this._showProperty=i(l,I),this._shadowsProperty=i(a.shadows,O),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,M),this._fillEnabled=!0;var d=a.width,p=a.followSurface,f=a.granularity;if(s.isConstant&&T.isConstant(d)&&T.isConstant(p)&&T.isConstant(f)){var m=this._options,g=s.getValue(h.MINIMUM_VALUE,m.positions);if(!n(g)||g.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var y;y=c&&(!n(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof C)?v.VERTEX_FORMAT:_.VERTEX_FORMAT,m.vertexFormat=y,m.positions=g,m.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,m.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,m.granularity=n(f)?f.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var R={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return P.prototype.update=function(e){var t=this._geometryUpdater,r=t._entity,i=r.polyline,o=this._line;if(!r.isShowing||!r.isAvailable(e)||!T.getValueOrDefault(i._show,e,!0))return void(o.show=!1);var a=i.positions,s=T.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=T.getValueOrDefault(i._followSurface,e,!0),u=t._scene.globe;l&&n(u)&&(R.ellipsoid=u.ellipsoid,R.positions=s,R.granularity=T.getValueOrUndefined(i._granularity,e),R.height=f.extractHeights(s,u.ellipsoid),s=f.generateCartesianArc(R)),o.show=!0,o.positions=s.slice(),o.material=S.getValue(e,t.fillMaterialProperty,o.material),o.width=T.getValueOrDefault(i._width,e,1),o.distanceDisplayCondition=T.getValueOrUndefined(i._distanceDisplayCondition,e,o.distanceDisplayCondition)},P.prototype.getBoundingSphere=function(t,r){var i=this._line;return i.show&&i.positions.length>0?(e.fromPoints(i.positions,r),b.DONE):b.FAILED},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,r=A[t];r.remove(this._line),0===r.length&&(this._primitives.removeAndDestroy(r),delete A[t]),a(this)},x}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(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 E(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(E.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 T(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 T(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),O=new b(e.BLACK),M=new b(_.DISABLED),R=new b(new s),L=new e;return n(E,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),n(E.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),E.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},E.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},E.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new f(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new h(this._options),attributes:n})},E.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new p(this._options),attributes:{show:new f(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){this._entitySubscription(),o(this)},E.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.shape,f=a.show;if(!i(h)||!i(p)||i(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=r(a.material,P),_=v instanceof y;this._materialProperty=v,this._fillProperty=r(s,D),this._showProperty=r(f,A),this._showOutlineProperty=r(a.outline,I),this._outlineColorProperty=c?r(a.outlineColor,O):void 0,this._shadowsProperty=r(a.shadows,M),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R);var b=a.granularity,C=a.outlineWidth,w=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&p.isConstant&&S.isConstant(b)&&S.isConstant(C)&&S.isConstant(w)){var T=this._options;T.vertexFormat=_?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,T.polylinePositions=h.getValue(d.MINIMUM_VALUE,T.polylinePositions),T.shapePositions=p.getValue(d.MINIMUM_VALUE,T.shape),T.granularity=i(b)?b.getValue(d.MINIMUM_VALUE):void 0,T.cornerType=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=i(C)?C.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},E.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(r){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(r)&&S.getValueOrDefault(s.show,r,!0)){var l=this._options,u=S.getValueOrUndefined(s.positions,r,l.polylinePositions),d=S.getValueOrUndefined(s.shape,r);if(i(u)&&i(d)){l.polylinePositions=u,l.shapePositions=d,l.granularity=S.getValueOrUndefined(s.granularity,r),l.cornerType=S.getValueOrUndefined(s.cornerType,r);var f=this._geometryUpdater.shadowsProperty.getValue(r);if(!i(s.fill)||s.fill.getValue(r)){var _=w.getValue(r,o.fillMaterialProperty,this._material);this._material=_;var y=new m({material:_,translucent:_.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new v({geometryInstances:new c({id:a,geometry:new h(l)}),appearance:y,asynchronous:!1,shadows:f}))}if(i(s.outline)&&s.outline.getValue(r)){l.vertexFormat=g.VERTEX_FORMAT;var b=S.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,L),C=S.getValueOrDefault(s.outlineWidth,r,1),T=1!==b.alpha;this._outlinePrimitive=n.add(new v({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(b)}}),appearance:new g({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:f}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},E}),define("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),O=new w(!0),M=new w(!1),R=new w(e.BLACK),L=new w(b.DISABLED),N=new w(new s),k=new e;return n(P,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),n(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&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||!i(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 this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new m(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof C){var f=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(r)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new p(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=E.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new f(this._options),attributes:{show:new m(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),o(this)},P.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,f=a.show;if(i(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE)||!i(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=r(a.material,D),y=m instanceof C;this._materialProperty=m,this._fillProperty=r(s,O),this._showProperty=r(f,I),this._showOutlineProperty=r(a.outline,M),this._outlineColorProperty=c?r(a.outlineColor,R):void 0,this._shadowsProperty=r(a.shadows,L),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,N);var b=a.height,w=a.extrudedHeight,S=a.granularity,T=a.stRotation,x=a.rotation,P=a.outlineWidth,A=a.closeBottom,k=a.closeTop,F=l&&!i(b)&&!i(w)&&y&&g.isSupported(this._scene);if(c&&F&&(h(h.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&E.isConstant(b)&&E.isConstant(w)&&E.isConstant(S)&&E.isConstant(T)&&E.isConstant(x)&&E.isConstant(P)&&E.isConstant(A)&&E.isConstant(k)&&(!F||E.isConstant(m))){var B=this._options;B.vertexFormat=y?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,B.rectangle=p.getValue(d.MINIMUM_VALUE,B.rectangle),B.height=i(b)?b.getValue(d.MINIMUM_VALUE):void 0,B.extrudedHeight=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,B.granularity=i(S)?S.getValue(d.MINIMUM_VALUE):void 0,B.stRotation=i(T)?T.getValue(d.MINIMUM_VALUE):void 0,B.rotation=i(x)?x.getValue(d.MINIMUM_VALUE):void 0,B.closeBottom=i(A)?A.getValue(d.MINIMUM_VALUE):void 0,B.closeTop=i(k)?k.getValue(d.MINIMUM_VALUE):void 0,this._isClosed=i(w)&&i(B.closeTop)&&i(B.closeBottom)&&B.closeTop&&B.closeBottom,this._outlineWidth=i(P)?P.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(r)&&E.getValueOrDefault(u.show,r,!0)){var d=this._options,h=E.getValueOrUndefined(u.coordinates,r,d.rectangle);if(i(h)){d.rectangle=h,d.height=E.getValueOrUndefined(u.height,r),d.extrudedHeight=E.getValueOrUndefined(u.extrudedHeight,r),d.granularity=E.getValueOrUndefined(u.granularity,r),d.stRotation=E.getValueOrUndefined(u.stRotation,r),d.rotation=E.getValueOrUndefined(u.rotation,r),d.closeBottom=E.getValueOrUndefined(u.closeBottom,r),d.closeTop=E.getValueOrUndefined(u.closeTop,r);var m=this._geometryUpdater.shadowsProperty.getValue(r);if(E.getValueOrDefault(u.fill,r,!0)){var b=n.fillMaterialProperty,C=T.getValue(r,b,this._material);if(this._material=C,o){var w=e.WHITE;i(b.color)&&(w=b.color.getValue(r)),this._primitive=s.add(new g({geometryInstances:new c({id:l,geometry:new p(d),attributes:{color:t.fromColor(w)}}),asynchronous:!1,shadows:m}))}else{var S=new v({material:C,translucent:C.isTranslucent(),closed:i(d.extrudedHeight)});d.vertexFormat=S.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(d)}),appearance:S,asynchronous:!1,shadows:m}))}}if(!o&&E.getValueOrDefault(u.outline,r,!1)){d.vertexFormat=_.VERTEX_FORMAT;var x=E.getValueOrClonedDefault(u.outlineColor,r,e.BLACK,k),P=E.getValueOrDefault(u.outlineWidth,r,1),A=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new f(d),attributes:{color:t.fromColor(x)}}),appearance:new _({flat:!0,translucent:A,renderState:{lineWidth:n._scene.clampLineWidth(P)}}),asynchronous:!1,shadows:m}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},P}),define("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(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 E(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(E.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 T(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 T(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),O=new b(e.BLACK),M=new b(_.DISABLED),R=new b(new s),L=new e;return n(E,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),n(E.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),E.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},E.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},E.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new h(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),f=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:f,color:o}}else n={show:u,distanceDisplayCondition:f};return new c({id:a,geometry:new p(this._options),attributes:n})},E.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new f(this._options),attributes:{show:new h(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){this._entitySubscription(),o(this)},E.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.show;if(i(p)&&p.isConstant&&!p.getValue(d.MINIMUM_VALUE)||!i(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=r(a.material,P),v=f instanceof y;this._materialProperty=f,this._fillProperty=r(s,D),this._showProperty=r(p,A),this._showOutlineProperty=r(a.outline,I),this._outlineColorProperty=c?r(a.outlineColor,O):void 0,this._shadowsProperty=r(a.shadows,M),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R);var _=a.minimumHeights,b=a.maximumHeights,C=a.outlineWidth,w=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&S.isConstant(_)&&S.isConstant(b)&&S.isConstant(C)&&S.isConstant(w)){var T=this._options;T.vertexFormat=v?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,T.positions=h.getValue(d.MINIMUM_VALUE,T.positions),T.minimumHeights=i(_)?_.getValue(d.MINIMUM_VALUE,T.minimumHeights):void 0,T.maximumHeights=i(b)?b.getValue(d.MINIMUM_VALUE,T.maximumHeights):void 0,T.granularity=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=i(C)?C.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},E.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(r){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(r)&&S.getValueOrDefault(s.show,r,!0)){var l=this._options,u=S.getValueOrUndefined(s.positions,r,l.positions);if(i(u)){l.positions=u,l.minimumHeights=S.getValueOrUndefined(s.minimumHeights,r,l.minimumHeights),l.maximumHeights=S.getValueOrUndefined(s.maximumHeights,r,l.maximumHeights),l.granularity=S.getValueOrUndefined(s.granularity,r);var d=this._geometryUpdater.shadowsProperty.getValue(r);if(S.getValueOrDefault(s.fill,r,!0)){var h=w.getValue(r,o.fillMaterialProperty,this._material);this._material=h;var _=new m({material:h,translucent:h.isTranslucent(),closed:i(l.extrudedHeight)});l.vertexFormat=_.vertexFormat,this._primitive=n.add(new v({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:_,asynchronous:!1,shadows:d}))}if(S.getValueOrDefault(s.outline,r,!1)){l.vertexFormat=g.VERTEX_FORMAT;var y=S.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,L),b=S.getValueOrDefault(s.outlineWidth,r,1),C=1!==y.alpha;this._outlinePrimitive=n.add(new v({geometryInstances:new c({id:a,geometry:new f(l),attributes:{color:t.fromColor(y)}}),appearance:new g({flat:!0,translucent:C,renderState:{lineWidth:o._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:d}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},E}),define("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x){"use strict";function P(e){l.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new s,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=r(e.visualizersCallback,P.defaultVisualizersCallback);for(var n=0,o=i.length;nx*p.maximumRadius?(A=b,e.normalize(P,A),e.negate(A,A),I=e.clone(e.UNIT_Z,C),D=e.cross(I,A,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(A,A),e.normalize(D,D),I=e.cross(A,D,C),e.normalize(I,I),O=!0)):e.equalsEpsilon(P,R,l.EPSILON7)||(I=b,e.normalize(F,I),e.normalize(B,B),D=e.cross(I,B,C),M&&(D=e.multiplyByScalar(D,-1,D)),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(A=e.cross(D,I,y),u.multiplyByVector(L,A,A),u.multiplyByVector(L,D,D),u.multiplyByVector(L,I,I),e.normalize(A,A),e.normalize(D,D),e.normalize(I,I),O=!0))}}r(t.boundingSphere)&&(P=t.boundingSphere.center);var G,H,W;o&&(G=e.clone(i.position,w),H=e.clone(i.direction,S),W=e.clone(i.up,T));var j=_;O?(j[0]=A.x,j[1]=A.y,j[2]=A.z,j[3]=0,j[4]=D.x,j[5]=D.y,j[6]=D.z,j[7]=0,j[8]=I.x,j[9]=I.y,j[10]=I.z,j[11]=0,j[12]=P.x,j[13]=P.y,j[14]=P.z,j[15]=0):d.eastNorthUpToFixedFrame(P,p,j),i._setTransform(j),o&&(e.clone(G,i.position),e.clone(H,i.direction),e.clone(W,i.up),e.cross(H,W,i.right))}if(n){var q=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;i.lookAtTransform(i.transform,q)}}function f(r,i,n){this.entity=r,this.scene=i,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var m=new u,g=new u,v=new u,_=new c,y=new e,b=new e,C=new e,w=new e,S=new e,T=new e,E=new s,x=1.25;i(f,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),f.defaultOffset3D=new e(-14e3,3500,3500);var P=new a,A=new e;return f.prototype.update=function(t,i){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==h.MORPHING){var u=o.position,c=o!==this._lastEntity,d=s!==this._mode,m=this._offset3D,g=n.camera,v=c||d,_=!0;if(c){var y=o.viewFrom,b=r(y);if(!b&&r(i)){P.pitch=-l.PI_OVER_FOUR,P.range=0;var C=u.getValue(t,A);if(r(C)){var w=2-1/Math.max(1,e.magnitude(C)/a.maximumRadius);P.pitch*=w}g.viewBoundingSphere(i,P),this.boundingSphere=i,v=!1,_=!1}else b&&r(y.getValue(t,m))||e.clone(f._defaultOffset3D,m)}else d||n.mode===h.MORPHING||this._mode===h.SCENE2D||e.clone(g.position,m);this._lastEntity=o,this._mode=n.mode!==h.MORPHING?n.mode:this._mode,n.mode!==h.MORPHING&&p(this,g,v,_,u,t,a)}},f}),function(){function e(e,t){function r(t){var r,i=e.arcs[t<0?~t:t],n=i[0];return e.transform?(r=[0,0],i.forEach(function(e){r[0]+=e[0],r[1]+=e[1]})):r=i[i.length-1],t<0?[r,n]:[n,r]}function i(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),s.push(i)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(r,i){var n,o=e.arcs[r<0?~r:r];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=r,t[i]=n)}),t.forEach(function(e){var t,i,n=r(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,i=o[l]){delete o[i.start];var u=i===t?t:t.concat(i);o[u.start=t.start]=a[u.end=i.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,i=a[s]){delete a[i.end];var c=i===t?t:i.concat(t);o[c.start=i.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),i(a,o),i(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,r,i){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in d&&(u=e,d[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],d={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(r),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var h=0,p=t.arcs.length;h0}var s={},l=[],u=[];return r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var a,l=o(r[0][0]),u=0;u>>1;e[n]0;){var r=(t+1>>1)-1,n=i[r];if(p(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(o0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(p(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function m(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=(e[0]-o)/i|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-r,t=l,r=u}}function v(){}var _={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,r.apply(this,arguments))},mergeArcs:r,feature:i,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",_):"object"==typeof module&&module.exports?module.exports=_:this.topojson=_}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P){"use strict";function A(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var r="";for(var i in e)if(e.hasOwnProperty(i)){if(i===t||-1!==ae.indexOf(i))continue;var o=e[i];n(o)&&(r+="object"==typeof o?""+i+""+D(o)+"":""+i+""+o+"")}return r.length>0&&(r=''+r+"
"),r}function I(e,t,r){var i;return function(o,a){return n(i)||(i=e(t,r)),i}}function O(e,t){return new _(I(D,e,t),!0)}function M(e,t,i){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=r();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.properties=u;var c,d=u.title;if(n(d))l.name=d,c="title";else{var h=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var f=p.toLowerCase();if(h>1&&"title"===f){h=1,c=p;break}h>2&&"name"===f?(h=2,c=p):h>3&&/title/i.test(p)?(h=3,c=p):h>4&&/name/i.test(p)&&(h=4,c=p)}n(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=n(m)?new C(m):i(u,c))}return l}function R(e,t){for(var r=new Array(e.length),i=0;i2?_.perPositionHeight=new C(!0):a.clampToGround||(_.height=0);M(r,e._entityCollection,a.describe).polygon=_}}function W(e,t,r,i,n){H(e,t,i,r.coordinates,n)}function j(e,t,r,i,n){for(var o=r.coordinates,a=0;at&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){return new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())})},createAttrs:function(e,t){var r={href:t},i=this.createCssClass(e);return i&&(r.class=i),this.newWindow&&(r.target="_blank"),r},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,r=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,i=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=r.source+"(?:\\s*=\\s*"+i.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",i.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,r,i=this.htmlRegex,n=0,o=[];null!==(t=i.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n>>8^n[255&(e^r[i])]},t.get=function(){return~e}}function n(e,t,r){return e.slice?e.slice(t,t+r):e.webkitSlice?e.webkitSlice(t,t+r):e.mozSlice?e.mozSlice(t,t+r):e.msSlice?e.msSlice(t,t+r):void 0}function o(e,t){var r,i;return r=new ArrayBuffer(e),i=new Uint8Array(r),t&&i.set(t,0),{buffer:r,array:i,view:new DataView(r)}}function a(){}function s(e){function t(t,r){var o=new Blob([e],{type:V});i=new u(o),i.init(function(){n.size=i.size,t()},r)}function r(e,t,r,n){i.readUint8Array(e,t,r,n)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function l(e){function t(t){for(var r=e.length;"="==e.charAt(r-1);)r--;i=e.indexOf(",")+1,n.size=Math.floor(.75*(r-i)),t()}function r(t,r,n){var a,s=o(r),l=4*Math.floor(t/3),u=4*Math.ceil((t+r)/3),c=window.atob(e.substring(l+i,u+i)),d=t-3*Math.floor(l/4);for(a=d;a2?o+=window.btoa(n):a=n,t()}function i(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=r,n.getData=i}function p(e){function t(t){n=new Blob([],{type:e}),t()}function r(t,r){n=new Blob([n,A?t:t.buffer],{type:e}),r()}function i(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function f(e,t,r,i,n,o,a,s,l,u){function c(){e.removeEventListener(z,d,!1),s(f)}function d(e){var t=e.data,i=t.data;t.onappend&&(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),h()},u)),t.onflush&&(i?(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p127?n[r-128]:String.fromCharCode(r);return i}function b(e){return decodeURIComponent(escape(e))}function C(e){var t,r="";for(t=0;t>16,r=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&r)>>11,(2016&r)>>5,2*(31&r),0)}catch(e){}}function S(e,t,r,i,n){return e.version=t.view.getUint16(r,!0),e.bitFlag=t.view.getUint16(r+2,!0),e.compressionMethod=t.view.getUint16(r+4,!0),e.lastModDateRaw=t.view.getUint32(r+6,!0),e.lastModDate=w(e.lastModDateRaw),1==(1&e.bitFlag)?void n(I):((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(r+10,!0),e.compressedSize=t.view.getUint32(r+14,!0),e.uncompressedSize=t.view.getUint32(r+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(O):(e.filenameLength=t.view.getUint16(r+22,!0),void(e.extraFieldLength=t.view.getUint16(r+24,!0))))}function T(e,t){function r(){}function i(r,n){e.readUint8Array(e.size-r,r,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?i(r+1,n):n(t)},function(){t(M)})}return r.prototype.getData=function(r,i,n,a){function s(e,t){h&&h.terminate(),h=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():r.getData(function(e){s(i,e)})}function c(){s(t,N)}function d(){s(t,L)}var h,p=this;e.readUint8Array(p.offset,30,function(i){var s,l=o(i.length,i);if(1347093252!=l.view.getUint32(0))return void t(D);S(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,r.init(function(){0===p.compressionMethod?_(e,r,s,p.compressedSize,a,u,n,c,d):h=g(e,r,s,p.compressedSize,a,u,n,c,d)},d)},c)},{getEntries:function(n){if(e.size<22)return void t(D);i(22,function(i){var a,s;a=i.getUint32(16,!0),s=i.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var i,a,l,u,c=0,d=[],h=o(e.length,e);for(i=0;i>>1^3988292384:r>>>=1;i[e]=r}return i}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,r.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,r){e.init(function(){t(T(e,r))},r)},createWriter:function(e,t,r,i){e.init(function(){t(P(e,r,i))},r)},useWebWorkers:!0};var G;t(r.zip,{workerScriptsPath:{get:function(){return void 0===G&&(G=e("ThirdParty/Workers/")),G}}})}(r),r.zip}),define("DataSources/KmlLookAt",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRange=t}return e}),define("DataSources/KmlTour",["../Core/Event","../Core/defined"],function(e,t){"use strict";function r(t,r){this.id=r,this.name=t,this.playlistIndex=0,this.playlist=[],this.tourStart=new e,this.tourEnd=new e,this.entryStart=new e,this.entryEnd=new e,this._activeEntries=[]}function i(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function n(e,r,i){var n=this.playlist[this.playlistIndex];if(n){var a=o.bind(this,e,r,i);if(this._activeEntries.push(n),this.entryStart.raiseEvent(n),n.blocking)n.play(a,e.scene.camera,r);else{var s=this;n.play(function(){s.entryEnd.raiseEvent(n);var e=s._activeEntries.indexOf(n);e>=0&&s._activeEntries.splice(e,1)}),a(e,r,i)}}else t(i)&&i(!1)}function o(e,t,r,i){var o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)r(i);else{var a=this._activeEntries.indexOf(o);a>=0&&this._activeEntries.splice(a,1),this.playlistIndex++,n.call(this,e,t,r)}}return r.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},r.prototype.play=function(e,t){this.tourStart.raiseEvent();var r=this;n.call(this,e,t,function(e){r.playlistIndex=0,e||i(r._activeEntries),r.tourEnd.raiseEvent(e)})},r.prototype.stop=function(){i(this._activeEntries)},r}),define("DataSources/KmlTourFlyTo",["../Core/defined","../Core/combine","../Core/BoundingSphere","../Core/EasingFunction"],function(e,t,r,i){"use strict";function n(e,t,r){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=r,this.flyToMode=t}return n.prototype.play=function(t,i,n){if(this.activeCamera=i,e(t)&&null!==t){var o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,t(!e(r)&&r)}}var a=this.getCameraOptions(n);if(this.view.headingPitchRoll)i.flyTo(a);else if(this.view.headingPitchRange){var s=new r(this.view.position);i.flyToBoundingSphere(s,a)}},n.prototype.stop=function(){e(this.activeCamera)&&this.activeCamera.cancelFlight(),e(this.activeCallback)&&this.activeCallback(!0)},n.prototype.getCameraOptions=function(r){var n={duration:this.duration};return e(this.activeCallback)&&(n.complete=this.activeCallback),"smooth"===this.flyToMode&&(n.easingFunction=i.LINEAR_NONE),this.view.headingPitchRoll?(n.destination=this.view.position,n.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(n.offset=this.view.headingPitchRange),e(r)&&(n=t(n,r)),n},n}),define("DataSources/KmlTourWait",["../Core/defined"],function(e){"use strict";function t(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}return t.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},t.prototype.stop=function(){clearTimeout(this.timeout),e(this.activeCallback)&&this.activeCallback(!0)},t}),define("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/objectToQuery","../Core/oneTimeWarning","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Core/HeadingPitchRoll","../Core/HeadingPitchRange","../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","./KmlLookAt","./KmlCamera","./KmlTour","./KmlTourFlyTo","./KmlTourWait"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he){"use strict";function pe(e){var t=e.slice(0,Math.min(4,e.size)),r=z.defer(),i=new FileReader;return i.addEventListener("load",function(){r.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){r.reject(i.error)}),i.readAsArrayBuffer(t),r.promise}function fe(e){var t=z.defer(),r=new FileReader;return r.addEventListener("load",function(){t.resolve(r.result)}),r.addEventListener("error",function(){t.reject(r.error)}),r.readAsText(e),t.promise}function me(e){var t,r,i,n,o={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(var a in o)o.hasOwnProperty(a)&&(i=RegExp("[< ]"+a+":"),n="xmlns:"+a+"=",i.test(e)&&-1===e.indexOf(n)&&(c(t)||(t=e.substr(0,e.indexOf("0?jt.maximumRed=o:jt.red=0,n>0?jt.maximumGreen=n:jt.green=0,i>0?jt.maximumBlue=i:jt.blue=0,jt.alpha=r,s.fromRandom(jt)):new s(o,n,i,r)}}function Ne(e,t,r){var i=Oe(e,t,r);if(c(i))return Le(i,"random"===Oe(e,"colorMode",r))}function ke(e){var t=Pe(e,"TimeStamp",Wt.kmlgx),r=Oe(t,"when",Wt.kmlgx);if(c(t)&&c(r)&&0!==r.length){var i=b.fromIso8601(r),n=new M;return n.addInterval(new O({start:i,stop:_.MAXIMUM_VALUE})),n}}function Fe(e){var t=Pe(e,"TimeSpan",Wt.kmlgx);if(c(t)){var r,i=Pe(t,"begin",Wt.kmlgx),n=c(i)?b.fromIso8601(i.textContent):void 0,o=Pe(t,"end",Wt.kmlgx),a=c(o)?b.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(b.lessThan(a,n)){var s=n;n=a,a=s}r=new M,r.addInterval(new O({start:n,stop:a}))}else c(n)?(r=new M,r.addInterval(new O({start:n,stop:_.MAXIMUM_VALUE}))):c(a)&&(r=new M,r.addInterval(new O({start:_.MINIMUM_VALUE,stop:a})));return r}}function Be(){var e=new H;return e.width=kt,e.height=kt,e.scaleByDistance=new T(Ft,Bt,Ut,Vt),e.pixelOffsetScaleByDistance=new T(Ft,Bt,Ut,Vt),e}function Ue(){var e=new $;return e.outline=!0,e.outlineColor=s.WHITE,e}function Ve(){var e=new K;return e.translucencyByDistance=new T(3e6,1,5e6,0),e.pixelOffset=new r(17,0),e.horizontalOrigin=k.LEFT,e.font="16px sans-serif",e.style=F.FILL_AND_OUTLINE,e}function ze(e,t,r,i,n,o){var a=Oe(e,"href",Wt.kml);if(c(a)&&0!==a.length){if(0===a.indexOf("root://icons/palette-")){var s=a.charAt(21),l=u(Ie(e,"x",Wt.gx),0),d=u(Ie(e,"y",Wt.gx),0);l=Math.min(l/32,7),d=7-Math.min(d/32,7);a="https://maps.google.com/mapfiles/kml/pal"+s+"/icon"+(8*d+l)+".png"}if(a=Re(a,t._proxy,r,i,o),n){var h=Oe(e,"refreshMode",Wt.kml),p=Oe(e,"viewRefreshMode",Wt.kml);"onInterval"===h||"onExpire"===h?x("kml-refreshMode-"+h,"KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||x("kml-refreshMode-"+p,"KML - Unsupported Icon viewRefreshMode: "+p);var f=u(Oe(e,"viewBoundScale",Wt.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",g=u(Oe(e,"viewFormat",Wt.kml),m),v=Oe(e,"httpQuery",Wt.kml),_=wt(g,v),b=y(a,_,!1);return St(t._camera,t._canvas,b,f,t._lastCameraView.bbox)}return a}}function Ge(e,n,o,a,s,l){var d=Ie(n,"scale",Wt.kml),h=Ie(n,"heading",Wt.kml),p=Ne(n,"color",Wt.kml),f=Pe(n,"Icon",Wt.kml),m=ze(f,e,a,s,!1,l);c(f)&&!c(m)&&(m=!1);var g=Ie(f,"x",Wt.gx),v=Ie(f,"y",Wt.gx),_=Ie(f,"w",Wt.gx),y=Ie(f,"h",Wt.gx),b=Pe(n,"hotSpot",Wt.kml),C=Ee(b,"x"),w=Ee(b,"y"),T=xe(b,"xunits"),E=xe(b,"yunits"),x=o.billboard;c(x)||(x=Be(),o.billboard=x),x.image=m,x.scale=d,x.color=p,(c(g)||c(v)||c(_)||c(y))&&(x.imageSubRegion=new t(g,v,_,y)),c(h)&&0!==h&&(x.rotation=S.toRadians(-h),x.alignedAxis=i.UNIT_Z),d=u(d,1);var P,A;c(C)&&("pixels"===T?P=-C*d:"insetPixels"===T?P=(C-kt)*d:"fraction"===T&&(P=-C*kt*d),P+=.5*kt*d),c(w)&&("pixels"===E?A=w*d:"insetPixels"===E?A=(-w+kt)*d:"fraction"===E&&(A=w*kt*d),A-=.5*kt*d),(c(P)||c(A))&&(x.pixelOffset=new r(P,A))}function He(e,t,r,i,n,o){for(var a=0,l=t.childNodes.length;a:clampToSeaFloor is currently not supported, using :clampToGround."),N.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(x("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),N.RELATIVE_TO_GROUND):(c(e)?x("kml-altitudeMode-unknown","KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):x("kml-gx:altitudeMode-unknown","KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),N.CLAMP_TO_GROUND)}function Qe(e,t,r){return"relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&x("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u(t,r)),new oe(e))}function Ze(e,t,r){if(c(e)){if("relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&x("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u(t,r));for(var i=e.length,n=0;n0&&x("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var h=Math.min(s.length,u.length),p=[],f=[],m=0;m0&&i.availability.addInterval(new O({start:f[0],stop:f[f.length-1]})),d&&c&&Ye(t,i,n),!0}function it(e,t,r,i,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new ne;d.addSamples(e,t),r.intervals.addInterval(new O({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Qe(d,a,s)})),i.addInterval(new O({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new O({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function nt(e,t,r,i,n){for(var o,a,s,l=Me(r,"interpolate",Wt.gx),u=De(r,"Track",Wt.gx),d=!1,h=new ae,p=new M,f=new W,m=0,g=u.length;m0)){for(_='',a=0;a";_+="
"+u(y.displayName,l)+""+u(y.value,"")+"
"}if(c(_)){_=Nt.link(_),Yt.innerHTML=_;var T=Yt.querySelectorAll("a");for(a=0;a1&&(_e(Yt,"a","href",i),_e(Yt,"img","src",i)),ye(Yt,"a","href",n,o),ye(Yt,"img","src",n,o);var E='
",Yt.innerHTML="",t.description=E}}function ut(e,t,r,i,n,o,a,s,l,d){function h(e){return!e||e.show&&h(e.parent)}var p=Ce(r,i,l),f=p.kml,m=We(p,e,r,n,o,a,d),g=Oe(r,"name",Wt.kml);p.name=g,p.parent=t;var v=Fe(r);c(v)||(v=ke(r)),p.availability=v,It(p);var _=Me(r,"visibility",Wt.kml);p.show=h(t)&&u(_,!0);var y=Pe(r,"author",Wt.atom),b=f.author;b.name=Oe(y,"name",Wt.atom),b.uri=Oe(y,"uri",Wt.atom),b.email=Oe(y,"email",Wt.atom);var C=Pe(r,"link",Wt.atom),w=f.link;return w.href=xe(C,"href"),w.hreflang=xe(C,"hreflang"),w.rel=xe(C,"rel"),w.type=xe(C,"type"),w.title=xe(C,"title"),w.length=xe(C,"length"),f.address=Oe(r,"address",Wt.kml),f.phoneNumber=Oe(r,"phoneNumber",Wt.kml),f.snippet=Oe(r,"Snippet",Wt.kml),st(r,p),lt(r,p,m,a,e._proxy,o),_t(r,p),vt(r,p),c(Pe(r,"Region",Wt.kml))&&x("kml-region","KML - Placemark Regions are unsupported"),{entity:p,styleEntity:m}}function ct(e,t,r,i,n,o,a,s,l,u){for(var c=Object.keys(Xt),d=c.length,h=0;h0||c(t)&&t.length>0)&&(r+=y(Ct(e),Ct(t),!1)),r}function St(e,t,r,n,o){function a(e){return e<-S.PI_OVER_TWO?-S.PI_OVER_TWO:e>S.PI_OVER_TWO?S.PI_OVER_TWO:e}function s(e){return e>S.PI?e-S.TWO_PI:e<-S.PI?e+S.TWO_PI:e}if(c(e)&&e._mode!==B.MORPHING){var l,d,h=p.WGS84;if(o=u(o,Kt),c(t)&&($t.x=.5*t.clientWidth,$t.y=.5*t.clientHeight,l=e.pickEllipsoid($t,h,er)),c(l)?d=h.cartesianToCartographic(l,Jt):(d=D.center(o,Jt),l=h.cartographicToCartesian(d)),c(n)&&!S.equalsEpsilon(n,1,S.EPSILON9)){var f=o.width*n*.5,m=o.height*n*.5;o=new D(s(d.longitude-f),a(d.latitude-m),s(d.longitude+f),a(d.latitude+m))}r=r.replace("[bboxWest]",S.toDegrees(o.west).toString()),r=r.replace("[bboxSouth]",S.toDegrees(o.south).toString()),r=r.replace("[bboxEast]",S.toDegrees(o.east).toString()),r=r.replace("[bboxNorth]",S.toDegrees(o.north).toString());var g=S.toDegrees(d.longitude).toString(),v=S.toDegrees(d.latitude).toString();r=r.replace("[lookatLon]",g),r=r.replace("[lookatLat]",v),r=r.replace("[lookatTilt]",S.toDegrees(e.pitch).toString()),r=r.replace("[lookatHeading]",S.toDegrees(e.heading).toString()),r=r.replace("[lookatRange]",i.distance(e.positionWC,l)),r=r.replace("[lookatTerrainLon]",g),r=r.replace("[lookatTerrainLat]",v),r=r.replace("[lookatTerrainAlt]",d.height.toString()),h.cartesianToCartographic(e.positionWC,Jt),r=r.replace("[cameraLon]",S.toDegrees(Jt.longitude).toString()),r=r.replace("[cameraLat]",S.toDegrees(Jt.latitude).toString()),r=r.replace("[cameraAlt]",S.toDegrees(Jt.height).toString());var _=e.frustum,y=_.aspectRatio,b="",C="";if(c(y)){var w=S.toDegrees(_.fov);y>1?(b=w,C=w/y):(C=w,b=w*y)}r=r.replace("[horizFov]",b.toString()),r=r.replace("[vertFov]",C.toString())}else r=r.replace("[bboxWest]","-180"),r=r.replace("[bboxSouth]","-90"),r=r.replace("[bboxEast]","180"),r=r.replace("[bboxNorth]","90"),r=r.replace("[lookatLon]",""),r=r.replace("[lookatLat]",""),r=r.replace("[lookatRange]",""),r=r.replace("[lookatTilt]",""),r=r.replace("[lookatHeading]",""),r=r.replace("[lookatTerrainLon]",""),r=r.replace("[lookatTerrainLat]",""),r=r.replace("[lookatTerrainAlt]",""),r=r.replace("[cameraLon]",""),r=r.replace("[cameraLat]",""),r=r.replace("[cameraAlt]",""),r=r.replace("[horizFov]",""),r=r.replace("[vertFov]","");return c(t)?(r=r.replace("[horizPixels]",t.clientWidth),r=r.replace("[vertPixels]",t.clientHeight)):(r=r.replace("[horizPixels]",""),r=r.replace("[vertPixels]","")),r=r.replace("[terrainEnabled]","1"),r=r.replace("[clientVersion]","1"),r=r.replace("[kmlVersion]","2.2"),r=r.replace("[clientName]","Cesium"),r=r.replace("[language]","English")}function Tt(e,t,r,i,n,o,a,s,d,h){var p=ut(e,t,r,i,n,o,a,s,d,h),f=p.entity,g=Pe(r,"Link",Wt.kml);if(c(g)||(g=Pe(r,"Url",Wt.kml)),c(g)){var v,_,C,w=Oe(g,"href",Wt.kml);if(c(w)){var S=w;w=Re(w,void 0,o,a,h);var T;if(/^data:/.test(w))T=w,/\.kmz/i.test(o)||(S=m(S,o));else{S=w,v=Oe(g,"viewRefreshMode",Wt.kml),_=u(Oe(g,"viewBoundScale",Wt.kml),1);var E="onStop"===v?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",P=u(Oe(g,"viewFormat",Wt.kml),E),A=Oe(g,"httpQuery",Wt.kml);C=wt(P,A),T=St(e._camera,e._canvas,y(w,C,!1),_,e._lastCameraView.bbox)}var D={sourceUri:S,uriResolver:a,context:f.id},I=new Z,O=At(e,I,T,D).then(function(t){var r=e._entityCollection,i=I.values;r.suspendEvents();for(var n=0;n0||"onExpire"===a||"onStop"===v){var d=Pe(t,"NetworkLinkControl",Wt.kml),h=c(d),p=b.now(),m={id:l(),href:w,cookie:"",queryString:C,lastUpdated:p,updating:!1,entity:f,viewBoundScale:_,needsUpdate:!1,cameraUpdateTime:p},y=0;if(h&&(m.cookie=u(Oe(d,"cookie",Wt.kml),""),y=u(Ie(d,"minRefreshPeriod",Wt.kml),0)),"onInterval"===a)h&&(s=Math.max(y,s)),m.refreshMode=Zt.INTERVAL,m.time=s;else if("onExpire"===a){var S;if(h&&(S=Oe(d,"expires",Wt.kml)),c(S))try{var T=b.fromIso8601(S),E=b.secondsDifference(T,p);E>0&&E0&&ve.time&&(i=!0):e.refreshMode===Zt.EXPIRE?b.greaterThan(o,e.time)&&(i=!0):e.refreshMode===Zt.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&b.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(i=!0)),i){r(t),e.updating=!0;var n=new Z,u=y(e.href,wt(e.cookie,e.queryString),!1);u=St(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),At(a,n,u,{context:t.id}).then(Ot(a,e,n,d,u)).otherwise(function(t){var r="NetworkLink "+e.href+" refresh failed: "+t;console.log(r),a._error.raiseEvent(a,r)}),h=!0}}d.set(e.id,e)}}),h&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0},Dt}),define("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}return i.ALL=r(new i({color:new e(0,0,0,0),depth:1,stencil:0})),i.prototype.execute=function(e,t){e.clear(this,t)},i}),define("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function r(r){r=e(r,e.EMPTY_OBJECT),this.vertexArray=r.vertexArray,this.fragmentShaderSource=r.fragmentShaderSource,this.shaderProgram=r.shaderProgram,this.uniformMap=r.uniformMap,this.outputTexture=r.outputTexture,this.preExecute=r.preExecute,this.postExecute=r.postExecute,this.persists=e(r.persists,!1),this.pass=t.COMPUTE,this.owner=r.owner}return r.prototype.execute=function(e){e.execute(this)},r}),define("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),define("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Check","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._context=e}function f(e,t){return new c({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function g(t,r){return i(v)&&v.viewport.width===t&&v.viewport.height===r||(v=d.fromCache({viewport:new e(0,0,t,r)})),v}var v,_=new u({primitiveType:a.TRIANGLES}),y=new l({color:new r(0,0,0,0)});return p.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=f(o,t),u=g(r,n),c=e.uniformMap,d=y;d.framebuffer=l,d.renderState=u,d.execute(o);var h=_;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return n(this)},p}),define("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),define("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===r.RGBA4||e===r.RGB5_A1||e===r.RGB565||e===r.DEPTH_COMPONENT16||e===r.STENCIL_INDEX8||e===r.DEPTH_STENCIL}};return e(r)}),define("Renderer/Renderbuffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.context,n=i._gl,o=(a.maximumRenderbufferSize,t(e.format,s.RGBA4)),l=r(e.width)?e.width:n.drawingBufferWidth,u=r(e.height)?e.height:n.drawingBufferHeight;this._gl=n,this._format=o,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,o,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(l.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),l.prototype._getRenderbuffer=function(){return this._renderbuffer},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),n(this)},l}),define("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){var r=new a(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new e},r.viewport=new e,this._context=t,this._fb=void 0,this._passState=r,this._width=0,this._height=0}c.prototype.begin=function(t){var r=this._context,n=r.drawingBufferWidth,a=r.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),i(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:r,colorTextures:[new u({context:r,width:n,height:a})],depthStencilRenderbuffer:new s({context:r,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var d=new t;return c.prototype.end=function(e){for(var n=r(e.width,1),o=r(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),h=Math.floor(.5*o),p=0,f=0,m=0,g=-1,v=0;v0&&p===1-f){var b=m;m=-g,g=b}p+=m,f+=g}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var r=t.derivedKeywords,i=r.length,n=0;nc.width?2*Math.tan(.5*u)/c.height:2*Math.tan(.5*u)/c.width,this._geometricToleranceOverMeter=o*e.maximumScreenSpaceError,a.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var X=new i,Q=new i,Z=new i,K=new i,J=new i,$=new o,ee=new i,te=new p;return _}),define("Renderer/Context",["../Core/Check","../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D){"use strict";function I(e,t){var r="WebGL Error: ";switch(t){case e.INVALID_ENUM:r+="INVALID_ENUM";break;case e.INVALID_VALUE:r+="INVALID_VALUE";break;case e.INVALID_OPERATION:r+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:r+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:r+="CONTEXT_LOST_WEBGL lost";break;default:r+="Unknown ("+t+")"}return r}function O(e,t,r,i){for(var n=I(e,i)+": "+t.name+"(",o=0;o=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._textureFloat||this._colorBufferFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},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=L(this._originalGLContext,e?M:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new P({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 b({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 H}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var j=new _;k.prototype.clear=function(e,t){e=o(e,j),t=o(t,this._defaultPassState);var i=this._gl,n=0,s=e.color,l=e.depth,u=e.stencil;a(s)&&(r.equals(this._clearColor,s)||(r.clone(s,this._clearColor),i.clearColor(s.red,s.green,s.blue,s.alpha)),n|=i.COLOR_BUFFER_BIT),a(l)&&(l!==this._clearDepth&&(this._clearDepth=l,i.clearDepth(l)),n|=i.DEPTH_BUFFER_BIT),a(u)&&(u!==this._clearStencil&&(this._clearStencil=u,i.clearStencil(u)),n|=i.STENCIL_BUFFER_BIT),B(this,o(e.renderState,this._defaultRenderState),t,!0),U(this,o(e.framebuffer,t.framebuffer)),i.clear(n)},k.prototype.draw=function(e,t){t=o(t,this._defaultPassState),V(this,o(e._framebuffer,t.framebuffer),e,t),z(this,e)},k.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 r=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var i=0;i0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}r=e(r,e.EMPTY_OBJECT),this._pixelsToCheck=r.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(r.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var r=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=i(e),a=e.width,s=0,l=r.length;s1&&"name"===o?(i=1,r=n):i>2&&"title"===o?(i=2,r=n):i>3&&/name/i.test(n)?(i=3,r=n):i>4&&/title/i.test(n)&&(i=4,r=n)}e(r)&&(this.name=t[r])},t.prototype.configureDescriptionFromProperties=function(t){function r(t){var i='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"":"")}return i+="
"+n+""+r(o)+"
"+n+""+o+"
"}this.description=r(t)},t}),define("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadImage","../Core/loadImageViaBlob","../Core/loadKTX"],function(e,t,r,i,n,o,a){"use strict";function s(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,r.throwInstantiationError()}t(s.prototype,{ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},tileWidth:{get:r.throwInstantiationError},tileHeight:{get:r.throwInstantiationError},maximumLevel:{get:r.throwInstantiationError},minimumLevel:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},tileDiscardPolicy:{get:r.throwInstantiationError},errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},proxy:{get:r.throwInstantiationError},hasAlphaChannel:{get:r.throwInstantiationError}}),s.prototype.getTileCredits=r.throwInstantiationError,s.prototype.requestImage=r.throwInstantiationError,s.prototype.pickFeatures=r.throwInstantiationError;var l=/\.ktx$/i,u=/\.crn$/i;return s.loadImage=function(t,r,s){return l.test(r)?a(r,void 0,s):u.test(r)?i(r,void 0,s):e(t.tileDiscardPolicy)?o(r,s):n(r,void 0,s)},s}), define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(r){function a(n){var a=n.tileInfo;if(o(a)){if(b._tileWidth=a.rows,b._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)b._tilingScheme=new v({ellipsoid:r.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,b,b._errorEvent,s,void 0,void 0,void 0,c))}b._tilingScheme=new u({ellipsoid:r.ellipsoid})}if(b._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new g,d=n.fullExtent,f=l.unproject(new t(Math.max(d.xmin,-b._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-b._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),_=l.unproject(new t(Math.min(d.xmax,b._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,b._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));b._rectangle=new p(f.longitude,f.latitude,_.longitude,_.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var C="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,b,b._errorEvent,C,void 0,void 0,void 0,c))}b._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else b._rectangle=b._tilingScheme.rectangle;o(b._tileDiscardPolicy)||(b._tileDiscardPolicy=new y({missingImageUrl:S(b,0,0,b._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),b._useTiles=!0}else b._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(b._credit=new i(n.copyrightText)),b._ready=!0,b._readyPromise.resolve(!0),m.handleSuccess(h)}function s(e){var t="An error occurred while accessing "+b._url+".";h=m.handleError(h,b,b._errorEvent,t,void 0,void 0,void 0,c),b._readyPromise.reject(new f(t))}function c(){var e={f:"json"};o(b._token)&&(e.token=b._token);var t=d(b._url,{parameters:e,proxy:b._proxy});_(t,a,s)}r=n(r,{}),this._url=r.url,this._token=r.token,this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._tileWidth=n(r.tileWidth,256),this._tileHeight=n(r.tileHeight,256),this._maximumLevel=r.maximumLevel,this._tilingScheme=n(r.tilingScheme,new u({ellipsoid:r.ellipsoid})),this._credit=void 0,this._useTiles=n(r.usePreCachedTilesIfAvailable,!0),this._rectangle=n(r.rectangle,this._tilingScheme.rectangle),this._layers=r.layers,this.enablePickFeatures=n(r.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=_.defer();var h,b=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function S(e,t,r,i){var n;if(e._useTiles)n=e._url+"/tile/"+i+"/"+r+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,r,i),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,e._tilingScheme instanceof u?n+="&bboxSR=4326&imageSR=4326":n+="&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)&&(-1===n.indexOf("?")&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(w.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),w.prototype.getTileCredits=function(e,t,r){},w.prototype.requestImage=function(e,t,r,i){var n=S(this,e,t,r);return C.loadImage(this,n,i)},w.prototype.pickFeatures=function(e,i,n,a,s){if(this.enablePickFeatures){var l,d,p,f=this._tilingScheme.tileXYToNativeRectangle(e,i,n);if(this._tilingScheme instanceof u)l=h.toDegrees(a),d=h.toDegrees(s),p="4326";else{var m=this._tilingScheme.projection.project(new r(a,s,0));l=m.x,d=m.y,p="3857"}var v=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return v+="&geometry="+l+","+d,v+="&mapExtent="+f.west+","+f.south+","+f.east+","+f.north,v+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",v+="&sr="+p,v+="&layers=visible",o(this._layers)&&(v+=":"+this._layers),o(this._token)&&(v+="&token="+this._token),o(this._proxy)&&(v=this._proxy.getURL(v)),c(v).then(function(e){var i=[],n=e.results;if(!o(n))return i;for(var a=0;a0){var d=Math.min(i,g.maximumTextureSize),h=Math.ceil(i/g.maximumTextureSize),p=1/d,f=.5*p,m=1/h,v=.5*m;l=new t(d,h),c=new r(p,f,m,v)}this._textureDimensions=l,this._textureStep=c}function L(t,r){var i,n,o,c=t.instancesLength,d=t.classes,h=t.classIds,p=t.parentCounts,f=t.parentIds,m=c;u(h.byteOffset)&&(h.componentType=l(h.componentType,s.UNSIGNED_SHORT),h.type=x.SCALAR,o=I(h),h=o.createArrayBufferView(r.buffer,r.byteOffset+h.byteOffset,c));var g;if(u(p))for(u(p.byteOffset)&&(p.componentType=l(p.componentType,s.UNSIGNED_SHORT),p.type=x.SCALAR,o=I(p),p=o.createArrayBufferView(r.buffer,r.byteOffset+p.byteOffset,c)),g=new Uint16Array(c),m=0,i=0;i0;)if(t=d.pop(),l[t]!==c){l[t]=c;var h=r(e,t);if(u(h))return h;for(var p=n[t],f=a[t],m=0;m0){for(var i=e._pickIds,n=N(e),a=new Uint8Array(n),s=e._content,l=0;l0?(n="uniform sampler2D tile_batchTexture; \nuniform bool tile_translucentCommand; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n vec2 st = computeSt("+t+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n",e&&(n+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),n+=" tile_featureColor = featureProperties; \n}"):n="varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n tile_featureSt = computeSt("+t+"); \n}",o+"\n"+Y(r)+n}}},R.prototype.getFragmentShaderCallback=function(e,t){if(0!==this.featuresLength)return function(r){return r=Q(r,t),g.maximumVertexTextureImageUnits>0?r+="varying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n}":(r+="uniform sampler2D tile_batchTexture; \nuniform bool tile_translucentCommand; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",e&&(r+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),r+=" tile_color(featureProperties); \n} \n"),r}},R.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){return a(t,{tile_batchTexture:function(){return l(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_colorBlend:function(){return Z(e)}})}}},R.prototype.getPickVertexShaderCallback=function(e){if(0!==this.featuresLength){var t=this;return function(r){var i,n=w.replaceMain(r,"tile_main");return i=g.maximumVertexTextureImageUnits>0?"uniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec2 st = computeSt("+e+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n tile_featureSt = st; \n}":"varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n tile_featureSt = computeSt("+e+"); \n}",n+"\n"+Y(t)+i}}},R.prototype.getPickFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){var t,r=w.replaceMain(e,"tile_main");return t=g.maximumVertexTextureImageUnits>0?"uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = texture2D(tile_pickTexture, tile_featureSt); \n}":"uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n tile_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = texture2D(tile_pickTexture, tile_featureSt); \n}",r+"\n"+t}},R.prototype.getPickUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){return a({tile_batchTexture:function(){return l(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_pickTexture:function(){return e._pickTexture}},t)}}};var pe={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return R.prototype.addDerivedCommands=function(e,t,r){for(var i=e.commandList,n=i.length,o=this._content._tile,a=o._tileset,s=a.skipLevelOfDetail&&a._hasMixedContent&&e.context.stencilBuffer,l=J(this),c=t;c=570425344?(i-=2*P,I=E,A=x,D=0,E=0,x=0,b._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Batched3DModel/README.md.")):D>=570425344&&(i-=P,I=A,A=E,D=x,E=0,x=0,b._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Batched3DModel/README.md."));var O;if(0===E)O={BATCH_LENGTH:r(I,0)};else{var M=d(l,i,E);O=JSON.parse(M),i+=E}var R=new Uint8Array(t,i,x);i+=x;var L=new v(O,R);I=L.getGlobalProperty("BATCH_LENGTH"),L.featuresLength=I;var N,k;if(A>0){var F=d(l,i,A);N=JSON.parse(F),i+=A,D>0&&(k=new Uint8Array(t,i,D),k=new Uint8Array(k),i+=D)}var B=new m(e,I,N,k);e._batchTable=B;var U=s+C-i;if(0===U)throw new p("glTF byte length must be greater than 0.");var V;i%4==0?V=new Uint8Array(t,i,U):(b._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),V=new Uint8Array(l.subarray(i,i+U)));var z={content:e,primitive:n};e._model=new y({gltf:V,cull:!1,releaseGltfJson:!0,opaquePass:f.CESIUM_3D_TILE,basePath:a,requestType:h.TILES3D,modelMatrix:o.computedTransform,upAxis:n._gltfUpAxis,shadows:n.shadows,debugWireframe:n.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:w(e),fragmentShaderLoaded:T(e),uniformMapLoaded:B.getUniformMapCallback(),pickVertexShaderLoaded:S(e),pickFragmentShaderLoaded:B.getPickFragmentShaderCallback(),pickUniformMapLoaded:B.getPickUniformMapCallback(),addBatchIdToGeneratedShaders:I>0,pickObject:z})}function x(e){var t=e._tileset,r=e.featuresLength;if(!i(e._features)&&r>0){for(var n=new Array(r),o=0;o=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(r,p.bbox,w);n(f)&&(u=!0)}}u&&i.push(s.credit)}return i}o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var C=new c;_.prototype.getTileCredits=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(e,t,r,C),o=b(this._attributionList,r,i);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},_.prototype.requestImage=function(e,t,r,i){var n=y(this,e,t,r);return v.loadImage(this,n,i)},_.prototype.pickFeatures=function(e,t,r,i,n){},_._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",_.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<=0;--n){var o=1< 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(1.0 - v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n"}),define("Scene/BrdfLutGenerator",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/BrdfLutGeneratorFS"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function _(t,r){var i=t._framebuffer,n=r.createViewportQuadCommand(g,{framebuffer:i,renderState:u.fromCache({viewport:new e(0,0,256,256)})});t._drawCommand=n}function y(e,t){var r=new h({context:t,width:256,height:256,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE,sampler:new c({wrapS:m.CLAMP_TO_EDGE,wrapT:m.CLAMP_TO_EDGE,minificationFilter:f.NEAREST,magnificationFilter:p.NEAREST})});e._colorTexture=r;var i=new a({context:t,colorTextures:[r],destroyAttachments:!1});e._framebuffer=i}return i(v.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),v.prototype.update=function(e){if(!r(this._colorTexture)){var t=e.context;y(this,t),_(this,t),this._drawCommand.execute(t),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),n(this)},v}),define("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r){var i,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof u?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function h(e,t,r,i){if(n(i)&&r(.5)>i){var o=r(0),a=r(1),l=r(.5),u=l-o,c=l-a;return function(i){var n=r(i);if(i<=.5){var l=(n-o)/u;return s.lerp(e,-s.PI_OVER_TWO,l)}var d=(n-a)/c;return s.lerp(-s.PI_OVER_TWO,t,1-d)}}return function(r){return s.lerp(e,t,r)}}function p(e,r,i,o,a){var l=a,u=Math.max(i,o);if(!n(l)){var c=e.position,h=r,p=e.up,f=e.right,m=e.frustum,g=t.subtract(c,h,S),v=t.magnitude(t.multiplyByScalar(p,t.dot(g,p),T)),_=t.magnitude(t.multiplyByScalar(f,t.dot(g,f),T));l=Math.min(.2*d(m,v,_),1e9)}if(ue+Math.PI?e+=s.TWO_PI:ts.PI&&(t.longitude+=s.TWO_PI)}function _(e,i,o,a,l,u,c,d,m,_){var y=e.camera,b=e.mapProjection,C=b.ellipsoid,w=r.clone(y.positionCartographic,x),S=y.pitch,T=f(y.heading,a),E=f(y.roll,u),A=C.cartesianToCartographic(o,P);w.longitude=s.zeroToTwoPi(w.longitude),A.longitude=s.zeroToTwoPi(A.longitude);var D=!1;if(n(d)){var I=s.zeroToTwoPi(d),O=Math.min(w.longitude,A.longitude),M=Math.max(w.longitude,A.longitude),R=I>=O&&I<=M;if(n(m)){var L=Math.abs(w.longitude-A.longitude),N=s.TWO_PI-L;(R?L:N)<(R?N:L)*m&&!R&&(D=!0)}else R||(D=!0)}D?g(w,A):v(w,A);var k=p(y,o,w.height,A.height,c),F=h(S,l,k,_);return function(){var e=w.longitude,r=A.longitude,n=w.latitude,o=A.latitude;return function(l){var c=l.time/i,d=t.fromRadians(s.lerp(e,r,c),s.lerp(n,o,c),k(c));y.setView({destination:d,orientation:{heading:s.lerp(T,a,c),pitch:F(c),roll:s.lerp(E,u,c)}})}}()}function y(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(m,o,r)}}),e.lerp(h,n,r,d.position);var a=v(r),l=d.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var d=r.camera,h=t.clone(d.position,E),m=f(d.heading,o),g=d.frustum.right-d.frustum.left,v=p(d,n,g,n.z,u);return c}function b(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function C(e,t){function r(){"function"==typeof t&&t(),e.enableInputs=!0}return r}var w={},S=new t,T=new t,E=new t,x=new r,P=new r,A=new r,D=new t;return w.createTween=function(r,o){o=i(o,i.EMPTY_OBJECT);var l=o.destination,u=r.mode;if(u===c.MORPHING)return b();var d=i(o.convert,!0),h=r.mapProjection,p=h.ellipsoid,f=o.maximumHeight,g=o.flyOverLongitude,v=o.flyOverLongitudeWeight,w=o.pitchAdjustHeight,S=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,A),l=h.project(A,D));var T=r.camera,E=o.endTransform;n(E)&&T._setTransform(E);var x=o.duration;n(x)||(x=Math.ceil(t.distance(T.position,l)/1e6)+2,x=Math.min(x,3));var P=i(o.heading,0),I=i(o.pitch,-s.PI_OVER_TWO),O=i(o.roll,0),M=r.screenSpaceCameraController;M.enableInputs=!1;var R=C(M,o.complete),L=C(M,o.cancel),N=T.frustum,k=r.mode===c.SCENE2D;if(k=k&&e.equalsEpsilon(T.position,l,s.EPSILON6),k=k&&s.equalsEpsilon(Math.max(N.right-N.left,N.top-N.bottom),l.z,s.EPSILON6),k=k||r.mode!==c.SCENE2D&&t.equalsEpsilon(l,T.position,s.EPSILON10),k=k&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(T.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(I),s.negativePiToPi(T.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(O),s.negativePiToPi(T.roll),s.EPSILON10))return b(R,L);var F=new Array(4);if(F[c.SCENE2D]=y,F[c.SCENE3D]=_,F[c.COLUMBUS_VIEW]=m,x<=0){return b(function(){F[u](r,1,l,P,I,O,f,g,v,w)({time:1}),"function"==typeof R&&R()},L)}var B=F[u](r,x,l,P,I,O,f,g,v,w);if(!n(S)){var U=T.positionCartographic.height;S=U>(u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z)&&U>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:x,easingFunction:S,startObject:{time:0},stopObject:{time:x},update:B,complete:R,cancel:L}},w}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";return e({ROTATE:0,INFINITE_SCROLL:1})}),define("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D){"use strict";function I(e){this._scene=e,this._transform=y.clone(y.IDENTITY),this._invTransform=y.clone(y.IDENTITY),this._actualTransform=y.clone(y.IDENTITY),this._actualInvTransform=y.clone(y.IDENTITY),this._transformChanged=!1,this.position=new r,this._position=new r,this._positionWC=new r,this._positionCartographic=new n,this.direction=new r,this._direction=new r,this._directionWC=new r,this.up=new r,this._up=new r,this._upWC=new r,this.right=new r,this._right=new r,this._rightWC=new r,this.frustum=new w,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new h,this._moveEnd=new h,this._changed=new h,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new y,this._invViewMatrix=new y,O(this),this._mode=D.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,v.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,Q(this,I.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=r.magnitude(this.position);i+=i*I.DEFAULT_VIEW_FACTOR,r.normalize(this.position,this.position),r.multiplyByScalar(this.position,i,this.position)}function O(e){y.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),y.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function M(e){x.basisTo2D(e._projection,e._transform,e._actualTransform)}function R(e){var t=e._projection,n=t.ellipsoid,o=y.getColumn(e._transform,3,me),a=n.cartesianToCartographic(o,he),s=t.project(a,pe),l=ge;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ye),c=i.add(y.getColumn(e._transform,0,fe),o,fe);n.cartesianToCartographic(c,a),t.project(a,s);var d=ve;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,r.subtract(d,l,d),d.x=0;var h=_e;if(r.magnitudeSquared(d)>v.EPSILON10)r.cross(u,d,h);else{var p=i.add(y.getColumn(e._transform,1,fe),o,fe);n.cartesianToCartographic(p,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,r.subtract(h,l,h),h.x=0,r.magnitudeSquared(h)v.EPSILON2){var _=1/r.magnitudeSquared(u),b=r.dot(u,s)*_,C=r.multiplyByScalar(s,b,be);u=r.normalize(r.subtract(u,C,e._up),e._up),r.clone(u,e.up),d=r.cross(s,u,e._right),r.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC),r.normalize(e._directionWC,e._directionWC)),(c||p)&&(e._upWC=y.multiplyByPointAsVector(f,u,e._upWC),r.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=y.multiplyByPointAsVector(f,d,e._rightWC),r.normalize(e._rightWC,e._rightWC)),(a||l||c||h||p)&&O(e)}function N(e,t){var r;return r=v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)?Math.atan2(t.y,t.x)-v.PI_OVER_TWO:Math.atan2(e.y,e.x)-v.PI_OVER_TWO,v.TWO_PI-v.zeroToTwoPi(r)}function k(e){return v.PI_OVER_TWO-v.acosClamped(e.z)}function F(e,t,r){var i=0;return v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)||(i=Math.atan2(-r.z,t.z),i=v.zeroToTwoPi(i+v.TWO_PI)),i}function B(e,t,i){var n=y.clone(e.transform,Oe),o=x.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Me);e._setTransform(o),r.clone(r.ZERO,e.position),i.heading=i.heading-v.PI_OVER_TWO;var a=S.fromHeadingPitchRoll(i,Re),s=_.fromQuaternion(a,Le);_.getColumn(s,0,e.direction),_.getColumn(s,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function U(e,t,i,n){var o=y.clone(e.transform,Oe);if(e._setTransform(y.IDENTITY),!r.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,Ne);t=a.project(s,Ie)}r.clone(t,e.position)}i.heading=i.heading-v.PI_OVER_TWO;var l=S.fromHeadingPitchRoll(i,Re),u=_.fromQuaternion(l,Le);_.getColumn(u,0,e.direction),_.getColumn(u,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function V(e,i,n,o){var a=y.clone(e.transform,Oe);if(e._setTransform(y.IDENTITY),!r.equals(i,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(i,Ne);i=s.project(l,Ie)}t.clone(i,e.position);var u=.5*-i.z,c=-u,d=e.frustum;if(c>u){var h=d.top/d.right;d.right=c,d.left=u,d.top=d.right*h,d.bottom=-d.top}}if(e._scene.mapMode2D===A.ROTATE){n.heading=n.heading-v.PI_OVER_TWO,n.pitch=-v.PI_OVER_TWO,n.roll=0;var p=S.fromHeadingPitchRoll(n,Re),f=_.fromQuaternion(p,Le);_.getColumn(f,2,e.up),r.cross(e.direction,e.up,e.right)}e._setTransform(a)}function z(e,t,i,n){var o=r.clone(i.direction,ke),a=r.clone(i.up,Fe);if(e._scene.mode===D.SCENE3D){var s=e._projection.ellipsoid,l=x.eastNorthUpToFixedFrame(t,s,Ce),u=y.inverseTransformation(l,we);y.multiplyByPointAsVector(u,o,o),y.multiplyByPointAsVector(u,a,a)}var c=r.cross(o,a,Be);return n.heading=N(o,a),n.pitch=k(o),n.roll=F(o,a,c),n}function G(e,t){var r,i,n=e._scene.mapMode2D===A.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(i=o,r=-i):(i=t.x-2*o,r=t.x+2*o),t.x>o&&(t.x=i),t.x<-o&&(t.x=r),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function H(e,t){var i=e.position,n=r.normalize(i,Ye);if(a(e.constrainedAxis)){var o=r.equalsEpsilon(n,e.constrainedAxis,v.EPSILON2),s=r.equalsEpsilon(n,r.negate(e.constrainedAxis,Ze),v.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=r.normalize(e.constrainedAxis,Xe),u=r.dot(n,l),c=v.acosClamped(u);t>0&&t>c&&(t=c-v.EPSILON4),u=r.dot(n,r.negate(l,Ze)),c=v.acosClamped(u),t<0&&-t>c&&(t=-c+v.EPSILON4);var d=r.cross(l,n,Qe);e.rotate(d,t)}}else e.rotate(e.right,t)}function W(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function j(e,t){var r,i=e.frustum;if(t*=.5,Math.abs(i.top)+Math.abs(i.bottom)>Math.abs(i.left)+Math.abs(i.right)){var n=i.top-t,o=i.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===A.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,n=-a),n<=o&&(n=1,o=-1),r=i.right/i.top,i.top=n,i.bottom=o,i.right=i.top*r,i.left=-i.right}else{var s=i.right-t,l=i.left+t,u=e._maxCoord.x;e._scene.mapMode2D===A.ROTATE&&(u*=e.maximumZoomFactor),s>u&&(s=u,l=-u),s<=l&&(s=1,l=-1),r=i.top/i.right,i.right=s,i.left=l,i.top=i.right*r,i.bottom=-i.top}}function q(e,t){e.move(e.direction,t)}function Y(e,t,i){t=v.clamp(t,-v.PI_OVER_TWO,v.PI_OVER_TWO),e=v.zeroToTwoPi(e)-v.PI_OVER_TWO;var n=S.fromAxisAngle(r.UNIT_Y,-t,$e),o=S.fromAxisAngle(r.UNIT_Z,-e,et),a=S.multiply(o,n,o),s=_.fromQuaternion(a,tt),l=r.clone(r.UNIT_X,Je);return _.multiplyByVector(s,l,l),r.negate(l,l),r.multiplyByScalar(l,i,l),l}function X(e,t,i,n){return Math.abs(r.dot(t,i))/n-r.dot(e,i)}function Q(e,t,i,n){var o=e._projection.ellipsoid,s=n?e:pt,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=v.TWO_PI);var p,f=.5*(h+c);if(u<-v.PI_OVER_TWO+v.RADIANS_PER_DEGREE&&l>v.PI_OVER_TWO-v.RADIANS_PER_DEGREE)p=0;else{var m=it;m.longitude=f,m.latitude=l,m.height=0;var g=nt;g.longitude=f,g.latitude=u,g.height=0;var _=rt;a(_)&&_.ellipsoid===o||(rt=_=new d(void 0,void 0,o)),_.setEndPoints(m,g),p=_.interpolateUsingFraction(.5,it).latitude}var y=it;y.longitude=f,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,dt),w=it;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,ot);w.longitude=h;var T=o.cartographicToCartesian(w,st);w.longitude=f;var E=o.cartographicToCartesian(w,ut);w.latitude=u;var x=o.cartographicToCartesian(w,ct);w.longitude=c;var P=o.cartographicToCartesian(w,lt);w.longitude=h;var A=o.cartographicToCartesian(w,at);r.subtract(T,C,T),r.subtract(P,C,P),r.subtract(S,C,S),r.subtract(A,C,A),r.subtract(E,C,E),r.subtract(x,C,x);var D=o.geodeticSurfaceNormal(C,s.direction);r.negate(D,D);var I=r.cross(D,r.UNIT_Z,s.right);r.normalize(I,I);var O,M=r.cross(I,D,s.up);if(e.frustum instanceof b){var R,L,N=Math.max(r.distance(S,T),r.distance(P,A)),k=Math.max(r.distance(S,P),r.distance(T,A)),F=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,B=k*F;N>B?(R=N,L=R/F):(L=k,R=B),O=Math.max(R,L)}else{var U=Math.tan(.5*e.frustum.fovy),V=e.frustum.aspectRatio*U;if(O=Math.max(X(D,M,T,U),X(D,M,P,U),X(D,M,S,U),X(D,M,A,U),X(D,M,E,U),X(D,M,x,U),X(D,I,T,V),X(D,I,P,V),X(D,I,S,V),X(D,I,A,V),X(D,I,E,V),X(D,I,x,V)),u<0&&l>0){var z=it;z.longitude=h,z.latitude=0,z.height=0;var G=o.cartographicToCartesian(z,ht);r.subtract(G,C,G),O=Math.max(O,X(D,M,G,U),X(D,I,G,V)),z.longitude=c,G=o.cartographicToCartesian(z,ht),r.subtract(G,C,G),O=Math.max(O,X(D,M,G,U),X(D,I,G,V))}}return r.add(C,r.multiplyByScalar(D,-O,ht),i)}function Z(e,t,r){var i=e._projection;t.west>t.east&&(t=E.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,s=ft;s.longitude=t.east,s.latitude=t.north;var l=i.project(s,mt);y.multiplyByPoint(n,l,l),y.multiplyByPoint(o,l,l),s.longitude=t.west,s.latitude=t.south;var u=i.project(s,gt);if(y.multiplyByPoint(n,u,u),y.multiplyByPoint(o,u,u),r.x=.5*(l.x-u.x)+u.x,r.y=.5*(l.y-u.y)+u.y,a(e.frustum.fovy)){var c=Math.tan(.5*e.frustum.fovy),d=e.frustum.aspectRatio*c;r.z=.5*Math.max((l.x-u.x)/d,(l.y-u.y)/c)}else{var h=l.x-u.x,p=l.y-u.y;r.z=Math.max(h,p)}return r}function K(e,t,r){var i=e._projection;t.west>t.east&&(t=E.MAX_VALUE);var n=vt;n.longitude=t.east,n.latitude=t.north;var o=i.project(n,_t);n.longitude=t.west,n.latitude=t.south;var a,s,l=i.project(n,yt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),d=e.frustum.right/e.frustum.top,h=c*d;return u>h?(a=u,s=a/d):(s=c,a=h),c=Math.max(2*a,2*s),r.x=.5*(o.x-l.x)+l.x,r.y=.5*(o.y-l.y)+l.y,n=i.unproject(r,n),n.height=c,r=i.project(n,r)}function J(e,t,r,i){r=o(r,c.WGS84);var n=e.getPickRay(t,bt),a=g.rayEllipsoid(n,r);if(a){var s=a.start>0?a.start:a.stop;return T.getPoint(n,s,i)}}function $(e,t,r,i){var n=e.getPickRay(t,Ct),o=n.origin;o.z=0;var a=r.unproject(o);if(!(a.latitude<-v.PI_OVER_TWO||a.latitude>v.PI_OVER_TWO))return r.ellipsoid.cartographicToCartesian(a,i)}function ee(e,t,i,n){var o=e.getPickRay(t,wt),a=-o.origin.x/o.direction.x;T.getPoint(o,a,n);var s=i.unproject(new r(n.y,n.z,0));if(!(s.latitude<-v.PI_OVER_TWO||s.latitude>v.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(s,n)}function te(e,t,i){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,d=2/a*(a-t.y)-1,h=e.positionWC;r.clone(h,i.origin);var p=r.multiplyByScalar(e.directionWC,u,St);r.add(h,p,p);var f=r.multiplyByScalar(e.rightWC,c*u*l,Tt),m=r.multiplyByScalar(e.upWC,d*u*s,Et),g=r.add(p,f,i.direction);return r.add(g,m,g),r.subtract(g,h,g),r.normalize(g,g),i}function re(e,t,i){var n=e._scene.canvas,o=n.clientWidth,s=n.clientHeight,l=e.frustum ;a(l._offCenterFrustum)&&(l=l._offCenterFrustum);var u=2/o*t.x-1;u*=.5*(l.right-l.left);var c=2/s*(s-t.y)-1;c*=.5*(l.top-l.bottom);var d=i.origin;return r.clone(e.position,d),r.multiplyByScalar(e.right,u,xt),r.add(xt,d,d),r.multiplyByScalar(e.up,c,xt),r.add(xt,d,d),r.clone(e.directionWC,i.direction),e._mode===D.COLUMBUS_VIEW&&r.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}function ie(e,t,i,n,o,a){function s(i){var n=r.lerp(t,l,i.time,new r);e.worldToCameraCoordinatesPoint(n,e.position)}var l=r.clone(t);return i.y>n?l.y-=i.y-n:i.y<-n&&(l.y+=-n-i.y),i.z>o?l.z-=i.z-o:i.z<-o&&(l.z+=-o-i.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function ne(e,t){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(r.UNIT_X,It),a=-r.dot(o,i)/r.dot(o,n),s=r.add(i,r.multiplyByScalar(n,a,Ot),Ot);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,Mt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=r.magnitude(r.subtract(i,s,Rt)),d=u*c,h=l*c,p=e._maxCoord.x,f=e._maxCoord.y,m=Math.max(d-p,p),g=Math.max(h-f,f);if(i.z<-m||i.z>m||i.y<-g||i.y>g){var v=s.y<-m||s.y>m,_=s.z<-g||s.z>g;if(v||_)return ie(e,i,s,m,g,t)}}function oe(e,t){var r=e.frustum,i=Math.tan(.5*r.fovy),n=r.aspectRatio*i;return Math.max(t/n,t/i)}function ae(e,t){var r=e.frustum;a(r._offCenterFrustum)&&(r=r._offCenterFrustum);var i,n,o=r.right/r.top,s=t*o;return t>s?(i=t,n=i/o):(n=t,i=s),1.5*Math.max(i,n)}function se(e,t,r){a(r)||(r=p.clone(I.DEFAULT_OFFSET));var i=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,o=r.range;if(!a(o)||0===o){var s=t.radius;0===s?r.range=kt:e.frustum instanceof b||e._mode===D.SCENE2D?r.range=ae(e,s):r.range=oe(e,s),r.range=v.clamp(r.range,i,n)}return r}function le(e,t){var i,n,o=t.radii,a=e.positionWC,s=r.multiplyComponents(t.oneOverRadii,a,jt),l=r.magnitude(s),u=r.normalize(s,qt);r.equalsEpsilon(u,r.UNIT_Z,v.EPSILON10)?(i=new r(0,1,0),n=new r(0,0,1)):(i=r.normalize(r.cross(r.UNIT_Z,u,Yt),Yt),n=r.normalize(r.cross(u,i,Xt),Xt));var c=Math.sqrt(r.magnitudeSquared(s)-1),d=r.multiplyByScalar(u,1/l,jt),h=c/l,p=r.multiplyByScalar(i,h,qt),f=r.multiplyByScalar(n,h,Yt),m=r.add(d,f,Qt[0]);r.subtract(m,p,m),r.multiplyComponents(o,m,m);var g=r.subtract(d,f,Qt[1]);r.subtract(g,p,g),r.multiplyComponents(o,g,g);var _=r.subtract(d,f,Qt[2]);r.add(_,p,_),r.multiplyComponents(o,_,_);var y=r.add(d,f,Qt[3]);return r.add(y,p,y),r.multiplyComponents(o,y,y),Qt}function ue(e,t,r,i,n,o){Zt.x=e,Zt.y=t;var s=i.pickEllipsoid(Zt,n,Kt);return a(s)?(Jt[r]=n.cartesianToCartographic(s,Jt[r]),1):(Jt[r]=n.cartesianToCartographic(o[r],Jt[r]),0)}I.TRANSFORM_2D=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),I.TRANSFORM_2D_INVERSE=y.inverseTransformation(I.TRANSFORM_2D,new y),I.DEFAULT_VIEW_RECTANGLE=E.fromDegrees(-95,-20,-70,90),I.DEFAULT_VIEW_FACTOR=.5,I.DEFAULT_OFFSET=new p(0,-v.PI_OVER_FOUR,0),I.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===D.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=r.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var i,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,d=o.x+l.left,h=o.x+l.right,p=n.y+s.bottom,f=n.y+s.top,m=o.y+l.bottom,g=o.y+l.top,_=Math.max(u,d),y=Math.min(c,h),b=Math.max(p,m),C=Math.min(f,g);if(_>=y||b>=f)i=1;else{var w=l;uh&&pg&&(w=s),i=1-(y-_)*(C-b)/((w.right-w.left)*(w.top-w.bottom))}return void(i>t&&(e._changed.raiseEvent(i),e._changedPosition=r.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=r.clone(e.positionWC,e._changedPosition),void(e._changedDirection=r.clone(e.directionWC,e._changedDirection));var S,T=v.acosClamped(r.dot(e.directionWC,e._changedDirection));S=a(e.frustum.fovy)?T/(.5*e.frustum.fovy):T;var E=r.distance(e.positionWC,e._changedPosition),x=E/e.positionCartographic.height;(S>t||x>t)&&(e._changed.raiseEvent(Math.max(S,x)),e._changedPosition=r.clone(e.positionWC,e._changedPosition),e._changedDirection=r.clone(e.directionWC,e._changedDirection))}};var ce=new y,de=new n;I.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,i=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&i){var s=this._mode,l=e.globe;if(a(l)&&s!==D.SCENE2D&&s!==D.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;y.equals(this.transform,y.IDENTITY)||(u=y.clone(this.transform,ce),c=r.magnitude(this.position),this._setTransform(y.IDENTITY));var p=de;s===D.SCENE3D?d.cartesianToCartographic(this.position,p):h.unproject(this.position,p);var f=!1;if(p.heightv.PI?p+=v.TWO_PI-y:p+=y,f=_}return v.equalsEpsilon(Math.abs(p),v.TWO_PI,v.EPSILON9)&&(i.west=-v.PI,i.east=v.PI,Jt[0].latitude>=0?i.north=v.PI_OVER_TWO:i.south=-v.PI_OVER_TWO),i}},I.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof w)){var e=this._scene;this.frustum=new w,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.toRadians(60)}},I.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof b)){var e=this._scene;this.frustum=new b,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=r.magnitude(this.position);var t=this.frustum.projectionMatrix;a(t)&&this._adjustOrthographicFrustum(!0)}},I.clone=function(e,t){return a(t)||(t=new I(e._scene)),r.clone(e.position,t.position),r.clone(e.direction,t.direction),r.clone(e.up,t.up),r.clone(e.right,t.right),y.clone(e._transform,t.transform),t._transformChanged=!0,t},I}),define("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";return e({LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4})}),define("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){var i=e;return t(r)&&(i+="+"+r),i}function d(t,r){e.clone(t.distance.startPosition,r.distance.startPosition),e.clone(t.distance.endPosition,r.distance.endPosition),e.clone(t.angleAndHeight.startPosition,r.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,r.angleAndHeight.endPosition)}function h(r,i,n){var o=c(u.PINCH,i),a=r._update,s=r._isDown,h=r._eventStartPosition,p=r._pressTime,f=r._releaseTime;a[o]=!0,s[o]=!1,h[o]=new e;var m=r._movement[o];t(m)||(m=r._movement[o]={}),m.distance={startPosition:new e,endPosition:new e},m.angleAndHeight={startPosition:new e,endPosition:new e},m.prevAngle=0,r._eventHandler.setInputAction(function(t){r._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,h[o])},l.PINCH_START,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),s[o]=!1,f[o]=new Date},l.PINCH_END,i),r._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(d(t,m),a[o]=!1,m.prevAngle=m.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,m.distance.endPosition),e.clone(t.angleAndHeight.endPosition,m.angleAndHeight.endPosition));for(var r=m.angleAndHeight.endPosition.x,i=m.prevAngle,l=2*Math.PI;r>=i+Math.PI;)r-=l;for(;r0||e}}}),v.prototype.isMoving=function(e,t){var r=c(e,t);return!this._update[r]},v.prototype.getMovement=function(e,t){var r=c(e,t);return this._movement[r]},v.prototype.getLastMovement=function(e,t){var r=c(e,t),i=this._lastMovement[r];if(i.valid)return i},v.prototype.isButtonDown=function(e,t){var r=c(e,t);return this._isDown[r]},v.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var r=c(e,t);return this._eventStartPosition[r]},v.prototype.getButtonPressTime=function(e,t){var r=c(e,t);return this._pressTime[r]},v.prototype.getButtonReleaseTime=function(e,t){var r=c(e,t);return this._releaseTime[r]},v.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),i(this)},v}),define("Scene/Cesium3DTileChildrenVisibility",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,VISIBLE:1,IN_REQUEST_VOLUME:2,VISIBLE_IN_REQUEST_VOLUME:4,VISIBLE_NOT_IN_REQUEST_VOLUME:8})}),define("Scene/Composite3DTileContent",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/getMagic","../Core/RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r,i,n,o){this._tileset=e,this._tile=t,this._url=r,this._contents=[],this._readyPromise=s.defer(),u(this,i,n,o)}function u(r,i,n,l){n=e(n,0);var u=new Uint8Array(i),d=new DataView(i);n+=c;var h=d.getUint32(n,!0);if(1!==h)throw new a("Only Composite Tile version 1 is supported. Version "+h+" is not.");n+=c,n+=c;var p=d.getUint32(n,!0);n+=c;for(var f=[],m=0;m-1){ if(!(n.indexOf(_)>-1))throw new h('Shader program cannot be optimized for instancing. Parameter "'+v+'" in program "'+t+'" uses unsupported semantic "'+_+'"');f[m]=_}}}}return r[t]}function D(e){return function(t,r){var i=A(e,r),n=a(e._batchTable),o=_.replaceMain(t,"czm_instancing_main"),s="",l="";for(var u in i)if(i.hasOwnProperty(u)){var c,d=i[u];"MODELVIEW"===d||"CESIUM_RTC_MODELVIEW"===d?c="czm_instanced_modelView":"MODELVIEWPROJECTION"===d?(c="czm_instanced_modelViewProjection",s+="mat4 czm_instanced_modelViewProjection;\n",l+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===d&&(c="czm_instanced_modelViewInverseTranspose",s+="mat3 czm_instanced_modelViewInverseTranspose;\n",l+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");var h=new RegExp("uniform.*"+u+".*");o=o.replace(h,""),h=new RegExp(u+"\\b","g"),o=o.replace(h,c)}var p=n?"attribute float a_batchId;\n":"",f="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+s+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+p+o+"void main()\n{\n mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+l+" czm_instancing_main();\n}";return ne=f,n&&(f=e._batchTable.getVertexShaderCallback(!0,"a_batchId")(f)),f}}function I(e){return function(t){var r=e._batchTable;if(a(r)){var i=e._model.gltf,n=b(i,"_3DTILESDIFFUSE");t=r.getFragmentShaderCallback(!0,n)(t)}return t}}function O(e){return function(t){t=ne;var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickVertexShaderCallback("a_batchId")(t):i&&(t=_.createPickVertexShaderSource(t)),t}}function M(e){return function(t){var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickFragmentShaderCallback()(t):i&&(t=_.createPickFragmentShaderSource(t,"varying")),t}}function R(e,t){return function(){return c.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function L(e){return function(){return e.computedMatrix}}function N(e,t){return function(i,n,o){i=r(i),i.czm_instanced_modifiedModelView=R(e,t),i.czm_instanced_nodeTransform=L(o);var s=A(e,n);for(var l in s)s.hasOwnProperty(l)&&delete i[l];return a(e._batchTable)&&(i=e._batchTable.getUniformMapCallback()(i)),i}}function k(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getPickUniformMapCallback()(t)),t}}function F(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getVertexShaderCallback(!0,"a_batchId")(t),t="uniform float a_batchId\n;"+t),t}}function B(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getPickVertexShaderCallback("a_batchId")(t),t="uniform float a_batchId\n;"+t),t}}function U(e){return function(t){var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickFragmentShaderCallback()(t):i&&(t=_.createPickFragmentShaderSource(t,"uniform")),t}}function V(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function z(e){var t=e._instances,r=e.length,i=e._center,n=e._vertexBufferTypedArray;a(n)||(n=new Float32Array(12*r)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var o=0;o0){var j=f(u,s,N);H=JSON.parse(j),s+=N,k>0&&(W=new Uint8Array(a,s,k),W=new Uint8Array(W),s+=k)}r._batchTable=new T(r,G,H,W);var q=l+D-s;if(0===q)throw new b("glTF byte length is zero, i3dm must have a glTF to instance.");var Y;s%4==0?Y=new Uint8Array(a,s,q):(A._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),Y=new Uint8Array(u.subarray(s,s+q)));var X={instances:new Array(G),batchTable:r._batchTable,cull:!1,url:void 0,requestType:y.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:r._tileset._gltfUpAxis,opaquePass:S.CESIUM_3D_TILE};if(0===F){var Q=f(Y);Q=Q.replace(/[\s\0]+$/,""),X.url=h(m(p(r._url,!0),Q))}else X.gltf=Y,X.basePath=h(p(r._url,!0));var Z,K=z.getGlobalProperty("EAST_NORTH_UP"),J=z.getGlobalProperty("RTC_CENTER",i.FLOAT,3);o(J)&&(Z=t.unpack(J));for(var $=X.instances,ee=new t,te=new Array(3),re=new t,ie=new t,ne=new t,oe=new g,ae=new _,se=new t,le=new w,ue=new v,ce=0;ce0){for(var i=new Array(r),n=0;n0){var S=h(l,n,m);C=JSON.parse(S),n+=m,v>0&&(w=new Uint8Array(r,n,v),n+=v)}var T=new I(y,b),E=T.getGlobalProperty("POINTS_LENGTH");if(T.featuresLength=E,!s(E))throw new g("Feature table global property: POINTS_LENGTH must be defined");var x,P=!1;if(s(y.POSITION)){x=T.getPropertyArray("POSITION",o.FLOAT,3);var D=T.getGlobalProperty("RTC_CENTER",o.FLOAT,3);s(D)&&(e._rtcCenter=t.unpack(D))}else if(s(y.POSITION_QUANTIZED)){x=T.getPropertyArray("POSITION_QUANTIZED",o.UNSIGNED_SHORT,3),P=!0;var O=T.getGlobalProperty("QUANTIZED_VOLUME_SCALE",o.FLOAT,3);if(!s(O))throw new g("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");e._quantizedVolumeScale=t.unpack(O);var M=T.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",o.FLOAT,3);if(!s(M))throw new g("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e._quantizedVolumeOffset=t.unpack(M)}if(!s(x))throw new g("Either POSITION or POSITION_QUANTIZED must be defined.");var R,L=!1,N=!1;if(s(y.RGBA))R=T.getPropertyArray("RGBA",o.UNSIGNED_BYTE,4),L=!0;else if(s(y.RGB))R=T.getPropertyArray("RGB",o.UNSIGNED_BYTE,3);else if(s(y.RGB565))R=T.getPropertyArray("RGB565",o.UNSIGNED_SHORT,1),N=!0;else if(s(y.CONSTANT_RGBA)){var k=T.getGlobalProperty("CONSTANT_RGBA",o.UNSIGNED_BYTE,4);e._constantColor=i.fromBytes(k[0],k[1],k[2],k[3],e._constantColor)}else e._constantColor=i.clone(i.DARKGRAY,e._constantColor);e._isTranslucent=L;var F,B=!1;s(y.NORMAL)?F=T.getPropertyArray("NORMAL",o.FLOAT,3):s(y.NORMAL_OCT16P)&&(F=T.getPropertyArray("NORMAL_OCT16P",o.UNSIGNED_BYTE,2),B=!0);var U;if(s(y.BATCH_ID)){U=T.getPropertyArray("BATCH_ID",o.UNSIGNED_SHORT,1);var V=T.getGlobalProperty("BATCH_LENGTH");if(!s(V))throw new g("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");s(w)&&(w=new Uint8Array(w)),e._batchTable=new A(e,V,C,w)}var G;if(!s(U)&&s(w)){G=A.getBinaryProperties(E,C,w);for(var H in G)if(G.hasOwnProperty(H)){var W=G[H],j=W.typedArray,q=o.fromTypedArray(j);q!==o.INT&&q!==o.UNSIGNED_INT&&q!==o.DOUBLE||(f("Cast pnts property to floats",'Point cloud property "'+H+'" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.'),W.typedArray=new Float32Array(j))}}e._parsedContent={positions:x,colors:R,normals:F,batchIds:U,styleableProperties:G},e._pointsLength=E,e._isQuantized=P,e._isOctEncoded16P=B,e._isRGB565=N,e._hasColors=s(R),e._hasNormals=s(F),e._hasBatchIds=s(U)}function N(e,t){var r=t.context,i=e._parsedContent,a=e._pointsLength,l=i.positions,u=i.colors,c=i.normals,d=i.batchIds,h=i.styleableProperties,f=s(h),g=e._isQuantized,v=e._isOctEncoded16P,S=e._isRGB565,T=e._isTranslucent,x=e._hasColors,A=e._hasNormals,D=e._hasBatchIds,I=e._batchTable,O=s(I),M=[],R={};if(e._styleableShaderAttributes=R,f){var L=Y;for(var N in h)if(h.hasOwnProperty(N)){var k=h[N],F=k.typedArray,B=k.componentCount,U=o.fromTypedArray(F),V=_.createVertexBuffer({context:r,typedArray:k.typedArray,usage:y.STATIC_DRAW});e._geometryByteLength+=V.sizeInBytes;var z={index:L,vertexBuffer:V,componentsPerAttribute:B,componentDatatype:U,normalize:!1,offsetInBytes:0,strideInBytes:0};M.push(z),R[N]={location:L,componentCount:B},++L}}var X={u_pointSizeAndTilesetTime:function(){return G.x=e._pointSize,G.y=e._tileset.timeSinceLoad,G},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor}};g&&(X=n(X,{u_quantizedVolumeScale:function(){return e._quantizedVolumeScale}}));var Q=_.createVertexBuffer({context:r,typedArray:l,usage:y.STATIC_DRAW});e._geometryByteLength+=Q.sizeInBytes;var Z;x&&(Z=_.createVertexBuffer({context:r,typedArray:u,usage:y.STATIC_DRAW}),e._geometryByteLength+=Z.sizeInBytes);var K;A&&(K=_.createVertexBuffer({context:r,typedArray:c,usage:y.STATIC_DRAW}),e._geometryByteLength+=K.sizeInBytes);var J;D&&(J=_.createVertexBuffer({context:r,typedArray:d,usage:y.STATIC_DRAW}),e._geometryByteLength+=J.sizeInBytes);var $=[];if(g?$.push({index:H,vertexBuffer:Q,componentsPerAttribute:3,componentDatatype:o.UNSIGNED_SHORT,normalize:!0,offsetInBytes:0,strideInBytes:0}):$.push({index:H,vertexBuffer:Q,componentsPerAttribute:3,componentDatatype:o.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0}),x)if(S)$.push({index:W,vertexBuffer:Z,componentsPerAttribute:1,componentDatatype:o.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{var ee=T?4:3;$.push({index:W,vertexBuffer:Z,componentsPerAttribute:ee,componentDatatype:o.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}A&&(v?$.push({index:j,vertexBuffer:K,componentsPerAttribute:2,componentDatatype:o.UNSIGNED_BYTE,normalize:!1,offsetInBytes:0,strideInBytes:0}):$.push({index:j,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:o.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0})),D&&$.push({index:q,vertexBuffer:J,componentsPerAttribute:1,componentDatatype:o.fromTypedArray(d),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&($=$.concat(M));var te=new E({context:r,attributes:$}),re=X;O&&(re=I.getUniformMapCallback()(X));var ie;O?ie=I.getPickUniformMapCallback()(X):(e._pickId=r.createPickId({primitive:e._tileset,content:e}),ie=n(X,{czm_pickColor:function(){return e._pickId.color}})),e._opaqueRenderState=w.fromCache({depthTest:{enabled:!0}}),e._translucentRenderState=w.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:P.ALPHA_BLEND}),e._drawCommand=new b({boundingVolume:void 0,cull:!1,modelMatrix:new p,primitiveType:m.POINTS,vertexArray:te,count:a,shaderProgram:void 0,uniformMap:re,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?C.TRANSLUCENT:C.CESIUM_3D_TILE,owner:e,castShadows:!1,receiveShadows:!1}),e._pickCommand=new b({boundingVolume:void 0,cull:!1,modelMatrix:new p,primitiveType:m.POINTS,vertexArray:te,count:a,shaderProgram:void 0,uniformMap:ie,renderState:T?e._translucentRenderState:e._opaqueRenderState,pass:T?C.TRANSLUCENT:C.CESIUM_3D_TILE,owner:e})}function k(e,t){for(var r=/czm_tiles3d_style_(\w+)/g,i=r.exec(e);null!==i;){var n=i[1];-1===t.indexOf(n)&&t.push(n),i=r.exec(e)}}function F(e,t){for(var r=e.numberOfAttributes,i=0;i=0,R=O.indexOf("NORMAL")>=0,L=O.filter(function(e){return-1===X.indexOf(e)});if(R&&!b)throw new g("Style references the NORMAL semantic but the point cloud does not have normals");var N=e._styleableShaderAttributes;for(n in N)if(N.hasOwnProperty(n)){o=N[n];var U=L.indexOf(n)>=0,V=F(E,o.location);V.enabled=U}var z=y&&(!A||M);if(y){F(E,W).enabled=z}var G={a_position:H};z&&(G.a_color=W),b&&(G.a_normal=j),C&&(G.a_batchId=q);var Y="",Q=L.length;for(i=0;i0){for(var i=new Array(r),n=0;n0){P.longitude=.5*(r.west+r.east),P.latitude=p;var m=i.cartographicToCartesian(P,D.origin);t.clone(d,D.direction);var g=h.fromPointNormal(e.southwestCornerCartesian,e.westNormal,A);u.rayPlane(D,g,e.southwestCornerCartesian),l=i.geodeticSurfaceNormal(m,w)}else l=i.geodeticSurfaceNormalCartographic(f.southeast(r),w);var v=t.cross(l,c,S);t.normalize(v,e.southNormal);var _,y=r.north;if(y<0){P.longitude=.5*(r.west+r.east),P.latitude=y;var b=i.cartographicToCartesian(P,D.origin);t.negate(d,D.direction);var I=h.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,A);u.rayPlane(D,I,e.northeastCornerCartesian),_=i.geodeticSurfaceNormal(b,w)}else _=i.geodeticSurfaceNormalCartographic(f.northwest(r),w);var O=t.cross(c,_,S);t.normalize(O,e.northNormal)}a(y.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var C=new t,w=new t,S=new t,T=new t,E=new t,x=new t,P=new r,A=new h(t.UNIT_X,0),D=new p,I=new t,O=new t,M=new t(0,-1,0),R=new t(0,0,-1),L=new t;return y.prototype.distanceToCamera=function(e){var r=e.camera,i=r.positionWC,n=r.positionCartographic,o=0;if(!f.contains(this.rectangle,n)){var a=this.southwestCornerCartesian,s=this.northeastCornerCartesian,l=this.westNormal,u=this.southNormal,c=this.eastNormal,d=this.northNormal;e.mode!==_.SCENE3D&&(a=e.mapProjection.project(f.southwest(this.rectangle),I),a.z=a.y,a.y=a.x,a.x=0,s=e.mapProjection.project(f.northeast(this.rectangle),O),s.z=s.y,s.y=s.x,s.x=0,l=M,c=t.UNIT_Y,u=R,d=t.UNIT_Z);var h=t.subtract(i,a,L),p=t.dot(h,l),m=t.dot(h,u),g=t.subtract(i,s,L),v=t.dot(g,c),y=t.dot(g,d);p>0?o+=p*p:v>0&&(o+=v*v),m>0?o+=m*m:y>0&&(o+=y*y)}var b;b=e.mode===_.SCENE3D?n.height:i.x;var C=e.mode===_.SCENE3D?this.maximumHeight:0,w=b-C;return w>0&&(o+=w*w),Math.sqrt(o)},y.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},y.prototype.createDebugVolume=function(e){var t=new c.clone(c.IDENTITY),r=new m({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new l({geometry:r,modelMatrix:t,attributes:{color:n.fromColor(e)}});return new v({geometryInstances:i,appearance:new g({translucent:!1,flat:!0}),asynchronous:!1})},y}),define("Scene/TileBoundingSphere",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix4","../Core/SphereOutlineGeometry","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r){this._boundingSphere=new e(t,r)}return n(c.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),c.prototype.distanceToCamera=function(e){var r=this._boundingSphere;return Math.max(0,t.distance(r.center,e.camera.positionWC)-r.radius)},c.prototype.intersectPlane=function(t){return e.intersectPlane(this._boundingSphere,t)},c.prototype.update=function(e,r){t.clone(e,this._boundingSphere.center),this._boundingSphere.radius=r},c.prototype.createDebugVolume=function(e){var t=new s({radius:this.radius}),r=a.fromTranslation(this.center,new a.clone(a.IDENTITY)),n=new o({geometry:t,modelMatrix:r,attributes:{color:i.fromColor(e)}});return new u({geometryInstances:n,appearance:new l({translucent:!1,flat:!0}),asynchronous:!1})},c}),define("Scene/TileOrientedBoundingBox",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this._orientedBoundingBox=new u(t,r),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}return o(h.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),h.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},h.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},h.prototype.update=function(t,i){r.clone(t,this._orientedBoundingBox.center),s.clone(i,this._orientedBoundingBox.halfAxes),e.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},h.prototype.createDebugVolume=function(e){var i=new t({minimum:new r(-1,-1,-1),maximum:new r(1,1,1)}),o=l.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),s=new a({geometry:i,modelMatrix:o,attributes:{color:n.fromColor(e)}});return new d({geometryInstances:s,appearance:new c({translucent:!1,flat:!0}),asynchronous:!1})},h}),define("Scene/Cesium3DTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/getMagic","../Core/Intersect","../Core/joinUrls","../Core/JulianDate","../Core/loadArrayBuffer","../Core/Matrix3","../Core/Matrix4","../Core/Rectangle","../Core/Request","../Core/RequestScheduler","../Core/RequestState","../Core/RequestType","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileChildrenVisibility","./Cesium3DTileContentFactory","./Cesium3DTileContentState","./Cesium3DTileOptimizationHint","./Cesium3DTileRefine","./Empty3DTileContent","./SceneMode","./TileBoundingRegion","./TileBoundingSphere","./TileOrientedBoundingBox"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O){"use strict";function M(e,t,i,o){this._tileset=e,this._header=i;var a=i.content;this.transform=n(i.transform)?f.unpack(i.transform):f.clone(f.IDENTITY);var s=n(o)?o.computedTransform:e.modelMatrix,l=f.multiply(s,this.transform,new f);this.computedTransform=l,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,l),this._boundingVolume2D=void 0;var u;n(a)&&n(a.boundingVolume)&&(u=this.createBoundingVolume(a.boundingVolume,l)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;var h;n(i.viewerRequestVolume)&&(h=this.createBoundingVolume(i.viewerRequestVolume,l)),this._viewerRequestVolume=h,this.geometricError=i.geometricError,n(this.geometricError)||(this.geometricError=n(o)?o.geometricError:e._geometricError,M._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead."));var p;n(i.refine)?("replace"!==i.refine&&"add"!==i.refine||M._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+i.refine+'". Instead use "'+i.refine.toUpperCase()+'".'),p="REPLACE"===i.refine.toUpperCase()?x.REPLACE:x.ADD):p=n(o)?o.refine:x.REPLACE,this.refine=p,this.children=[],this.parent=o;var m,g,_,y,b;n(a)?(g=!1,_=T.UNLOADED,y=c(t,a.url),b=v.getServerKey(y)):(m=new P(e,this),g=!0,_=T.READY),this._content=m,this._contentUrl=y,this._contentState=_,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=g,this.hasRenderableContent=!1,this.hasTilesetContent=!1,this.replacementNode=void 0;var C,S,A=i.expire;n(A)&&(C=A.duration,n(A.date)&&(S=d.fromIso8601(A.date))),this.expireDuration=C,this.expireDate=S,this.selected=!1,this.lastStyleTime=0,this._optimChildrenWithinParent=E.NOT_COMPUTED,this._distanceToCamera=0,this._visibilityPlaneMask=0,this._childrenVisibility=w.VISIBLE,this._lastSelectedFrameNumber=-1,this._screenSpaceError=0,this._screenSpaceErrorComputedFrame=-1,this._finalResolution=!0,this._depth=0,this._centerZDepth=0,this._stackLength=0,this._selectedFrame=-1,this._selectionDepth=0,this._lastSelectionDepth=void 0,this._requestedFrame=void 0,this._lastVisitedFrame=void 0,this._ancestorWithContent=void 0,this._ancestorWithLoadedContent=void 0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=r.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._commandsLength=0,this._color=void 0,this._colorDirty=!1}function R(e){if(n(e.expireDuration)){var t=d.now(H);d.addSeconds(t,e.expireDuration,t),n(e.expireDate)?d.lessThan(e.expireDate,t)&&d.clone(t,e.expireDate):e.expireDate=d.clone(t)}}function L(e){return function(t){e._contentState=T.FAILED,e._contentReadyPromise.reject(t),e._contentReadyToProcessPromise.reject(t)}}function N(e){return function(){return e._distanceToCamera}}function k(t,r){if(r.mode!==A.SCENE3D&&!n(t._boundingVolume2D)){var i=t._boundingVolume.boundingSphere,o=e.projectTo2D(i,r.mapProjection,W);t._boundingVolume2D=new I(o.center,o.radius)}return r.mode!==A.SCENE3D?t._boundingVolume2D:t._boundingVolume}function F(t,r){if(r.mode!==A.SCENE3D&&!n(t._contentBoundingVolume2D)){var i=t._contentBoundingVolume.boundingSphere,o=e.projectTo2D(i,r.mapProjection,W);t._contentBoundingVolume2D=new I(o.center,o.radius)}return r.mode!==A.SCENE3D?t._contentBoundingVolume2D:t._contentBoundingVolume}function B(e,r,i){var o=t.fromElements(e[0],e[1],e[2],Q),a=p.fromArray(e,3,X);o=f.multiplyByPoint(r,o,o);var s=f.getRotation(r,q);return a=p.multiply(s,a,a),n(i)?(i.update(o,a),i):new O(o,a)}function U(e,t){var r=m.unpack(e,0,Z);return n(t)?t:new D({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function V(e,r,i){var o=t.fromElements(e[0],e[1],e[2],Q),a=e[3];o=f.multiplyByPoint(r,o,o);var s=f.getScale(r,Y);return a*=t.maximumComponent(s),n(i)?(i.update(o,a),i):new I(o,a)}function z(e,t,i){var o=n(e._header.content)&&n(e._header.content.boundingVolume),a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(a){if(!n(e._debugBoundingVolume)){var s=e._finalResolution?o?r.WHITE:r.RED:r.YELLOW;e._debugBoundingVolume=e._boundingVolume.createDebugVolume(s)}e._debugBoundingVolume.update(i)}else!a&&n(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(n(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(r.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&n(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&n(e._viewerRequestVolume)?(n(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(r.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&n(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());var l=t.debugColorizeTiles&&!e._debugColorizeTiles,u=!t.debugColorizeTiles&&e._debugColorizeTiles;l?(e._debugColorizeTiles=!0,e.color=e._debugColor):u&&(e._debugColorizeTiles=!1,e.color=r.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),u&&t.makeStyleDirty()}function G(e,t,r){var i=e._content,o=e._expiredContent;if(n(o)){if(!e.contentReady)return void o.update(t,r);e._expiredContent.destroy(),e._expiredContent=void 0}i.update(t,r)}M._deprecationWarning=a,o(M.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},contentBoundingVolume:{get:function(){return i(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},color:{get:function(){return n(this._color)||(this._color=new r),r.clone(this._color)},set:function(e){this._color=r.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady||n(this._expiredContent)&&this._contentState!==T.FAILED}},contentReady:{get:function(){return this._contentState===T.READY}},contentUnloaded:{get:function(){return this._contentState===T.UNLOADED}},contentExpired:{get:function(){return this._contentState===T.EXPIRED}},contentReadyToProcessPromise:{get:function(){if(n(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(n(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var H=new d;M.prototype.updateExpiration=function(){if(n(this.expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=d.now(H);d.lessThan(this.expireDate,e)&&(this._contentState=T.EXPIRED,this._expiredContent=this._content)}},M.prototype.requestContent=function(){var e=this,t=this._tileset;if(this.hasEmptyContent)return!1;var r=this._contentUrl,i=this.contentExpired;if(i){var o="?expired="+this.expireDate.toString();r=c(r,o,!1)}var a=new g({throttle:!0,throttleByServer:!0,type:y.TILES3D,priorityFunction:N(this),serverKey:this._serverKey}),s=h(r,void 0,a);if(!n(s))return!1;var u=this._contentState;this._contentState=T.LOADING,this._contentReadyToProcessPromise=C.defer(),this._contentReadyPromise=C.defer(),i&&(this.expireDate=void 0);var d=L(this);return s.then(function(r){if(e.isDestroyed())return void d();var i,o=new Uint8Array(r),a=l(o),s=S[a];return n(s)?(i=s(t,e,e._contentUrl,r,0),e.hasRenderableContent=!0):(i=S.json(t,e,e._contentUrl,r,0),e.hasTilesetContent=!0),e._content=i,e._contentState=T.PROCESSING,e._contentReadyToProcessPromise.resolve(i),i.readyPromise.then(function(t){if(e.isDestroyed())return void d();R(e),e.lastStyleTime=0,e._contentState=T.READY,e._contentReadyPromise.resolve(t)})}).otherwise(function(r){if(a.state===_.CANCELLED)return e._contentState=u,--t.statistics.numberOfPendingRequests,void++t.statistics.numberOfAttemptedRequests;d(r)}),!0},M.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=T.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.replacementNode=void 0,this.lastStyleTime=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var W=new e;M.prototype.visibility=function(e,t){var r=e.cullingVolume,i=k(this,e);return r.computeVisibilityWithPlaneMask(i,t)},M.prototype.contentVisibility=function(e){if(!n(this._contentBoundingVolume))return u.INSIDE;var t=e.cullingVolume,r=F(this,e);return t.computeVisibility(r)},M.prototype.distanceToTile=function(e){return k(this,e).distanceToCamera(e)};var j=new t;M.prototype.distanceToTileCenter=function(e){var r=k(this,e),i=r.boundingVolume,n=t.subtract(i.center,e.camera.positionWC,j),o=t.magnitude(n);return t.divideByScalar(n,o,n),o*t.dot(e.camera.directionWC,n)},M.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!n(t)||0===t.distanceToCamera(e)};var q=new p,Y=new t,X=new p,Q=new t,Z=new m;M.prototype.createBoundingVolume=function(e,t,r){if(!n(e))throw new b("boundingVolume must be defined");if(n(e.box))return B(e.box,t,r);if(n(e.region))return U(e.region,r);if(n(e.sphere))return V(e.sphere,t,r);throw new b("boundingVolume must contain a sphere, region, or box")};var K=new f;M.prototype.updateTransform=function(e){e=i(e,f.IDENTITY);var t=f.multiply(e,this.transform,K);if(!f.equals(t,this.computedTransform)){f.clone(t,this.computedTransform);var r=this._header,o=this._header.content;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,t,this._boundingVolume),n(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(o.boundingVolume,t,this._contentBoundingVolume)),n(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,t,this._viewerRequestVolume)),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}},M.prototype.update=function(e,t){var r=t.commandList.length;z(this,e,t),G(this,e,t),this._commandsLength=t.commandList.length-r};var J=[];return M.prototype.process=function(e,t){var r=t.commandList;t.commandList=J,this._content.update(e,t),J.length=0,t.commandList=r},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),s(this)},M}),define("Scene/Cesium3DTileContent",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,n){this.featurePropertiesDirty=!1}return e(r.prototype,{featuresLength:{get:function(){t.throwInstantiationError()}},pointsLength:{get:function(){t.throwInstantiationError()}},trianglesLength:{get:function(){t.throwInstantiationError()}},geometryByteLength:{get:function(){t.throwInstantiationError()}},texturesByteLength:{get:function(){t.throwInstantiationError()}},batchTableByteLength:{get:function(){t.throwInstantiationError()}},innerContents:{get:function(){t.throwInstantiationError()}},readyPromise:{get:function(){t.throwInstantiationError()}},tileset:{get:function(){t.throwInstantiationError()}},tile:{get:function(){t.throwInstantiationError()}},url:{get:function(){t.throwInstantiationError()}},batchTable:{get:function(){t.throwInstantiationError()}}}),r.prototype.hasProperty=function(e,r){t.throwInstantiationError()},r.prototype.getFeature=function(e){t.throwInstantiationError()},r.prototype.applyDebugSettings=function(e,r){t.throwInstantiationError()},r.prototype.applyStyle=function(e,r){t.throwInstantiationError()},r.prototype.update=function(e,r){t.throwInstantiationError()},r.prototype.isDestroyed=function(){t.throwInstantiationError()},r.prototype.destroy=function(){t.throwInstantiationError()},r}),define("Scene/Cesium3DTileOptimizations",["../Core/Cartesian3","../Core/Check","./Cesium3DTileOptimizationHint","./TileBoundingRegion","./TileOrientedBoundingBox"],function(e,t,r,i,n){"use strict";var o={},a=new e;return o.checkChildrenWithinParent=function(t){var o=t.children,s=o.length,l=t._boundingVolume;if(l instanceof n||l instanceof i){var u=l._orientedBoundingBox;t._optimChildrenWithinParent=r.USE_OPTIMIZATION;for(var c=0;c0;)for(var c=B.pop(),d=c.children,h=d.length,p=0;p0||a.length>0;){if(a.length>0){var s=a[a.length-1];if(s._stackLength===o.length){a.pop(),s===n&&(s._finalResolution=!0),p(e,s,i);continue}}var u=o.pop();if(t(u)&&C(u,i)){var c=u.selected&&u._selectedFrame===i.frameNumber&&u.hasRenderableContent,d=u.children,h=d.length;if(d.sort(f),c)if(u.refine===l.ADD)u._finalResolution=!0,p(e,u,i);else{if(u._selectionDepth=a.length,u._selectionDepth>0&&(e._hasMixedContent=!0),n=u,0===h){u._finalResolution=!0,p(e,u,i);continue}a.push(u),u._stackLength=o.length}for(var m=0;mn;return O(r._visibilityPlaneMask)&&(!a||A(e,o.geometricError,r,i)>n)}function R(e){return e.refine===l.ADD||0===e.children.length||e._childrenVisibility&0!==s.VISIBLE}function L(e){return e.refine===l.ADD&&e.hasRenderableContent}function N(e,r){var i=r.stack;!t(e)||t(r.shouldVisit)&&!r.shouldVisit(e)||i.push(e);for(var n=0;i.length>0;){n=Math.max(n,i.length);var o=i.pop();r.visitStart(o);for(var a=r.getChildren(o),s=!t(a.get),l=a.length,u=0;u0;){var a=i.length;o=Math.max(o,a);for(var s=0;si,a=e.refine===l.REPLACE&&0!=(n&s.VISIBLE_IN_REQUEST_VOLUME);if(n&s.VISIBLE_NOT_IN_REQUEST_VOLUME&&e.refine===l.REPLACE&&this.tileset._desiredTiles.push(e),o||a||e.hasTilesetContent){for(var u=e.children,c=u.length,d=0;dp.minimumRadius){var g=r.fromCartesian(m,p,ie);n=t.normalize(u.positionWC,re),o=u.directionWC,a=u.positionCartographic.height,s=0,l=2*g.height}else{var v=b.multiplyByPoint(h,u.positionWC,ae);if(n=t.UNIT_Z,o=b.multiplyByPointAsVector(h,u.directionWC,se),o=t.normalize(o,o),a=v.z,d instanceof B){var _=c._header.boundingVolume.box[11];s=m.z-_,l=m.z+_}else if(d instanceof F){var C=f.radius;s=m.z-C,l=m.z+C}}}var w=e.dynamicScreenSpaceErrorHeightFalloff,S=s+(l-s)*w,T=l,E=y.clamp((a-S)/(T-S),0,1),x=Math.abs(t.dot(o,n)),P=1-x;P*=1-E;var A=e.dynamicScreenSpaceErrorDensity;A*=P,e._dynamicScreenSpaceErrorComputedDensity=A}function z(e,t,r){var i=e.skipLevelOfDetail?e.skipLevels:0,n=e.skipLevelOfDetail?e.skipScreenSpaceErrorFactor:1;return t!==r&&!r.hasEmptyContent&&!e.immediatelyLoadDesiredLevelOfDetail&&r._screenSpaceErrort._depth+i}function G(e,t){if(!t.hasEmptyContent){var r=e._statistics,i=t.contentExpired;if(!t.requestContent())return void++r.numberOfAttemptedRequests;i&&(t.hasRenderableContent?(r.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady):t.hasTilesetContent&&J(e,t)),++r.numberOfPendingRequests;var n=j(e,t);t.contentReadyToProcessPromise.then(W(e,t)),t.contentReadyPromise.then(function(){n(),e.tileLoad.raiseEvent(t)}).otherwise(n)}}function H(e,t){if(t)for(var r=e._requestedTiles,i=r.length,n=0;n=0;--n)r[n].process(e,t)}function Y(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,ue):Math.round(t).toLocaleString()}function X(e){var r=e._boundingVolume.boundingVolume,i=r.halfAxes,n=r.radius,a=t.clone(r.center,le);if(o(i))a.x+=.75*(i[0]+i[3]+i[6]),a.y+=.75*(i[1]+i[4]+i[7]),a.z+=.75*(i[2]+i[5]+i[8]);else if(o(n)){var s=t.normalize(r.center,le);s=t.multiplyByScalar(s,.75*n,le),a=t.add(s,r.center,le)}return a}function Q(e,t,r){var i="",n=0;if(t.debugShowGeometricError&&(i+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics){i+="\nCommands: "+e.commandsLength,n++;e.content.pointsLength>0&&(i+="\nPoints: "+e.content.pointsLength,n++);e.content.trianglesLength>0&&(i+="\nTriangles: "+e.content.trianglesLength,n++),i+="\nFeatures: "+e.content.featuresLength,n++}t.debugShowMemoryUsage&&(i+="\nTexture Memory: "+Y(e.content.texturesByteLength),i+="\nGeometry Memory: "+Y(e.content.geometryByteLength),n+=2),t.debugShowUrl&&(i+="\nUrl: "+e._header.content.url,n++);var o={text:i.substring(1),position:r,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function Z(t,r){var i=t._selectedTiles,n=i.length;if(t._tileDebugLabels.removeAll(),t.debugPickedTileLabelOnly){if(o(t.debugPickedTile)){var a=o(t.debugPickPosition)?t.debugPickPosition:X(t.debugPickedTile),s=Q(t.debugPickedTile,t,a);s.pixelOffset=new e(15,-15)}}else for(var l=0;l0;e._backfaceCommands.length=0,c&&n.push(ce);var d=n.length;for(r=0;r=0;--r)n[d+g+r]=n[d+r];for(r=0;r0;){t=n.pop();for(var o=t.children,a=o.length,s=0;sn||t);){var s=a.item;a=a.next,$(e,s),s.unloadContent(),i=e.totalMemoryUsageInBytes}}function te(e,t){var r=e._statistics,i=e._statisticsLastColor,n=r.numberOfPendingRequests,o=r.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing,l=n!==a||o!==s;l&&t.afterRender.push(function(){e.loadProgress.raiseEvent(n,o)}),e._tilesLoaded=0===r.numberOfPendingRequests&&0===r.numberOfTilesProcessing&&0===r.numberOfAttemptedRequests,l&&e._tilesLoaded&&t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()})}a(U.prototype,{asset:{get:function(){return this._asset}},properties:{get:function(){return this._properties}},ready:{get:function(){return o(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},url:{get:function(){return this._url}},basePath:{get:function(){return this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},boundingSphere:{get:function(){return this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=b.clone(e,this._modelMatrix),o(this._root)&&this._root.updateTransform(this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}}}),U.loadJson=function(e){return v(e)},U.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},U.prototype.loadTileset=function(e,t,r){var i=t.asset;if(!o(i))throw new C("Tileset must have an asset property.");if("0.0"!==i.version&&"1.0"!==i.version)throw new C("The tileset must be 3D Tiles version 0.0 or 1.0. See https://github.com/AnalyticalGraphicsInc/3d-tiles#spec-status");var a=this._statistics;if(!/[?&]v=/.test(e)){var s="?v="+n(i.tilesetVersion,"0.0");this._basePath=m(this._basePath,s),e=m(e,s,!1)}var l=d(e,!0),u=new x(this,l,t.root,r);o(r)&&(r.children.push(u),u._depth=r._depth+1),++a.numberOfTilesTotal;var c=[];for(c.push({header:t.root,tile3D:u});c.length>0;){var h=c.pop(),p=h.tile3D,f=h.header.children;if(o(f))for(var g=f.length,v=0;v0;){var t=e.pop();t.destroy();for(var r=t.children,i=r.length,n=0;n":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},n=function(e){var t,r=0;for(var i in e)(t=i.length)>r&&e.hasOwnProperty(i)&&(r=t);return r},o=n(r),a=n(i),s={true:!0,false:!1,null:null},l=function(e){return i[e]||0},u=function(e,t,r){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:r}},c=function(e){return e>=48&&e<=57},d=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!i[String.fromCharCode(e)]},h=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!i[String.fromCharCode(e)]},p=function(e){for(var n,p,f=0,m=e.charAt,g=e.charCodeAt,v=function(t){return m.call(e,t)},_=function(t){return g.call(e,t)},y=e.length,b=function(){for(var e=_(f);32===e||9===e;)e=_(++f)},C=function(){var e,r,i=S();return b(),63!==_(f)?i:(f++,e=C(),e||t("Expected expression",f),b(),58===_(f)?(f++,r=C(),r||t("Expected expression",f),{type:"ConditionalExpression",test:i,consequent:e,alternate:r}):void t("Expected :",f))},w=function(){b();for(var t=e.substr(f,a),r=t.length;r>0;){if(i.hasOwnProperty(t))return f+=r,t;t=t.substr(0,--r)}return!1},S=function(){var e,r,i,n,o,a,s,c;if(a=T(),!(r=w()))return a;for(o={value:r,prec:l(r)},s=T(),s||t("Expected expression after "+r,f),n=[a,o,s];(r=w())&&0!==(i=l(r));){for(o={value:r,prec:i};n.length>2&&i<=n[n.length-2].prec;)s=n.pop(),r=n.pop().value,a=n.pop(),e=u(r,a,s),n.push(e);e=T(),e||t("Expected expression after "+r,f),n.push(o,e)}for(c=n.length-1,e=n[c];c>1;)e=u(n[c-1].value,n[c-2],e),c-=2;return e},T=function(){var t,i,n;if(b(),t=_(f),c(t)||46===t)return E();if(39===t||34===t)return x();if(d(t)||40===t)return D();if(91===t)return O();for(i=e.substr(f,o),n=i.length;n>0;){if(r.hasOwnProperty(i))return f+=n,{type:"UnaryExpression",operator:i,argument:T(),prefix:!0};i=i.substr(0,--n)}return!1},E=function(){for(var e,r,i="";c(_(f));)i+=v(f++);if(46===_(f))for(i+=v(f++);c(_(f));)i+=v(f++);if("e"===(e=v(f))||"E"===e){for(i+=v(f++),e=v(f),"+"!==e&&"-"!==e||(i+=v(f++));c(_(f));)i+=v(f++);c(_(f-1))||t("Expected exponent ("+i+v(f)+")",f)}return r=_(f),d(r)?t("Variable names cannot start with a number ("+i+v(f)+")",f):46===r&&t("Unexpected period",f),{type:"Literal",value:parseFloat(i),raw:i}},x=function(){for(var e,r="",i=v(f++),n=!1;f=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o=0&&a=0?new E(h.VARIABLE_IN_STRING,e.value):new E(h.LITERAL_STRING,A(e.value)):void 0}function O(e,t){var r,i,n,a,s=t.arguments,l=s.length;if("MemberExpression"===t.callee.type){r=t.callee.property.name;var u=t.callee.object;if("test"===r||"exec"===r){if("regExp"!==u.callee.name)throw new c(r+" is not a function.");return 0===l?"test"===r?new E(h.LITERAL_BOOLEAN,!1):new E(h.LITERAL_NULL,null):(n=U(e,u),a=U(e,s[0]),new E(h.FUNCTION_CALL,r,n,a))}if("toString"===r)return i=U(e,u),new E(h.FUNCTION_CALL,r,i);throw new c('Unexpected function call "'+r+'".')}if("color"===(r=t.callee.name)){if(0===l)return new E(h.LITERAL_COLOR,r);if(i=U(e,s[0]),o(s[1])){var d=U(e,s[1]);return new E(h.LITERAL_COLOR,r,[i,d])}return new E(h.LITERAL_COLOR,r,[i])}if("rgb"===r||"hsl"===r){if(l<3)throw new c(r+" requires three arguments.");return i=[U(e,s[0]),U(e,s[1]),U(e,s[2])],new E(h.LITERAL_COLOR,r,i)}if("rgba"===r||"hsla"===r){if(l<4)throw new c(r+" requires four arguments.");return i=[U(e,s[0]),U(e,s[1]),U(e,s[2]),U(e,s[3])],new E(h.LITERAL_COLOR,r,i)}if("vec2"===r||"vec3"===r||"vec4"===r){i=new Array(l);for(var p=0;p1)throw new c(r+" requires exactly one argument.");return i=U(e,s[0]),new E(h.UNARY,r,i)}if("getExactClassName"===r){if(l>0)throw new c(r+" does not take any argument.");return new E(h.UNARY,r)}if(o(ae[r])){if(1!==l)throw new c(r+" requires exactly one argument.");return i=U(e,s[0]),new E(h.UNARY,r,i)}if(o(se[r])){if(2!==l)throw new c(r+" requires exactly two arguments.");return n=U(e,s[0]),a=U(e,s[1]),new E(h.BINARY,r,n,a)}if(o(le[r])){if(3!==l)throw new c(r+" requires exactly three arguments.");n=U(e,s[0]),a=U(e,s[1]);var f=U(e,s[2]);return new E(h.TERNARY,r,n,a,f)}if("Boolean"===r)return 0===l?new E(h.LITERAL_BOOLEAN,!1):(i=U(e,s[0]),new E(h.UNARY,r,i));if("Number"===r)return 0===l?new E(h.LITERAL_NUMBER,0):(i=U(e,s[0]),new E(h.UNARY,r,i));if("String"===r)return 0===l?new E(h.LITERAL_STRING,""):(i=U(e,s[0]),new E(h.UNARY,r,i));if("regExp"===r)return M(e,t);throw new c('Unexpected function call "'+r+'".')}function M(e,t){var r=t.arguments;if(0===r.length)return new E(h.LITERAL_REGEX,new RegExp);var i,n=U(e,r[0]);if(r.length>1){var o=U(e,r[1]);if(k(n)&&k(o)){try{i=new RegExp(A(String(n._value)),o._value)}catch(e){throw new c(e)}return new E(h.LITERAL_REGEX,i)}return new E(h.REGEX,n,o)}if(k(n)){try{i=new RegExp(A(String(n._value)))}catch(e){throw new c(e)}return new E(h.LITERAL_REGEX,i)}return new E(h.REGEX,n)}function R(e){if(F(e.name)){var t=B(e.name);return"tiles3d_"===t.substr(0,8)?new E(h.BUILTIN_VARIABLE,t):new E(h.VARIABLE,t)}if("NaN"===e.name)return new E(h.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new E(h.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new E(h.LITERAL_UNDEFINED,void 0);throw new c(e.name+" is not defined.")}function L(e){var t=e.property.name;return"PI"===t?new E(h.LITERAL_NUMBER,Math.PI):"E"===t?new E(h.LITERAL_NUMBER,Math.E):void 0}function N(e,t){if("Math"===t.object.name)return L(t);var r,i=U(e,t.object);return t.computed?(r=U(e,t.property),new E(h.MEMBER,"brackets",i,r)):(r=new E(h.LITERAL_STRING,t.property.name),new E(h.MEMBER,"dot",i,r))}function k(e){return e._type>=h.LITERAL_NULL}function F(e){return"czm_"===e.substr(0,4)}function B(e){return e.substr(4)}function U(e,t){var r,i,n,o;if("Literal"===t.type)r=I(t);else if("CallExpression"===t.type)r=O(e,t);else if("Identifier"===t.type)r=R(t);else if("UnaryExpression"===t.type){i=t.operator;var a=U(e,t.argument);if(!($.indexOf(i)>-1))throw new c('Unexpected operator "'+i+'".');r=new E(h.UNARY,i,a)}else if("BinaryExpression"===t.type){if(i=t.operator,n=U(e,t.left),o=U(e,t.right),!(ee.indexOf(i)>-1))throw new c('Unexpected operator "'+i+'".');r=new E(h.BINARY,i,n,o)}else if("LogicalExpression"===t.type)i=t.operator,n=U(e,t.left),o=U(e,t.right),ee.indexOf(i)>-1&&(r=new E(h.BINARY,i,n,o));else if("ConditionalExpression"===t.type){var s=U(e,t.test);n=U(e,t.consequent),o=U(e,t.alternate),r=new E(h.CONDITIONAL,"?",n,o,s)}else if("MemberExpression"===t.type)r=N(e,t);else{if("ArrayExpression"!==t.type)throw new c("Compound"===t.type?"Provide exactly one expression.":"Cannot parse expression.");for(var l=[],u=0;u"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:o(se[e._value])&&(e.evaluate=H(e._value)):e._type===h.TERNARY?e.evaluate=W(e._value):e._type===h.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===h.ARRAY?e.evaluate=e._evaluateArray:e._type===h.VARIABLE?e.evaluate=e._evaluateVariable:e._type===h.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===h.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===h.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===h.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===h.REGEX?e.evaluate=e._evaluateRegExp:e._type===h.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=z):e.evaluate=e._evaluateLiteral}function z(e,t){return t.content.tileset.timeSinceLoad}function G(e){var t=ae[e];return function(r,i){var n=this._left.evaluate(r,i);return t(e,n)}}function H(e){var t=se[e];return function(r,i){var n=this._left.evaluate(r,i),o=this._right.evaluate(r,i);return t(e,n,o)}}function W(e){var t=le[e];return function(r,i){var n=this._left.evaluate(r,i),o=this._right.evaluate(r,i),a=this._test.evaluate(r,i);return t(e,n,o,a)}}function j(e){return"feature"===e._value}function q(e){for(var t=e._left,r=t.length,i=0;i=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new e),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new t),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new r),this.cartesian4Array[this.cartesian4Index++]}};p.prototype.evaluate=function(i,o,a){J.reset();var s=this._runtimeAst.evaluate(i,o);return a instanceof n&&s instanceof r?n.fromCartesian4(s,a):s instanceof e||s instanceof t||s instanceof r?s.clone(a):s},p.prototype.evaluateColor=function(e,t,r){J.reset();var i=this._runtimeAst.evaluate(e,t);return n.fromCartesian4(i,r)},p.prototype.getShaderFunction=function(e,t,r,i){var n=this.getShaderExpression(t,r);return n=i+" "+e+"() \n{ \n return "+n+"; \n} \n"},p.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var $=["!","-","+"],ee=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],te=/\${(.*?)}/g,re=/\\/g,ie="@#%",ne=/@#%/g,oe=new n,ae={abs:v(Math.abs),sqrt:v(Math.sqrt),cos:v(Math.cos),sin:v(Math.sin),tan:v(Math.tan),acos:v(Math.acos),asin:v(Math.asin),atan:v(Math.atan),radians:v(u.toRadians),degrees:v(u.toDegrees),sign:v(u.sign),floor:v(Math.floor),ceil:v(Math.ceil),round:v(Math.round),exp:v(Math.exp),exp2:v(m),log:v(Math.log),log2:v(g),fract:v(f),length:b,normalize:C},se={atan2:_(Math.atan2,!1),pow:_(Math.pow,!1),min:_(Math.min,!0),max:_(Math.max,!0),distance:w,dot:S,cross:T},le={clamp:y(u.clamp,!0),mix:y(u.lerp,!0)};return E.prototype._evaluateLiteral=function(e,t){return this._value},E.prototype._evaluateLiteralColor=function(e,t){var i=oe,a=this._left;if("color"===this._value)o(a)?a.length>1?(n.fromCssColorString(a[0].evaluate(e,t),i),i.alpha=a[1].evaluate(e,t)):n.fromCssColorString(a[0].evaluate(e,t),i):n.fromBytes(255,255,255,255,i);else if("rgb"===this._value)n.fromBytes(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),255,i);else if("rgba"===this._value){var s=255*a[3].evaluate(e,t);n.fromBytes(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),s,i)}else"hsl"===this._value?n.fromHsl(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),1,i):"hsla"===this._value&&n.fromHsl(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),a[3].evaluate(e,t),i);return r.fromColor(i,J.getCartesian4())},E.prototype._evaluateLiteralVector=function(i,n){for(var o=J.getArray(),a=this._value,s=this._left,l=s.length,u=0;u1)throw new c("Invalid "+a+" constructor. Not enough arguments.");if(h>p&&l>1)throw new c("Invalid "+a+" constructor. Too many arguments.");if(1===h){var f=o[0];o.push(f,f,f)}return"vec2"===a?e.fromArray(o,0,J.getCartesian2()):"vec3"===a?t.fromArray(o,0,J.getCartesian3()):"vec4"===a?r.fromArray(o,0,J.getCartesian4()):void 0},E.prototype._evaluateLiteralString=function(e,t){return this._value},E.prototype._evaluateVariableString=function(e,t){for(var r=this._value,i=te.exec(r);null!==i;){var n=i[0],a=i[1],s=t.getProperty(a);o(s)||(s=""),r=r.replace(n,s),i=te.exec(r)}return r},E.prototype._evaluateVariable=function(e,t){return t.getProperty(this._value)},E.prototype._evaluateMemberDot=function(i,n){if(j(this._left))return n.getProperty(this._right.evaluate(i,n));var a=this._left.evaluate(i,n);if(o(a)){var s=this._right.evaluate(i,n);if(a instanceof e||a instanceof t||a instanceof r){if("r"===s)return a.x;if("g"===s)return a.y;if("b"===s)return a.z;if("a"===s)return a.w}return a[s]}},E.prototype._evaluateMemberBrackets=function(i,n){if(j(this._left))return n.getProperty(this._right.evaluate(i,n));var a=this._left.evaluate(i,n);if(o(a)){var s=this._right.evaluate(i,n);if(a instanceof e||a instanceof t||a instanceof r){if(0===s||"r"===s)return a.x;if(1===s||"g"===s)return a.y;if(2===s||"b"===s)return a.z;if(3===s||"a"===s)return a.w}return a[s]}},E.prototype._evaluateArray=function(e,t){for(var r=[],i=0;i" requires number arguments. Arguments are '+r+" and "+i+".");return r>i},E.prototype._evaluateGreaterThanOrEquals=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if("number"!=typeof r||"number"!=typeof i)throw new c('Operator ">=" requires number arguments. Arguments are '+r+" and "+i+".");return r>=i},E.prototype._evaluateOr=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "||" requires boolean arguments. First argument is '+r+".");if(r)return!0;var i=this._right.evaluate(e,t);if("boolean"!=typeof i)throw new c('Operator "||" requires boolean arguments. Second argument is '+i+".");return r||i},E.prototype._evaluateAnd=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "&&" requires boolean arguments. First argument is '+r+".");if(!r)return!1;var i=this._right.evaluate(e,t);if("boolean"!=typeof i)throw new c('Operator "&&" requires boolean arguments. Second argument is '+i+".");return r&&i},E.prototype._evaluatePlus=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.add(o,a,J.getCartesian2());if(a instanceof t&&o instanceof t)return t.add(o,a,J.getCartesian3());if(a instanceof r&&o instanceof r)return r.add(o,a,J.getCartesian4());if("string"==typeof o||"string"==typeof a)return o+a;if("number"==typeof o&&"number"==typeof a)return o+a;throw new c('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+o+" and "+a+".")},E.prototype._evaluateMinus=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.subtract(o,a,J.getCartesian2());if(a instanceof t&&o instanceof t)return t.subtract(o,a,J.getCartesian3());if(a instanceof r&&o instanceof r)return r.subtract(o,a,J.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o-a;throw new c('Operator "-" requires vector or number arguments of matching types. Arguments are '+o+" and "+a+".")},E.prototype._evaluateTimes=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.multiplyComponents(o,a,J.getCartesian2());if(a instanceof e&&"number"==typeof o)return e.multiplyByScalar(a,o,J.getCartesian2());if(o instanceof e&&"number"==typeof a)return e.multiplyByScalar(o,a,J.getCartesian2());if(a instanceof t&&o instanceof t)return t.multiplyComponents(o,a,J.getCartesian3());if(a instanceof t&&"number"==typeof o)return t.multiplyByScalar(a,o,J.getCartesian3());if(o instanceof t&&"number"==typeof a)return t.multiplyByScalar(o,a,J.getCartesian3());if(a instanceof r&&o instanceof r)return r.multiplyComponents(o,a,J.getCartesian4());if(a instanceof r&&"number"==typeof o)return r.multiplyByScalar(a,o,J.getCartesian4());if(o instanceof r&&"number"==typeof a)return r.multiplyByScalar(o,a,J.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o*a;throw new c('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+o+" and "+a+".")},E.prototype._evaluateDivide=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.divideComponents(o,a,J.getCartesian2());if(o instanceof e&&"number"==typeof a)return e.divideByScalar(o,a,J.getCartesian2());if(a instanceof t&&o instanceof t)return t.divideComponents(o,a,J.getCartesian3());if(o instanceof t&&"number"==typeof a)return t.divideByScalar(o,a,J.getCartesian3());if(a instanceof r&&o instanceof r)return r.divideComponents(o,a,J.getCartesian4());if(o instanceof r&&"number"==typeof a)return r.divideByScalar(o,a,J.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o/a;throw new c('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+o+" and "+a+".")},E.prototype._evaluateMod=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.fromElements(o.x%a.x,o.y%a.y,J.getCartesian2());if(a instanceof t&&o instanceof t)return t.fromElements(o.x%a.x,o.y%a.y,o.z%a.z,J.getCartesian3());if(a instanceof r&&o instanceof r)return r.fromElements(o.x%a.x,o.y%a.y,o.z%a.z,o.w%a.w,J.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o%a;throw new c('Operator "%" requires vector or number arguments of matching types. Arguments are '+o+" and "+a+".")},E.prototype._evaluateEqualsStrict=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);return a instanceof e&&o instanceof e||a instanceof t&&o instanceof t||a instanceof r&&o instanceof r?o.equals(a):o===a},E.prototype._evaluateNotEqualsStrict=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);return a instanceof e&&o instanceof e||a instanceof t&&o instanceof t||a instanceof r&&o instanceof r?!o.equals(a):o!==a},E.prototype._evaluateConditional=function(e,t){var r=this._test.evaluate(e,t);if("boolean"!=typeof r)throw new c("Conditional argument of conditional expression must be a boolean. Argument is "+r+".");return r?this._left.evaluate(e,t):this._right.evaluate(e,t)},E.prototype._evaluateNaN=function(e,t){return isNaN(this._left.evaluate(e,t))},E.prototype._evaluateIsFinite=function(e,t){return isFinite(this._left.evaluate(e,t))},E.prototype._evaluateIsExactClass=function(e,t){return t.isExactClass(this._left.evaluate(e,t))},E.prototype._evaluateIsClass=function(e,t){return t.isClass(this._left.evaluate(e,t))},E.prototype._evaluategetExactClassName=function(e,t){return t.getExactClassName()},E.prototype._evaluateBooleanConversion=function(e,t){return Boolean(this._left.evaluate(e,t))},E.prototype._evaluateNumberConversion=function(e,t){return Number(this._left.evaluate(e,t))},E.prototype._evaluateStringConversion=function(e,t){return String(this._left.evaluate(e,t))},E.prototype._evaluateRegExp=function(e,t){var r=this._value.evaluate(e,t),i="";o(this._left)&&(i=this._left.evaluate(e,t));var n;try{n=new RegExp(r,i)}catch(e){throw new c(e)}return n},E.prototype._evaluateRegExpTest=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(!(r instanceof RegExp&&"string"==typeof i))throw new c("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+r+" and "+i+".");return r.test(i)},E.prototype._evaluateRegExpMatch=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(r instanceof RegExp&&"string"==typeof i)return r.test(i);if(i instanceof RegExp&&"string"==typeof r)return i.test(r);throw new c('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+r+" and "+i+".")},E.prototype._evaluateRegExpNotMatch=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(r instanceof RegExp&&"string"==typeof i)return!r.test(i);if(i instanceof RegExp&&"string"==typeof r)return!i.test(r);throw new c('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+r+" and "+i+".")},E.prototype._evaluateRegExpExec=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(!(r instanceof RegExp&&"string"==typeof i))throw new c("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+r+" and "+i+".");var n=r.exec(i);return o(n)?n[1]:null},E.prototype._evaluateToString=function(i,n){var o=this._left.evaluate(i,n);if(o instanceof RegExp||o instanceof e||o instanceof t||o instanceof r)return String(o);throw new c('Unexpected function call "'+this._value+'".')},E.prototype.getShaderExpression=function(e,t,r){var i,a,s,u,d=this._type,p=this._value;switch(o(this._left)&&(a=l(this._left)?K(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),o(this._right)&&(s=this._right.getShaderExpression(e,t,this)),o(this._test)&&(u=this._test.getShaderExpression(e,t,this)),l(this._value)&&(p=K(this._value,e,t,this)),d){case h.VARIABLE:return e+p;case h.UNARY:if("Boolean"===p)return"bool("+a+")";if("Number"===p)return"float("+a+")";if("round"===p)return"floor("+a+" + 0.5)";if(o(ae[p]))return p+"("+a+")";if("isNaN"===p||"isFinite"===p||"String"===p||"isExactClass"===p||"isClass"===p||"getExactClassName"===p)throw new c('Error generating style shader: "'+p+'" is not supported.');return o(ae[p])?p+"("+a+")":p+a;case h.BINARY:return"%"===p?"mod("+a+", "+s+")":"==="===p?"("+a+" == "+s+")":"!=="===p?"("+a+" != "+s+")":"atan2"===p?"atan("+a+", "+s+")":o(se[p])?p+"("+a+", "+s+")":"("+a+" "+p+" "+s+")";case h.TERNARY:if(o(le[p]))return p+"("+a+", "+s+", "+u+")";break;case h.CONDITIONAL:return"("+u+" ? "+a+" : "+s+")";case h.MEMBER:return"r"===s||"x"===s||"0.0"===s?a+"[0]":"g"===s||"y"===s||"1.0"===s?a+"[1]":"b"===s||"z"===s||"2.0"===s?a+"[2]":"a"===s||"w"===s||"3.0"===s?a+"[3]":a+"[int("+s+")]";case h.FUNCTION_CALL:throw new c('Error generating style shader: "'+p+'" is not supported.');case h.ARRAY:if(4===p.length)return"vec4("+p[0]+", "+p[1]+", "+p[2]+", "+p[3]+")";if(3===p.length)return"vec3("+p[0]+", "+p[1]+", "+p[2]+")";if(2===p.length)return"vec2("+p[0]+", "+p[1]+")";throw new c("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case h.REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.VARIABLE_IN_STRING:throw new c("Error generating style shader: Converting a variable to a string is not supported.");case h.LITERAL_NULL:throw new c("Error generating style shader: null is not supported.");case h.LITERAL_BOOLEAN:return p?"true":"false";case h.LITERAL_NUMBER:return X(p);case h.LITERAL_STRING:if(o(r)&&r._type===h.MEMBER&&("r"===p||"g"===p||"b"===p||"a"===p||"x"===p||"y"===p||"z"===p||"w"===p))return p;if(i=n.fromCssColorString(p,oe),o(i))return Q(i);throw new c("Error generating style shader: String literals are not supported.");case h.LITERAL_COLOR:var f=a;if("color"===p){if(!o(f))return"vec4(1.0)";if(f.length>1){var m=f[0],g=f[1];return"1.0"!==g&&(t.translucent=!0),"vec4("+m+", "+g+")"}return"vec4("+f[0]+", 1.0)"}if("rgb"===p)return i=Y(this),o(i)?Z(i):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, 1.0)";if("rgba"===p)return"1.0"!==f[3]&&(t.translucent=!0),i=Y(this),o(i)?Z(i):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, "+f[3]+")";if("hsl"===p)return i=q(this),o(i)?Z(i):"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), 1.0)";if("hsla"===p)return i=q(this),o(i)?(1!==i.alpha&&(t.translucent=!0),Z(i)):("1.0"!==f[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), "+f[3]+")");break;case h.LITERAL_VECTOR:for(var v=a.length,_=p+"(",y=0;y=0&&u1&&(r=r.length>=n?r:new Array(n-r.toString().length+1).join("0")+r)}}return r}function P(e,t,r,i){return x(e,"{x}",t)}function A(e,t,r,i){return x(e,"{reverseX}",e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1)}function D(e,t,r,i){return x(e,"{y}",r)}function I(e,t,r,i){return x(e,"{reverseY}",e.tilingScheme.getNumberOfYTilesAtLevel(i)-r-1)}function O(e,t,r,i){var n=e.maximumLevel;return x(e,"{reverseZ}",a(n)&&i0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new _({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=v.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var r=e.credit;"string"==typeof r&&(r=new n(r)),t._credit=r;var i,s={},l={};for(i in ie)ie.hasOwnProperty(i)&&(s[i]=ie[i]);for(i in ne)ne.hasOwnProperty(i)&&(l[i]=ne[i]);var u=e.customTags;if(a(u))for(i in u)if(u.hasOwnProperty(i)){var c="{"+i+"}";s[c]=u[i],l[c]=u[i]}return t._urlParts=E(t._url,s),t._pickFeaturesUrlParts=E(t._pickFeaturesUrl,l),!0})},C.prototype.getTileCredits=function(e,t,r){},C.prototype.requestImage=function(e,t,r,i){var n=w(this,e,t,r);return b.loadImage(this,n,i)},C.prototype.pickFeatures=function(e,t,r,i,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=S(u,e,t,r,i,n,a.format);return++l,"json"===a.type?h(c).then(a.callback).otherwise(s):"xml"===a.type?m(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):f({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var oe=!1,ae=new v,se=!1,le=new v,ue=!1,ce=new e,de=!1,he=new v,pe=new t,fe=new r;return C}),define("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o){"use strict";function a(r){r=t(r,{});var a=t(r.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(r.fileExtension,"png"),c=new n({ellipsoid:r.ellipsoid}),d=t(r.minimumLevel,0),h=r.maximumLevel,p=t(r.rectangle,c.rectangle),f=c.positionToTileXY(i.southwest(p),d),m=c.positionToTileXY(i.northeast(p),d),g=(Math.abs(m.x-f.x),Math.abs(m.y-f.y),t(r.credit,l));return"string"==typeof g&&(g=new e(g)),new o({url:a+"{z}/{x}/{y}."+u,proxy:r.proxy,credit:g,tilingScheme:c,tileWidth:256,tileHeight:256,minimumLevel:d,maximumLevel:h,rectangle:p})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),define("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,t.EMPTY_OBJECT);var u=[],c=i.geometry;r(c.attributes)&&r(c.primitiveType)||(c=c.constructor.createGeometry(c));var d=c.attributes,h=a.clone(t(i.modelMatrix,a.IDENTITY)),p=t(i.length,1e4);if(r(d.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:h})),r(d.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:h})),r(d.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:h})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(n){function f(s){for(var h,p,f,m=/tileformat/i,C=/tileset/i,w=/tilesets/i,S=/boundingbox/i,T=[],E=s.childNodes[0].childNodes,x=0;xk.rectangle.east&&(F.east=k.rectangle.east),F.southk.rectangle.north&&(F.north=k.rectangle.north);var W=k.positionToTileXY(l.southwest(F),R),j=k.positionToTileXY(l.northeast(F),R);(Math.abs(j.x-W.x)+1)*(Math.abs(j.y-W.y)+1)>4&&(R=0);var q=a(_,"{z}/{x}/{reverseY}."+I);y.resolve({url:q,tilingScheme:k,rectangle:F,tileWidth:O,tileHeight:M,minimumLevel:R,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function m(e){var t=r(n.fileExtension,"png"),o=r(n.tileWidth,256),s=r(n.tileHeight,256),l=r(n.minimumLevel,0),u=n.maximumLevel,c=i(n.tilingScheme)?n.tilingScheme:new d({ellipsoid:n.ellipsoid}),h=r(n.rectangle,c.rectangle),p=a(_,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:h,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function g(){var e=a(_,"tilemapresource.xml"),t=n.proxy;i(t)&&(e=t.getURL(e)),s(e).then(f).otherwise(m)}n=r(n,{});var v,_=n.url,y=h.defer(),b=new p(y.promise);return g(),b}return f}),define("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,t,i){if(!r(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=i,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!r(e.element)){var i=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",r(i)&&(a.alt=i,a.title=i),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,r){for(var i=t.length,n=0;n= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}), define("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),define("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(t){t=n(t,n.EMPTY_OBJECT),this.center=r.clone(n(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,C.fromType(C.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._owner,this)});var i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}}function T(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(o(i))return i;var n=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:u.POSITION_ONLY}));return i=g.fromGeometry({context:e,geometry:n,attributeLocations:E,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var E={position:0};return S.prototype.update=function(t){if(this.show&&t.mode===w.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:b.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=T(n));var u=!1,c=this.radii;if(!r.equals(this._radii,c)){r.clone(c,this._radii);var d=this._oneOverEllipsoidRadiiSquared;d.x=1/(c.x*c.x),d.y=1/(c.y*c.y),d.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var g=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var S,x=this._colorCommand;(g||C||s)&&(S=new m({sources:[this.material.shaderSource,v]}),this.onlySunLighting&&S.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&S.defines.push("WRITE_DEPTH"),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:E}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=i(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var P=t.commandList,A=t.passes;if(A.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?h.TRANSLUCENT:h.OPAQUE,P.push(x)),A.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(g||C||!o(this._pickSP))&&(S=new m({sources:[this.material.shaderSource,v],pickColorQualifier:"uniform"}),this.onlySunLighting&&S.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&S.defines.push("WRITE_DEPTH"),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:E}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?h.TRANSLUCENT:h.OPAQUE,P.push(D)}}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},S}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),l=e(r.aboveGround,!1);this.material=t(r.material)?r.material:s.fromType(s.ColorType),this.translucent=e(r.translucent,!0),this._vertexShaderSource=e(r.vertexShaderSource,o),this._fragmentShaderSource=e(r.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(i,!l,r.renderState),this._closed=!1,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,l),this._aboveGround=l}return r(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=i.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),define("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,r,i){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.1}function o(e){var t=a,r=t.length;if(et[r-1])return h=r-2;if(e>=t[h]){if(h+1=0&&e>=t[h-1])return--h;var i;for(i=0;i=t[i]&&e8e5||n.mode!==i.SCENE3D)return void(n.fog.enabled=!1);var h=d.height,f=o(h),m=r.clamp((h-a[f])/(a[f+1]-a[f]),0,1),g=r.lerp(s[f],s[f+1],m),v=1e6*this.density;g=g*(v-v/u*c)*1e-6;var _=e.normalize(l.positionWC,p);g*=1-Math.abs(e.dot(l.directionWC,_)),n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor,n.fog.minimumBrightness=this.minimumBrightness}},n}),define("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){function i(){c(n)}this._scene=r.scene,this.samplingWindow=e(r.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(r.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(r.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(r.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(r.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,i,!1)})}function u(e,t){if(!(e._pauseCount>0)){var r=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=r+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(r>=e._quietPeriodEndTime){e._frameTimes.push(r);var i=r-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},r(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){1===++this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,r,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1,depth:!1},this.creditDisplay=r,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0}return t}),define("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function r(r,i){this.near=e(r,0),this.far=e(i,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n"}),define("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/FXAA","../ThirdParty/Shaders/FXAA3_11"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0;var t=new a({color:new r(0,0,0,0),depth:1,owner:this});this._clearCommand=t,this._qualityPreset=39}function b(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,i(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return y.prototype.update=function(r,n){var a=r.drawingBufferWidth,y=r.drawingBufferHeight,b=this._texture,C=!i(b)||b.width!==a||b.height!==y;if(C&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new p({context:r,width:a,height:y,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE,sampler:new h({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:f.LINEAR})}),r.depthTexture?this._depthStencilTexture=new p({context:r,width:a,height:y,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:r,width:a,height:y,format:c.DEPTH_STENCIL})),i(this._fbo)&&!C||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:r,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),!i(this._command)){var w="#define FXAA_QUALITY_PRESET "+this._qualityPreset+"\n"+_+"\n"+v;this._command=r.createViewportQuadCommand(w,{owner:this})}this._viewport.width=a,this._viewport.height=y;var S=!e.equals(this._viewport,n.viewport),T=S!==this._useScissorTest;if(this._useScissorTest=S,e.equals(this._scissorRectangle,n.viewport)||(this._scissorRectangle=e.clone(n.viewport,this._scissorRectangle),T=!0),i(this._rs)&&e.equals(this._rs.viewport,this._viewport)&&!T||(this._rs=d.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),this._command.renderState=this._rs,C){var E=this,x=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return E._texture},u_fxaaQualityRcpFrame:function(){return x}}}},y.prototype.execute=function(e,t){this._command.execute(e,t)},y.prototype.clear=function(e,t,i){var n=t.framebuffer;t.framebuffer=this._fbo,r.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},y.prototype.getColorFramebuffer=function(){return this._fbo},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return b(this),n(this)},y}),define("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,r,i,n){"use strict";function o(e,r,i){this.type=e,t(r)||("json"===e?r="application/json":"xml"===e?r="text/xml":"html"===e?r="text/html":"text"===e&&(r="text/plain")),this.format=r,t(i)||("json"===e?i=a:"xml"===e?i=s:"html"===e?i=m:"text"===e&&(i=m)),this.callback=i}function a(r){for(var i=[],o=r.features,a=0;a0)for(var o=0;o1&&(t=r[1]);var i=new n;return i.name=t,i.description=e,i.data=e,[i]}}var g="http://www.mapinfo.com/mxp",v="http://www.esri.com/wms",_="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",b=/\s*<\/body>/im,C=//im,w=/([\s\S]*)<\/title>/im;return o}),define("Shaders/GlobeFS",[],function(){"use strict" ;return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\n#if defined(FOG) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\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 textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),define("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),define("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),define("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,r,i,n){"use strict";function o(e,t,r){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=r}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t;switch(e){case n.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case n.SCENE2D:case n.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case n.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function l(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}return a.prototype.getShaderProgram=function(t,n,a,u,c,d,h,p,f,m,g,v,_,y,b,C){var w=0,S="",T=n.pickTerrain.mesh.encoding;T.quantization===r.BITS12&&(w=1,S="QUANTIZATION_BITS12");var E=t.mode,x=E|u<<2|c<<3|d<<4|h<<5|p<<6|f<<7|g<<8|v<<9|_<<10|y<<11|b<<12|C<<13|w<<14|m<<15,P=n.surfaceShader;if(e(P)&&P.numberOfDayTextures===a&&P.flags===x)return P.shaderProgram;var A=this._shadersByTexturesFlags[a];if(e(A)||(A=this._shadersByTexturesFlags[a]=[]),P=A[x],!e(P)){var D=this.baseVertexShaderSource.clone(),I=this.baseFragmentShaderSource.clone();D.defines.push(S),I.defines.push("TEXTURE_UNITS "+a),u&&I.defines.push("APPLY_BRIGHTNESS"),c&&I.defines.push("APPLY_CONTRAST"),d&&I.defines.push("APPLY_HUE"),h&&I.defines.push("APPLY_SATURATION"),p&&I.defines.push("APPLY_GAMMA"),f&&I.defines.push("APPLY_ALPHA"),g&&(I.defines.push("SHOW_REFLECTIVE_OCEAN"),D.defines.push("SHOW_REFLECTIVE_OCEAN")),v&&I.defines.push("SHOW_OCEAN_WAVES"),_&&(y?(D.defines.push("ENABLE_VERTEX_LIGHTING"),I.defines.push("ENABLE_VERTEX_LIGHTING")):(D.defines.push("ENABLE_DAYNIGHT_SHADING"),I.defines.push("ENABLE_DAYNIGHT_SHADING"))),D.defines.push("INCLUDE_WEB_MERCATOR_Y"),I.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(D.defines.push("FOG"),I.defines.push("FOG")),m&&I.defines.push("APPLY_SPLIT");for(var O=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",M=0;M<a;++M)O+=" color = sampleAndBlend(\n color,\n u_dayTextures["+M+"],\n u_dayTextureUseWebMercatorT["+M+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+M+"],\n u_dayTextureTranslationAndScale["+M+"],\n "+(f?"u_dayTextureAlpha["+M+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+M+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+M+"]":"0.0")+",\n "+(d?"u_dayTextureHue["+M+"]":"0.0")+",\n "+(h?"u_dayTextureSaturation["+M+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+M+"]":"0.0")+",\n "+(m?"u_dayTextureSplit["+M+"]":"0.0")+"\n );\n";O+=" return color;\n }",I.sources.push(O),D.sources.push(s(E)),D.sources.push(l(b));var R=i.fromCache({context:t.context,vertexShaderSource:D,fragmentShaderSource:I,attributeLocations:T.getAttributeLocations()});P=A[x]=new o(a,x,R)}return n.surfaceShader=P,P.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding;c.quantization===r.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,h=d|o<<2|a<<3,p=this._pickShaderPrograms[h];if(!e(p)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));p=this._pickShaderPrograms[h]=i.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:"void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n",attributeLocations:c.getAttributeLocations()})}return p},a.prototype.destroy=function(){var r,i,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(r in a)a.hasOwnProperty(r)&&(i=a[r],e(i)&&i.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(r in s)s.hasOwnProperty(r)&&(i=s[r],i.destroy());return t(this)},a}),define("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7})}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";return e({START:0,LOADING:1,DONE:2,FAILED:3})}),define("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";return e({FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6})}),define("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/Request","../Core/RequestState","../Core/RequestType","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.state=f.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e,this.request=void 0}function g(e,t,i,n,o,c){function d(t){e.data=t,e.state=f.RECEIVED,e.request=void 0}function h(){if(e.request.state===s.CANCELLED)return e.data=void 0,e.state=f.UNLOADED,void(e.request=void 0);e.state=f.FAILED,e.request=void 0;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=u.handleError(t._requestError,t,t.errorEvent,r,i,n,o,m)}function m(){var s=new a({throttle:!0,throttleByServer:!0,type:l.TERRAIN,priorityFunction:c});e.request=s,e.data=t.requestTileGeometry(i,n,o,s),r(e.data)?(e.state=f.RECEIVING,p(e.data,d,h)):(e.state=f.UNLOADED,e.request=void 0)}m()}function v(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=f.TRANSFORMING,p(u,function(t){e.mesh=t,e.state=f.TRANSFORMED},function(){e.state=f.FAILED}))}function _(e,t,i,o,a,s){var l=e.mesh.vertices,u=c.createVertexBuffer({context:t,typedArray:l,usage:d.STATIC_DRAW}),p=e.mesh.encoding.getAttributes(u),m=e.mesh.indices.indexBuffers||{},g=m[t.id];if(!r(g)||g.isDestroyed()){var v=e.mesh.indices,_=2===v.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;g=c.createIndexBuffer({context:t,typedArray:v,usage:d.STATIC_DRAW,indexDatatype:_}),g.vertexArrayDestroyable=!1,g.referenceCount=1,m[t.id]=g,e.mesh.indices.indexBuffers=m}else++g.referenceCount;e.vertexArray=new h({context:t,attributes:p,indexBuffer:g}),e.state=f.READY}return m.prototype.freeResources=function(){if(this.state=f.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&0===--e.referenceCount&&e.destroy()}},m.prototype.publishToTile=function(r){var i=r.data,n=this.mesh;t.clone(n.center,i.center),i.minimumHeight=n.minimumHeight,i.maximumHeight=n.maximumHeight,i.boundingSphere3D=e.clone(n.boundingSphere3D,i.boundingSphere3D),i.orientedBoundingBox=o.clone(n.orientedBoundingBox,i.orientedBoundingBox),i.tileBoundingRegion.minimumHeight=n.minimumHeight,i.tileBoundingRegion.maximumHeight=n.maximumHeight,r.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,i.occludeePointInScaledSpace)},m.prototype.processLoadStateMachine=function(e,t,r,i,n,o){this.state===f.UNLOADED&&g(this,t,r,i,n,o),this.state===f.RECEIVED&&v(this,e,t,r,i,n),this.state===f.TRANSFORMED&&_(this,e.context,t,r,i,n)},m.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===f.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,c=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,c,i,n,o),!r(this.data))return;this.state=f.RECEIVING;var d=this;p(this.data,function(e){d.data=e,d.state=f.RECEIVED},function(){d.state=f.FAILED})}this.state===f.RECEIVED&&v(this,e,t,i,n,o),this.state===f.TRANSFORMED&&_(this,e.context,t,i,n,o)},m}),define("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingRegion","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,r,i,o,a,s){if(e.decodePosition(o,a,s),n(r)&&r!==g.SCENE3D){var l=i.ellipsoid,u=l.cartesianToCartographic(s);i.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e){var t,r;return n(e.parent)&&n(e.parent.data)&&(t=e.parent.data.minimumHeight,r=e.parent.data.maximumHeight),new _({rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:t,maximumHeight:r})}function S(e,t){return function(){return e.tileBoundingRegion.distanceToCamera(t)}}function T(e,t,r){var i=e.data,o=x(e);n(o)&&(i.upsampledTerrain=new y(o)),O(e,t)&&(i.loadedTerrain=new y);for(var a=0,s=r.length;a<s;++a){var l=r.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function E(e,t,r,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,r,e.x,e.y,e.level,e._priorityFunction),s.state>=v.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,R(t.context,a),D(e)),u=!0),s.state===v.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=i(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===v.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,r,e.x,e.y,e.level),l.state>=v.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,r.hasWaterMask&&L(e),P(e)),l.state===v.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===v.FAILED&&(a.upsampledTerrain=void 0))}function x(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 P(e){A(e,e._southwestChild),A(e,e._southeastChild),A(e,e._northwestChild),A(e,e._northeastChild)}function A(e,t){if(n(t)&&t.state!==m.START){var r=t.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new y({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=m.LOADING}}function D(e){var t=e.data;I(e,t,e.southwestChild),I(e,t,e.southeastChild),I(e,t,e.northwestChild),I(e,t,e.northeastChild)}function I(e,t,r){if(r.state!==m.START){var i=r.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new y({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(n(i.loadedTerrain)||(i.loadedTerrain=new y)),r.state=m.LOADING}}function O(e,t){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(n(r))return r;var i=e.parent;return!n(i)||!(!n(i.data)||!n(i.data.terrainData))&&i.data.terrainData.isChildAvailable(i.x,i.y,e.x,e.y)}function M(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var r=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});r.referenceCount=1;t={allWaterTexture:r,sampler:new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:h.LINEAR,magnificationFilter:d.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function R(e,t){var i=t.waterMaskTexture;n(i)&&(--i.referenceCount,0===i.referenceCount&&i.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=M(e),d=o.length;if(1===d){if(0===o[0])return;a=u.allWaterTexture}else{var h=Math.sqrt(d);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,r.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function L(e){for(var t=e.data,r=e.parent;n(r)&&!n(r.data.terrainData)||r.data.terrainData.wasCreatedByUpsampling();)r=r.parent;if(n(r)&&n(r.data.waterMaskTexture)){t.waterMaskTexture=r.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var i=r.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/i.width,u=s/i.height;t.waterMaskTranslationAndScale.x=l*(o.west-i.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-i.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(b.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===v.RECEIVING||e.state===v.TRANSFORMING),r=this.upsampledTerrain,i=n(r)&&(r.state===v.RECEIVING||r.state===v.TRANSFORMING),o=!t&&!i,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return o}}});var N=new t,k=new t,F=new t,B=new t;return b.prototype.pick=function(e,r,i,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,d=u.indices,h=u.encoding,p=d.length,f=0;f<p;f+=3){ var m=d[f],g=d[f+1],v=d[f+2],_=C(h,r,i,c,m,N),y=C(h,r,i,c,g,k),b=C(h,r,i,c,v,F),w=a.rayTriangle(e,_,y,b,o,B);if(n(w))return t.clone(w,s)}}},b.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,r=this.imagery;for(e=0,t=r.length;e<t;++e)r[e].freeResources();this.imagery.length=0,this.freeVertexArray()},b.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&0===--e.referenceCount&&e.destroy()),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&0===--e.referenceCount&&e.destroy())},b.processStateMachine=function(e,t,r,i,o){var a=e.data;n(a)||(a=e.data=new b,a.tileBoundingRegion=w(e)),n(e._priorityFunction)||(e._priorityFunction=S(a,t)),e.state===m.START&&(T(e,r,i),e.state=m.LOADING),e.state===m.LOADING&&E(e,t,r,o);var s,l,u=n(a.vertexArray),c=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),d=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),h=a.imagery;for(s=0,l=h.length;s<l;++s){var p=h[s];if(n(p.loadingImagery)){if(p.loadingImagery.state===f.PLACEHOLDER){var g=p.loadingImagery.imageryLayer;if(g.imageryProvider.ready){p.freeResources(),h.splice(s,1),g._createTileImagerySkeletons(e,r,s),--s,l=h.length;continue}d=!1}var v=p.processStateMachine(e,t);c=c&&v,u=u&&(v||n(p.readyImagery)),d=d&&n(p.loadingImagery)&&(p.loadingImagery.state===f.FAILED||p.loadingImagery.state===f.INVALID)}else d=!1}if(e.upsampledFromParent=d,s===l&&(u&&(e.renderable=!0),c)){var _=[];e._loadedCallbacks.forEach(function(t){t(e)||_.push(t)}),e._loadedCallbacks=_,e.state=m.DONE,e._priorityFunction=void 0}},b}),define("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),define("Scene/Imagery",["../Core/defined","../Core/destroyObject","../Core/RequestState","./ImageryState"],function(e,t,r,i){"use strict";function n(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,this.request=void 0,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){a=t.imageryProvider.tilingScheme.tileXYToRectangle(r,n,o)}this.rectangle=a}return n.createPlaceholder=function(e){var t=new n(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},n.prototype.addReference=function(){++this.referenceCount},n.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},n.prototype.processStateMachine=function(e,t,r){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this,r)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var n=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||n)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},n}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";return e({LEFT:-1,NONE:0,RIGHT:1})}),define("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function r(e,t,r){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=r}return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(i,!this.useWebMercatorT,r._priorityFunction),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(i,!this.useWebMercatorT,r._priorityFunction),!1))},r}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/Request","../Core/RequestState","../Core/RequestType","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B){"use strict";function U(e,t){this._imageryProvider=e,t=r(t,{}),this.alpha=r(t.alpha,r(e.defaultAlpha,1)),this.brightness=r(t.brightness,r(e.defaultBrightness,U.DEFAULT_BRIGHTNESS)),this.contrast=r(t.contrast,r(e.defaultContrast,U.DEFAULT_CONTRAST)),this.hue=r(t.hue,r(e.defaultHue,U.DEFAULT_HUE)),this.saturation=r(t.saturation,r(e.defaultSaturation,U.DEFAULT_SATURATION)),this.gamma=r(t.gamma,r(e.defaultGamma,U.DEFAULT_GAMMA)),this.splitDirection=r(t.splitDirection,r(e.defaultSplit,U.DEFAULT_SPLIT)),this.minificationFilter=r(t.minificationFilter,r(e.defaultMinificationFilter,U.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=r(t.magnificationFilter,r(e.defaultMagnificationFilter,U.DEFAULT_MAGNIFICATION_FILTER)),this.show=r(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=r(t.rectangle,d.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new B(N.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function V(e,t,r){return e+":"+t+":"+r}function z(e,t,n,o){var a=e.minificationFilter,s=e.magnificationFilter;if(a===D.LINEAR&&s===A.LINEAR&&!c.isCompressedFormat(o.pixelFormat)&&u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){a=D.LINEAR_MIPMAP_LINEAR;var l=w.maximumTextureFilterAnisotropy,d=Math.min(l,r(e._maximumAnisotropy,l)),h=V(a,s,d),p=t.cache.imageryLayerMipmapSamplers;i(p)||(p={},t.cache.imageryLayerMipmapSamplers=p);var f=p[h];i(f)||(f=p[h]=new T({wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,minificationFilter:a,magnificationFilter:s,maximumAnisotropy:d})),o.generateMipmap(S.NICEST),o.sampler=f}else{var m=V(a,s,0),g=t.cache.imageryLayerNonMipmapSamplers;i(g)||(g={},t.cache.imageryLayerNonMipmapSamplers=g);var v=g[m];i(v)||(v=g[m]=new T({wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,minificationFilter:a,magnificationFilter:s})),o.sampler=v}n.state=F.READY}function G(e,t,r){return JSON.stringify([e,t,r])}function H(e,t,r,n){var o=t.cache.imageryLayer_reproject;if(!i(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){i(this.framebuffer)&&this.framebuffer.destroy(),i(this.vertexArray)&&this.vertexArray.destroy(),i(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var d=c/63;a[s++]=0,a[s++]=d,a[s++]=1,a[s++]=d}var h={position:0,webMercatorT:1},p=m.getRegularGridIndices(2,64),f=y.createIndexBuffer({context:t,typedArray:p,usage:b.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new O({context:t,attributes:[{index:h.position,vertexBuffer:y.createVertexBuffer({context:t,typedArray:a,usage:b.STATIC_DRAW}),componentsPerAttribute:2},{index:h.webMercatorT,vertexBuffer:y.createVertexBuffer({context:t,sizeInBytes:512,usage:b.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var g=new x({sources:[R]});o.shaderProgram=E.fromCache({context:t,vertexShaderSource:g,fragmentShaderSource:M,attributeLocations:h}),o.sampler=new T({wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,minificationFilter:D.LINEAR,magnificationFilter:A.LINEAR})}r.sampler=o.sampler;var v=r.width,_=r.height;Q.textureDimensions.x=v,Q.textureDimensions.y=_,Q.texture=r;var C=Math.sin(n.south),w=.5*Math.log((1+C)/(1-C));C=Math.sin(n.north);var L=.5*Math.log((1+C)/(1-C)),N=1/(L-w),k=new P({context:t,width:v,height:_,pixelFormat:r.pixelFormat,pixelDatatype:r.pixelDatatype,preMultiplyAlpha:r.preMultiplyAlpha});u.isPowerOfTwo(v)&&u.isPowerOfTwo(_)&&k.generateMipmap(S.NICEST);for(var F=n.south,B=n.north,U=Z,V=0,z=0;z<64;++z){var G=z/63,H=u.lerp(F,B,G);C=Math.sin(H);var W=.5*Math.log((1+C)/(1-C)),j=(W-w)*N;U[V++]=j,U[V++]=j}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(U),e.shaderProgram=o.shaderProgram,e.outputTexture=k,e.uniformMap=Q,e.vertexArray=o.vertexArray}function W(e,t,r){var i=e._imageryProvider,n=i.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(r),l=n.rectangle,u=o.maximumRadius*l.width*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2);return 0|Math.round(d)}n(U.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),U.DEFAULT_BRIGHTNESS=1,U.DEFAULT_CONTRAST=1,U.DEFAULT_HUE=0,U.DEFAULT_SATURATION=1,U.DEFAULT_GAMMA=1,U.DEFAULT_SPLIT=k.NONE,U.DEFAULT_MINIFICATION_FILTER=D.LINEAR,U.DEFAULT_MAGNIFICATION_FILTER=A.LINEAR,U.prototype.isBaseLayer=function(){return this._isBaseLayer},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return o(this)};var j=new d,q=new d,Y=new d,X=new d;U.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return d.intersection(e.rectangle,t)})},U.prototype._createTileImagerySkeletons=function(e,r,n){var o=e.data;if(i(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(i(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(i(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof _&&e.rectangle.north<v.MaximumLatitude&&e.rectangle.south>-v.MaximumLatitude,l=d.intersection(a.rectangle,this._rectangle,j),u=d.intersection(e.rectangle,l,q);if(!i(u)){if(!this.isBaseLayer())return!1;var c=l,h=e.rectangle;u=q,h.south>=c.north?u.north=u.south=c.north:h.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(h.south,c.south),u.north=Math.min(h.north,c.north)),h.west>=c.east?u.west=u.east=c.east:h.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(h.west,c.west),u.east=Math.min(h.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var f=1*r.getLevelMaximumGeometricError(e.level),m=W(this,f,p);m=Math.max(0,m);var g=a.maximumLevel;if(m>g&&(m=g),i(a.minimumLevel)){var y=a.minimumLevel;m<y&&(m=y)}var b=a.tilingScheme,C=b.positionToTileXY(d.northwest(u),m),w=b.positionToTileXY(d.southeast(u),m),S=e.rectangle.width/512,T=e.rectangle.height/512,E=b.tileXYToRectangle(C.x,C.y,m);Math.abs(E.south-e.rectangle.north)<T&&C.y<w.y&&++C.y,Math.abs(E.east-e.rectangle.west)<S&&C.x<w.x&&++C.x;var x=b.tileXYToRectangle(w.x,w.y,m);Math.abs(x.north-e.rectangle.south)<T&&w.y>C.y&&--w.y,Math.abs(x.west-e.rectangle.east)<S&&w.x>C.x&&--w.x;var P,A=d.clone(e.rectangle,X),D=b.tileXYToRectangle(C.x,C.y,m),I=d.intersection(D,l,Y);s?(b.rectangleToNativeRectangle(A,A),b.rectangleToNativeRectangle(D,D),b.rectangleToNativeRectangle(I,I),b.rectangleToNativeRectangle(l,l),P=b.tileXYToNativeRectangle.bind(b),S=A.width/512,T=A.height/512):P=b.tileXYToRectangle.bind(b);var O,M,R=0,L=1;!this.isBaseLayer()&&Math.abs(I.west-A.west)>=S&&(R=Math.min(1,(I.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(I.north-A.north)>=T&&(L=Math.max(0,(I.north-A.south)/A.height));for(var N=L,k=C.x;k<=w.x;k++)if(O=R,D=P(k,C.y,m),I=d.simpleIntersection(D,l,Y),i(I)){R=Math.min(1,(I.east-A.west)/A.width),k===w.x&&(this.isBaseLayer()||Math.abs(I.east-A.east)<S)&&(R=1),L=N;for(var F=C.y;F<=w.y;F++)if(M=L,D=P(k,F,m),I=d.simpleIntersection(D,l,Y),i(I)){L=Math.max(0,(I.south-A.south)/A.height),F===w.y&&(this.isBaseLayer()||Math.abs(I.south-A.south)<T)&&(L=0);var U=new t(O,L,R,M),V=this.getImageryFromCache(k,F,m);o.imagery.splice(n,0,new B(V,U,s)),++n}}return!0},U.prototype._calculateTextureTranslationAndScale=function(e,r){var i=r.readyImagery.rectangle,n=e.rectangle;if(r.useWebMercatorT){var o=r.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=o.rectangleToNativeRectangle(i,j),n=o.rectangleToNativeRectangle(n,X)}var a=n.width,s=n.height,l=a/i.width,u=s/i.height;return new t(l*(n.west-i.west)/a,u*(n.south-i.south)/s,l,u)},U.prototype._requestImagery=function(e,t){function r(t){if(!i(t))return n();e.image=t,e.state=F.RECEIVED,e.request=void 0,g.handleSuccess(s._requestImageError)}function n(t){if(e.request.state===p.CANCELLED)return e.state=F.UNLOADED,void(e.request=void 0);e.state=F.FAILED,e.request=void 0;var r="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";s._requestImageError=g.handleError(s._requestImageError,a,a.errorEvent,r,e.x,e.y,e.level,o,t)}function o(){var o=new h({throttle:!0,throttleByServer:!0,type:f.IMAGERY,priorityFunction:t});e.request=o,e.state=F.TRANSITIONING;var s=a.requestImage(e.x,e.y,e.level,o);if(!i(s))return e.state=F.UNLOADED,void(e.request=void 0);i(a.getTileCredits)&&(e.credits=a.getTileCredits(e.x,e.y,e.level)),L(s,r,n)}var a=this._imageryProvider,s=this;o()},U.prototype._createTexture=function(e,t){var r=this._imageryProvider,n=t.image;if(i(r.tileDiscardPolicy)){var o=r.tileDiscardPolicy;if(i(o)){if(!o.isReady())return void(t.state=F.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=F.INVALID)}}var a,s=new T({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter});a=new P(i(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView},sampler:s}:{context:e,source:n,pixelFormat:r.hasAlphaChannel?c.RGBA:c.RGB,sampler:s}),r.tilingScheme instanceof _?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=F.TEXTURE_LOADED},U.prototype._reprojectTexture=function(e,t,i){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if((i=r(i,!0))&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new C({persists:!0,owner:this,preExecute:function(e){H(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,z(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else i&&(t.texture=n),z(this,a,t,n)},U.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,r=t.length,i=0;i<r;++i)e.commandList.push(t[i]);t.length=0},U.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},U.prototype.getImageryFromCache=function(e,t,r,n){var o=G(e,t,r),a=this._imageryCache[o];return i(a)||(a=new N(this,e,t,r,n),this._imageryCache[o]=a),a.addReference(),a},U.prototype.removeImageryFromCache=function(e){var t=G(e.x,e.y,e.level);delete this._imageryCache[t]};var Q={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},Z=a.supportsTypedArrays()?new Float32Array(128):void 0;return U}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/OrthographicFrustum","../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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=G.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new h,this._imageryLayers.layerAdded.addEventListener(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var r=e.loadingImagery;l(r)||(r=e.readyImagery);var i=t.loadingImagery;return l(i)||(i=t.readyImagery),r.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function j(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&0===--t.referenceCount&&t.destroy()}function q(e,t,r){return function(i){var n,o,a,u=-1,c=i.data.imagery,d=c.length;for(a=0;a<d;++a)if(n=c[a],o=s(n.readyImagery,n.loadingImagery),o.imageryLayer===t){u=a;break}if(-1!==u){var h=u+e;if(n=c[h],o=l(n)?s(n.readyImagery,n.loadingImagery):void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,r,h);for(a=u;a<h;++a)c[a].freeResources();c.splice(u,e)}return!0}}function Y(e){return{u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,r=_.multiplyByPoint(t,this.properties.rtc,ie);return _.setTranslation(t,r,$),$},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,r=e.context.uniformState.projection,i=_.multiplyByPoint(t,this.properties.rtc,ie);return _.setTranslation(t,i,ee),_.multiply(r,ee,ee),ee},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_minimumBrightness:function(){return e.fog.minimumBrightness},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new r(65e5,9e6),center3D:void 0,rtc:new i,modifiedModelView:new _,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new r,southMercatorYAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new r,scaleAndBias:new _}}}function X(e,t,r){var i=r.data;l(i.wireframeVertexArray)||l(i.terrainData)&&l(i.terrainData._mesh)&&(i.wireframeVertexArray=Q(e,i.vertexArray,i.terrainData._mesh))}function Q(e,t,r){var i={indices:r.indices,primitiveType:C.TRIANGLES};f.toWireframe(i);var n=i.indices,o=P.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:m.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function Z(t,r,a){var s=r.data,u=a.creditDisplay,c=s.terrainData;if(l(c)&&l(c.credits))for(var d=c.credits,h=0,p=d.length;h<p;++h)u.addCredit(d[h]);var f=D.maximumTextureImageUnits,m=s.waterMaskTexture,g=t.hasWaterMask&&l(m),b=t.oceanNormalMap,S=g&&l(b),E=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,P=a.fog.enabled,A=G.castShadows(t.shadows),M=G.receiveShadows(t.shadows);g&&--f,S&&--f;var R=s.center,L=s.pickTerrain.mesh.encoding,N=te,k=0,F=0,B=0,V=0,H=!1;if(a.mode!==z.SCENE3D){var W=a.mapProjection,j=W.project(w.southwest(r.rectangle),ne),q=W.project(w.northeast(r.rectangle),oe);if(N.x=j.x,N.y=j.y,N.z=q.x,N.w=q.y,a.mode!==z.MORPHING&&(R=re,R.x=0,R.y=.5*(N.z+N.x),R.z=.5*(N.w+N.y),N.x-=R.y,N.y-=R.z,N.z-=R.y,N.w-=R.z),a.mode===z.SCENE2D&&L.quantization===T.BITS12){var Q=1/(Math.pow(2,12)-1)*.5,Z=(N.z-N.x)*Q,K=(N.w-N.y)*Q;N.x-=Z,N.y-=K,N.z+=Z,N.w+=K}W instanceof x&&(k=r.rectangle.south,F=r.rectangle.north,B=x.geodeticLatitudeToMercatorAngle(k),V=1/(x.geodeticLatitudeToMercatorAngle(F)-B),H=!0)}var J=s.imagery,$=0,ee=J.length,ie=t._renderState,ce=t._blendRenderState,de=ie,he=t._firstPassInitialColor,pe=a.context;l(t._debug.boundingSphereTile)||le();do{var fe,me,ge=0;t._drawCommands.length<=t._usedDrawCommands?(fe=new I,fe.owner=r,fe.cull=!1,fe.boundingVolume=new e,fe.orientedBoundingBox=void 0,me=Y(a),t._drawCommands.push(fe),t._uniformMaps.push(me)):(fe=t._drawCommands[t._usedDrawCommands],me=t._uniformMaps[t._usedDrawCommands]),fe.owner=r,++t._usedDrawCommands,r===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ae(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&se(s.boundingSphere3D,o.RED).update(a));var ve=me.properties;n.clone(he,ve.initialColor),ve.oceanNormalMap=b,ve.lightingFadeDistance.x=t.lightingFadeOutDistance,ve.lightingFadeDistance.y=t.lightingFadeInDistance,ve.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,ve.center3D=s.center,i.clone(R,ve.rtc),n.clone(N,ve.tileRectangle),ve.southAndNorthLatitude.x=k,ve.southAndNorthLatitude.y=F,ve.southMercatorYAndOneOverHeight.x=B,ve.southMercatorYAndOneOverHeight.y=V;for(var _e=P&&v.fog(r._distance,a.fog.density)>v.EPSILON3,ye=!1,be=!1,Ce=!1,we=!1,Se=!1,Te=!1,Ee=!1;ge<f&&$<ee;){var xe=J[$],Pe=xe.readyImagery;if(++$,l(Pe)&&0!==Pe.imageryLayer.alpha){var Ae=xe.useWebMercatorT?Pe.textureWebMercator:Pe.texture,De=Pe.imageryLayer;if(l(xe.textureTranslationAndScale)||(xe.textureTranslationAndScale=De._calculateTextureTranslationAndScale(r,xe)),ve.dayTextures[ge]=Ae,ve.dayTextureTranslationAndScale[ge]=xe.textureTranslationAndScale,ve.dayTextureTexCoordsRectangle[ge]=xe.textureCoordinateRectangle,ve.dayTextureUseWebMercatorT[ge]=xe.useWebMercatorT,ve.dayTextureAlpha[ge]=De.alpha,Te=Te||1!==ve.dayTextureAlpha[ge],ve.dayTextureBrightness[ge]=De.brightness,ye=ye||ve.dayTextureBrightness[ge]!==U.DEFAULT_BRIGHTNESS,ve.dayTextureContrast[ge]=De.contrast,be=be||ve.dayTextureContrast[ge]!==U.DEFAULT_CONTRAST,ve.dayTextureHue[ge]=De.hue,Ce=Ce||ve.dayTextureHue[ge]!==U.DEFAULT_HUE,ve.dayTextureSaturation[ge]=De.saturation,we=we||ve.dayTextureSaturation[ge]!==U.DEFAULT_SATURATION,ve.dayTextureOneOverGamma[ge]=1/De.gamma,Se=Se||ve.dayTextureOneOverGamma[ge]!==1/U.DEFAULT_GAMMA,ve.dayTextureSplit[ge]=De.splitDirection,Ee=Ee||0!==ve.dayTextureSplit[ge],l(Pe.credits))for(var Ie=Pe.credits,Oe=0,Me=Ie.length;Oe<Me;++Oe)u.addCredit(Ie[Oe]);++ge}}ve.dayTextures.length=ge,ve.waterMask=m,n.clone(s.waterMaskTranslationAndScale,ve.waterMaskTranslationAndScale),ve.minMaxHeight.x=L.minimumHeight,ve.minMaxHeight.y=L.maximumHeight,_.clone(L.matrix,ve.scaleAndBias),fe.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,ge,ye,be,Ce,we,Se,Te,Ee,g,S,t.enableLighting,E,H,_e),fe.castShadows=A,fe.receiveShadows=M,fe.renderState=de,fe.primitiveType=C.TRIANGLES,fe.vertexArray=s.vertexArray,fe.uniformMap=me,fe.pass=O.GLOBE,t._debug.wireframe&&(X(pe,t,r),l(s.wireframeVertexArray)&&(fe.vertexArray=s.wireframeVertexArray,fe.primitiveType=C.LINES));var Re=fe.boundingVolume,Le=fe.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(r.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Re),i.fromElements(Re.center.z,Re.center.x,Re.center.y,Re.center),a.mode===z.MORPHING&&(Re=e.union(s.boundingSphere3D,Re,Re))):(fe.boundingVolume=e.clone(s.boundingSphere3D,Re),fe.orientedBoundingBox=y.clone(s.orientedBoundingBox,Le)),a.commandList.push(fe),de=ce,he=ue}while($<ee)}function K(e,t,r){var i;e._pickCommands.length<=e._usedPickCommands?(i=new I,i.cull=!1,e._pickCommands.push(i)):i=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=r.projection instanceof x;i.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(r,n,o),i.renderState=e._pickRenderState,i.owner=t.owner,i.primitiveType=t.primitiveType,i.vertexArray=t.vertexArray,i.uniformMap=t.uniformMap,i.boundingVolume=t.boundingVolume,i.orientedBoundingBox=t.orientedBoundingBox,i.pass=t.pass,r.commandList.push(i)}u(H.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),H.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var r=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&r.addCredit(this._terrainProvider.credit);for(var i=0,n=t.length;i<n;++i){var o=t.get(i).imageryProvider;o.ready&&l(o.credit)&&r.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)j(a[u]);a.length=0},H.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];l(n)&&(n.length=0)}this._usedDrawCommands=0},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=M.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=M.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:L.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];if(l(n))for(var o=0,a=n.length;o<a;++o)Z(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=M.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,r=0,i=this._usedDrawCommands;r<i;++r)K(this,t[r],e)},H.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){B.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var J=new e;H.prototype.computeTileVisibility=function(t,r,n){var o=this.computeDistanceToTile(t,r);if(t._distance=o,r.fog.enabled&&v.fog(o,r.fog.density)>=1)return E.NONE;var a=t.data,u=r.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);r.mode!==z.SCENE3D&&(c=J,e.fromRectangleWithHeights2D(t.rectangle,r.mapProjection,a.minimumHeight,a.maximumHeight,c),i.fromElements(c.center.z,c.center.x,c.center.y,c.center),r.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var d=u.computeVisibility(c);if(d===g.OUTSIDE)return E.NONE;var h=r.mode===z.SCENE3D&&r.camera.frustum instanceof b;if(r.mode===z.SCENE3D&&!h&&l(n)){var p=a.occludeePointInScaledSpace;return l(p)?n.ellipsoid.isScaledSpacePointVisible(p)?d:E.NONE:d}return d};var $=new _,ee=new _,te=new n,re=new i,ie=new i,ne=new i,oe=new i;H.prototype.showTileThisFrame=function(e,t){ for(var r=0,i=e.data.imagery,n=0,o=i.length;n<o;++n){var a=i[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++r}var s=this._tilesToRenderByTextureCount[r];l(s)||(s=[],this._tilesToRenderByTextureCount[r]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=r},H.prototype.computeDistanceToTile=function(e,t){return e.data.tileBoundingRegion.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var r=this._terrainProvider,i=this;e.imageryProvider._reload=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(t){if(t.state===V.DONE){var i,n=t.data.imagery,o=n.length,a=-1,l=0;for(i=0;i<o;++i){var u=n[i];if(s(u.readyImagery,u.loadingImagery).imageryLayer===e)-1===a&&(a=i),++l;else if(-1!==a)break}if(-1!==a){var c=a+l;e._createTileImagerySkeletons(t,r,c)&&(t._loadedCallbacks.push(q(l,e,r)),t.state=V.LOADING)}}})},this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,r)&&(t.state=V.LOADING)}),this._layerOrderChanged=!0}},H.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var r=t.data.imagery,i=-1,n=0,o=0,a=r.length;o<a;++o){var s=r[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)-1===i&&(i=o),s.freeResources(),++n;else if(-1!==i)break}-1!==i&&r.splice(i,n)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0)},H.prototype._onLayerMoved=function(e,t,r){this._layerOrderChanged=!0},H.prototype._onLayerShownOrHidden=function(e,t,r){r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ae,se,le;!function(){function e(e){return new F({geometryInstances:e,appearance:new k({translucent:!1,flat:!0}),asynchronous:!1})}var r,n,o=new p({geometry:t.fromDimensions({dimensions:new i(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new _;ae=function(t,i){return t===r?n:(le(),r=t,u=_.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(i),n=e(o))},se=function(t,i){return t===r?n:(le(),r=t,u=_.fromTranslation(t.center,u),u=_.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(i),n=e(s))},le=function(){l(n)&&(n.destroy(),n=void 0,r=void 0)}}();var ue=new n(0,0,0,0);return H}),define("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function d(e,t){return e.indexOf(t)}function h(e,t,r){var i=e._layers;if(t=a.clamp(t,0,i.length-1),r=a.clamp(r,0,i.length-1),t!==r){var n=i[t];i[t]=i[r],i[r]=n,e._update(),e.layerMoved.raiseEvent(n,r,t)}}r(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,r){t(r)?this._layers.splice(r,0,e):(r=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,r)},c.prototype.addImageryProvider=function(e,t){var r=new u(e);return this.add(r,t),r},c.prototype.remove=function(t,r){r=e(r,!0);var i=this._layers.indexOf(t);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(t,i),r&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var r=this._layers,i=0,n=r.length;i<n;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=d(this._layers,e);h(this,t,t+1)},c.prototype.lower=function(e){var t=d(this._layers,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=d(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=d(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,r){var i=r.globe.pick(e,r);if(t(i)){for(var n,o=r.globe.ellipsoid.cartesianToCartographic(i),u=r.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var d=u[c];s.contains(d.rectangle,o)&&(n=d)}if(t(n)){for(var h=n.data.imagery,f=[],m=[],g=h.length-1;g>=0;--g){var v=h[g],_=v.readyImagery;if(t(_)){var y=_.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(_.rectangle,o)){var b=p;if(b.west=a.lerp(n.rectangle.west,n.rectangle.east,v.textureCoordinateRectangle.x-1/1024),b.east=a.lerp(n.rectangle.west,n.rectangle.east,v.textureCoordinateRectangle.z+1/1024),b.south=a.lerp(n.rectangle.south,n.rectangle.north,v.textureCoordinateRectangle.y-1/1024),b.north=a.lerp(n.rectangle.south,n.rectangle.north,v.textureCoordinateRectangle.w+1/1024),s.contains(b,o)){var C=y.pickFeatures(_.x,_.y,_.level,o.longitude,o.latitude);t(C)&&(f.push(C),m.push(_.imageryLayer))}}}}if(0!==f.length)return l.all(f,function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i],a=m[i];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),r.push(l)}}return r})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,r=0,i=t.length;r<i;++r)t[r].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,r=e.length;t<r;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),i(this)},c.prototype._update=function(){var e,r,i,n,o=!0,a=this._layers;for(i=0,n=a.length;i<n;++i)r=a[i],r._layerIndex=i,r.show?(r._isBaseLayer=o,o=!1):r._isBaseLayer=!1,r.show!==r._show&&(t(r._show)&&(t(e)||(e=[]),e.push(r)),r._show=r.show);if(t(e))for(i=0,n=e.length;i<n;++i)r=e[i],this.layerShownOrHidden.raiseEvent(r,r._layerIndex,r.show)},c}),define("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,r){"use strict";function i(t){this._ellipsoid=new r(t.ellipsoid,e.ZERO)}return t(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),i}),define("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,r,i,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._priorityFunction=void 0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this._loadedCallbacks=[],this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),r=e.getNumberOfYTilesAtLevel(0),i=new Array(t*r),n=0,a=0;a<r;++a)for(var s=0;s<t;++s)i[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return i},o.prototype._updateCustomData=function(t,r,n){var o,a,s,l=this.customData;if(e(r)&&e(n)){for(l=l.filter(function(e){return-1===n.indexOf(e)}),this._customData=l,s=this._rectangle,o=0;o<r.length;++o)a=r[o],i.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],i.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),define("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function r(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var i=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(i);){n=i!==this._lastBeforeStartOfFrame;var o=i.replacementPrevious;i.eligibleForUnloading&&(i.freeResources(),r(this,i)),i=o}},t.prototype.markTileRendered=function(t){var i=this.head;return i===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(i)?((e(t.replacementPrevious)||e(t.replacementNext))&&r(this,t),t.replacementPrevious=void 0,t.replacementNext=i,i.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),define("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/OrthographicFrustum","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,i=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new v,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=r(e.maximumScreenSpaceError,2),this.tileCacheSize=r(e.tileCacheSize,100),this._occluders=new p({ellipsoid:i}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var r=d.center(e.rectangle,k),i=r.longitude-N.longitude,n=r.latitude-N.latitude;r=d.center(t.rectangle,k);var o=r.longitude-N.longitude,a=r.latitude-N.latitude;return i*i+n*n-(o*o+a*a)}function b(e,t){var r=e._debug;if(!r.suspendLodUpdate){var n,o;if(e._tilesToRender.length=0,!i(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var a=e._tileProvider.tilingScheme;e._levelZeroTiles=f.createLevelZeroTiles(a)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var s,l=e._levelZeroTiles,u=e._tileProvider,c=l.length>1?e._occluders:void 0;N=t.camera.positionCartographic,l.sort(y);var d=e._addHeightCallbacks,p=e._removeHeightCallbacks,m=t.frameNumber;if(d.length>0||p.length>0){for(n=0,o=l.length;n<o;++n)s=l[n],s._updateCustomData(m,d,p);d.length=0,p.length=0}for(n=0,o=l.length;n<o;++n)s=l[n],e._tileReplacementQueue.markTileRendered(s),s.renderable?u.computeTileVisibility(s,t,c)!==h.NONE?w(e,t,s):(s.needsLoading&&e._tileLoadQueueLow.push(s),++r.tilesCulled):(s.needsLoading&&e._tileLoadQueueHigh.push(s),++r.tilesWaitingForChildren);t.afterRender.push(C(e))}}function C(e){return function(){P(e)}}function w(e,t,r){var i=e._debug;if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(r),r._updateCustomData(t.frameNumber),r.level>i.maxDepth&&(i.maxDepth=r.level),A(e,t,r)<e.maximumScreenSpaceError)return r.needsLoading&&e._tileLoadQueueMedium.push(r),void I(e,r);var n=r.southwestChild,o=r.southeastChild,a=r.northwestChild,s=r.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(I(e,r),S(e,t.camera.positionCartographic,n,o,a,s),r.needsLoading&&e._tileLoadQueueMedium.push(r)):(E(e,n,o,a,s,t),r.needsLoading&&e._tileLoadQueueLow.push(r)):(S(e,t.camera.positionCartographic,n,o,a,s),I(e,r),r.needsLoading&&e._tileLoadQueueLow.push(r))}function S(e,t,r,i,n,o){t.longitude<r.east?t.latitude<r.north?(T(e,r),T(e,i),T(e,n),T(e,o)):(T(e,n),T(e,r),T(e,o),T(e,i)):t.latitude<r.north?(T(e,i),T(e,r),T(e,o),T(e,n)):(T(e,o),T(e,n),T(e,i),T(e,r))}function T(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function E(e,t,r,i,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(x(e,t,s,o,l),x(e,r,s,o,l),x(e,i,s,o,l),x(e,n,s,o,l)):(x(e,i,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,r,s,o,l)):a.latitude<t.rectangle.north?(x(e,r,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,i,s,o,l)):(x(e,n,s,o,l),x(e,i,s,o,l),x(e,r,s,o,l),x(e,t,s,o,l))}function x(e,t,r,i,n){r.computeTileVisibility(t,i,n)!==h.NONE?w(e,i,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function P(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,r){if(t.mode===g.SCENE2D||t.camera.frustum instanceof u)return D(e,t,r);var i=e._tileProvider.getLevelMaximumGeometricError(r.level),n=r._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function D(e,t,r){var n=t.camera,o=n.frustum;i(o._offCenterFrustum)&&(o=o._offCenterFrustum);var a=t.context,s=a.drawingBufferWidth,u=a.drawingBufferHeight,c=e._tileProvider.getLevelMaximumGeometricError(r.level),d=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,u),h=c/d;return t.fog.enabled&&t.mode!==g.SCENE2D&&(h-=l.fog(r._distance,t.fog.density)*t.fog.sse),h}function I(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function O(e,t){var r=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==r.length||0!==i.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;M(e,t,o,a,r),M(e,t,o,a,i),M(e,t,o,a,n)}}function M(e,t,r,i,n){for(var o=0,a=n.length;o<a&&s()<i;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),r.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,h=u+c,p=o.mode,f=o.mapProjection,m=f.ellipsoid;a.length>0;){var v,_=a[0],y=_.customData,b=y.length,C=!1;for(v=n._lastTileIndex;v<b;++v){var w=y[v];if(_.level>w.level){if(i(w.positionOnEllipsoidSurface)||(w.positionOnEllipsoidSurface=e.fromRadians(w.positionCartographic.longitude,w.positionCartographic.latitude,0,m)),p===g.SCENE3D){var S=m.geodeticSurfaceNormal(w.positionOnEllipsoidSurface,F.direction),T=m.getSurfaceNormalIntersectionWithZAxis(w.positionOnEllipsoidSurface,11500,F.origin);if(!i(T)){var E=Math.min(r(_.data.minimumHeight,0),-11500),x=e.multiplyByScalar(S,Math.abs(E)+1,U);e.subtract(w.positionOnEllipsoidSurface,x,F.origin)}}else t.clone(w.positionCartographic,B),B.height=-11500,f.project(B,U),e.fromElements(U.z,U.x,U.y,U),e.clone(U,F.origin),e.clone(e.UNIT_X,F.direction);var P=_.data.pick(F,p,f,!1,U);i(P)&&w.callback(P),w.level=_.level}else if(_.level===w.level){for(var A,D=_.children,I=D.length,O=0;O<I&&(A=D[O],!d.contains(A.rectangle,w.positionCartographic));++O);var M=l.getTileDataAvailable(A.x,A.y,A.level),R=_.parent;(i(M)&&!M||i(R)&&i(R.data)&&i(R.data.terrainData)&&!R.data.terrainData.isChildAvailable(R.x,R.y,A.x,A.y))&&w.removeFunc()}if(s()>=h){C=!0;break}}if(C){n._lastTileIndex=v;break}n._lastTileIndex=0,a.shift()}}function L(e,t){for(var r=e._tileProvider,i=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=i.length;o<a;++o){var s=i[o];r.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(_.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),_.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(i(t))for(var r=0;r<t.length;++r){for(var n=t[r],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[r].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},_.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;i(t);)t.state!==m.START&&e(t),t=t.replacementNext},_.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,r=0,i=t.length;r<i;++r)e(t[r])},_.prototype.updateHeight=function(e,t){var r=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){for(var e=r._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===i){e.splice(n,1);break}r._removeHeightCallbacks.push(i)},r._addHeightCallbacks.push(i),i.removeFunc},_.prototype.beginFrame=function(e){if(e.passes.render){this._tileProvider.initialize(e);var t=this._debug;t.suspendLodUpdate||(t.maxDepth=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},_.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),b(this,e),L(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},_.prototype.endFrame=function(e){if(e.passes.render&&e.mode!==g.MORPHING){O(this,e),R(this,e);var t=this._debug;t.suspendLodUpdate||t.enableDebugOutput&&(t.tilesVisited===t.lastTilesVisited&&t.tilesRendered===t.lastTilesRendered&&t.tilesCulled===t.lastTilesCulled&&t.maxDepth===t.lastMaxDepth&&t.tilesWaitingForChildren===t.lastTilesWaitingForChildren||(console.log("Visited "+t.tilesVisited+", Rendered: "+t.tilesRendered+", Culled: "+t.tilesCulled+", Max Depth: "+t.maxDepth+", Waiting for children: "+t.tilesWaitingForChildren),t.lastTilesVisited=t.tilesVisited,t.lastTilesRendered=t.tilesRendered,t.lastTilesCulled=t.tilesCulled,t.lastMaxDepth=t.maxDepth,t.lastTilesWaitingForChildren=t.tilesWaitingForChildren))}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var N,k=new t,F=new c,B=new t,U=new e;return _}),define("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P){"use strict";function A(e){e=n(e,u.WGS84);var r=new c({ellipsoid:e}),i=new T;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new w,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[b,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[_]}),this._surface=new E({tileProvider:new S({terrainProvider:r,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=r,this._terrainProviderChanged=new d,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function D(t){return function(r,i){return e.distanceSquaredTo(r.pickBoundingSphere,t)-e.distanceSquaredTo(i.pickBoundingSphere,t)}}function I(e,t){return m.contains(e.rectangle,t)?e:void 0}a(A.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var O=[],M={start:0,stop:0};A.prototype.pick=function(t,i,n){var a=i.mode,s=i.mapProjection,l=O;l.length=0;var u,c,d=this._surface._tilesToRender,p=d.length;for(c=0;c<p;++c){u=d[c];var f=u.data;if(o(f)){var m=f.pickBoundingSphere;a!==x.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,f.minimumHeight,f.maximumHeight,m),r.fromElements(m.center.z,m.center.x,m.center.y,m.center)):e.clone(f.boundingSphere3D,m);var g=h.raySphere(t,m,M);o(g)&&l.push(f)}}l.sort(D(t.origin));var v;for(p=l.length,c=0;c<p&&(v=l[c].pick(t,i.mode,i.mapProjection,!0,n),!o(v));++c);return v};var R=new r,L=new r,N=new i,k=new f;return A.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var i,a,s=t.length;for(a=0;a<s&&(i=t[a],!m.contains(i.rectangle,e));++a);if(o(i)&&m.contains(i.rectangle,e)){for(;i.renderable;)i=I(i.southwestChild,e)||I(i.southeastChild,e)||I(i.northwestChild,e)||i.northeastChild;for(;o(i)&&(!o(i.data)||!o(i.data.pickTerrain));)i=i.parent;if(o(i)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=r.fromRadians(e.longitude,e.latitude,0,l,R),c=k,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p=Math.min(n(i.data.minimumHeight,0),-11500),f=r.multiplyByScalar(d,Math.abs(p)+1,L);r.subtract(u,f,c.origin)}var g=i.data.pick(c,void 0,void 0,!1,L);if(o(g))return l.cartesianToCartographic(g,N).height}}}},A.prototype.beginFrame=function(e){if(this.show){var t=this._surface,r=t.tileProvider,i=this.terrainProvider,n=this.showWaterEffect&&i.ready&&i.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;C(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode;e.passes.render&&(l===x.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,r.terrainProvider=this.terrainProvider,r.lightingFadeOutDistance=this.lightingFadeOutDistance,r.lightingFadeInDistance=this.lightingFadeInDistance,r.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,r.hasWaterMask=n,r.oceanNormalMap=this._oceanNormalMap,r.enableLighting=this.enableLighting,r.shadows=this.shadows,t.beginFrame(e))}},A.prototype.update=function(e){if(this.show){var t=this._surface,r=e.passes;r.render&&t.update(e),r.pick&&t.update(e)}},A.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},A}),define("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._debugGlobeDepthViewportCommand=void 0}function h(e,t,i){if(!r(e._debugGlobeDepthViewportCommand)){e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand("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",{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,i)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function m(e,t,r,i){e._colorTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:r,height:i,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function g(e,t){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function v(e,t,i,n){var o=e._colorTexture,a=!r(o)||o.width!==i||o.height!==n;r(e.framebuffer)&&!a||(p(e),f(e),m(e,t,i,n),g(e,t))}function _(i,n,a,s,u){i._viewport.width=a,i._viewport.height=s;var d=!e.equals(i._viewport,u.viewport),h=d!==i._useScissorTest;if(i._useScissorTest=d,e.equals(i._scissorRectangle,u.viewport)||(i._scissorRectangle=e.clone(u.viewport,i._scissorRectangle),h=!0),r(i._rs)&&e.equals(i._viewport,i._rs.viewport)&&!h||(i._rs=l.fromCache({viewport:i._viewport,scissorTest:{enabled:i._useScissorTest,rectangle:i._scissorRectangle}})),!r(i._copyDepthCommand)){i._copyDepthCommand=n.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{uniformMap:{u_texture:function(){return i._depthStencilTexture}},owner:i})}i._copyDepthCommand.framebuffer=i._copyDepthFramebuffer,r(i._copyColorCommand)||(i._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return i._colorTexture}},owner:i})),i._copyDepthCommand.renderState=i._rs,i._copyColorCommand.renderState=i._rs,r(i._clearColorCommand)||(i._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:i})),i._clearColorCommand.framebuffer=i.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){h(this,e,t)},d.prototype.update=function(e,t){var r=e.drawingBufferWidth,i=e.drawingBufferHeight;v(this,e,r,i),_(this,e,r,i,t),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){r(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){r(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,i,n){var o=this._clearColorCommand;r(o)&&(t.clone(n,o.color),o.execute(e,i))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),r(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),r(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return r(e)&&(e.shaderProgram=e.shaderProgram.destroy()),i(this)},d}),define("Scene/GoogleEarthEnterpriseImageryProvider",["../Core/Credit","../Core/decodeGoogleEarthEnterpriseData","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/GoogleEarthEnterpriseMetadata","../Core/loadArrayBuffer","../Core/loadImageFromTypedArray","../Core/Math","../Core/Rectangle","../Core/Request","../Core/RequestType","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/protobuf-minimal","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this._image=new Image}function b(t){t=r(t,r.EMPTY_OBJECT) ;var n;n=i(t.metadata)?this._metadata=t.metadata:this._metadata=new l({url:t.url,proxy:t.proxy}),this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=r(t.proxy,this._metadata.proxy),this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h(-d.PI,-d.PI,d.PI,d.PI),ellipsoid:t.ellipsoid});var o=t.credit;"string"==typeof o&&(o=new e(o)),this._credit=o,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,i(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new y),this._errorEvent=new a,this._ready=!1;var u,c=this;this._readyPromise=n.readyPromise.then(function(e){if(!n.imageryPresent){var t=new m("The server "+n.url+" doesn't have imagery");return u=g.handleError(u,c,c._errorEvent,t.message,void 0,void 0,void 0,t),_.reject(t)}return g.handleSuccess(u),c._ready=e,e}).otherwise(function(e){return u=g.handleError(u,c,c._errorEvent,e.message,void 0,void 0,void 0,e),_.reject(e)})}function C(e,t,r,n,o){var a=l.tileXYToQuadKey(r,n,o),s=t.imageryVersion;s=i(s)&&s>0?s:1;var u=e.url+"flatfile?f1-0"+a+"-i."+s.toString(),c=e._proxy;return i(c)&&(u=c.getURL(u)),u}function w(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";var r="PNG";return e[1]===r.charCodeAt(0)&&e[2]===r.charCodeAt(1)&&e[3]===r.charCodeAt(2)?"image/png":void 0}function S(e){for(var t=v.Reader.create(e),r=t.len,n={};t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.imageType=t.uint32();break;case 2:n.imageData=t.bytes();break;case 3:n.alphaType=t.uint32();break;case 4:n.imageAlpha=t.bytes();break;case 5:var a=n.copyrightIds;if(i(a)||(a=n.copyrightIds=[]),2==(7&o))for(var s=t.uint32()+t.pos;t.pos<s;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&o)}}var l=n.imageType;if(i(l))switch(l){case 0:n.imageType="image/jpeg";break;case 4:n.imageType="image/png";break;default:throw new m("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var u=n.alphaType;return i(u)&&0!==u&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete n.alphaType,delete n.imageAlpha),n}return y.prototype.isReady=function(){return!0},y.prototype.shouldDiscardImage=function(e){return e===this._image},n(b.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),b.prototype.getTileCredits=function(e,t,r){var n=this._metadata,o=n.getTileInformation(e,t,r);if(i(o)){var a=n.providers[o.imageryProvider];if(i(a))return[a]}},b.prototype.requestImage=function(e,r,n,o){var a=this._tileDiscardPolicy._image,s=this._metadata,d=l.tileXYToQuadKey(e,r,n),h=s.getTileInformation(e,r,n);if(!i(h)){if(s.isValid(d)){var f=new p({throttle:o.throttle,throttleByServer:o.throttleByServer,type:o.type,priorityFunction:o.priorityFunction});return void s.populateSubtree(e,r,n,f)}return a}if(!h.hasImagery())return a;var m=C(this,h,e,r,n),g=u(m,void 0,o);return i(g)?g.then(function(e){t(s.key,e);var r,n=new Uint8Array(e),o=s.protoImagery;if(i(o)&&o||(r=w(n)),!i(r)&&(!i(o)||o)){var l=S(n);r=l.imageType,n=l.imageData}return i(r)&&i(n)?c(n,r):a}):void 0},b.prototype.pickFeatures=function(e,t,r,i,n){},b}),define("Scene/GoogleEarthEnterpriseMapsProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){function n(e){var t;try{t=JSON.parse(e)}catch(r){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===_._channel){n=t.layers[o];break}var s;if(!r(n))throw s="Could not find layer with channel (id) of "+_._channel+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(!r(n.version))throw s="Could not find a version in channel (id) "+_._channel+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(_._version=n.version,r(t.projection)&&"flat"===t.projection)_._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:i.ellipsoid});else{if(r(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);_._tilingScheme=new d({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:i.ellipsoid})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,_._readyPromise.resolve(!0),c.handleSuccess(g)}function p(e){var t="An error occurred while accessing "+v+".";g=c.handleError(g,_,_._errorEvent,t,void 0,void 0,void 0,m),_._readyPromise.reject(new u(t))}function m(){var e=r(_._proxy)?_._proxy.getURL(v):v,t=s(e);h(t,n,p)}i=t(i,{}),this._url=i.url,this._path=t(i.path,"/default_map"),this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._channel=i.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",f._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=i.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var g,v=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=this;m()}function m(e,t,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return r(a)&&(o=a.getURL(o)),o}return i(f.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),f.prototype.getTileCredits=function(e,t,r){},f.prototype.requestImage=function(e,t,r,i){var n=m(this,e,t,r);return p.loadImage(this,n,i)},f.prototype.pickFeatures=function(e,t,r,i,n){},f._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",f}),define("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return i(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=this._canvasSize,r=0;r<=this._cells;++r){var i=r/this._cells,n=1+i*(t-1);e.moveTo(n,0),e.lineTo(n,t),e.moveTo(0,n),e.lineTo(t,n)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,r=e.getContext("2d"),i=this._backgroundColor.toCssColorString();r.fillStyle=i,r.fillRect(0,0,t,t);var n=this._glowColor.toCssColorString();r.strokeStyle=n,r.lineWidth=this._glowWidth,r.strokeRect(0,0,t,t),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(0,0,t,t),this._drawGrid(r);var o=this._color.toCssColorString();return r.strokeStyle=o,r.lineWidth=2,r.strokeRect(0,0,t,t),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,r){},s.prototype.requestImage=function(e,t,r,i){return this._canvas},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("Scene/InvertClassification",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/PassThrough","./BlendingState","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new o({color:new e(0,0,0,0),owner:this}),this._clearCommand=new o({color:new e(0,0,0,0),depth:1,stencil:0});var t=this;this._uniformMap={u_texture:function(){return t._texture},u_depth:function(){return t._depthStencilTexture},u_classified:function(){return t._classifiedTexture}}}r(y.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),y.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var b={depthMask:!1,stencilTest:{enabled:!0,frontFunction:v.EQUAL,frontOperation:{fail:_.KEEP,zFail:_.KEEP,zPass:_.KEEP},backFunction:v.NEVER,reference:0,mask:15},blending:g.ALPHA_BLEND},C={depthMask:!1,stencilTest:{enabled:!0,frontFunction:v.NOT_EQUAL,frontOperation:{fail:_.KEEP,zFail:_.KEEP,zPass:_.KEEP},backFunction:v.NEVER,reference:0,mask:15},blending:g.ALPHA_BLEND},w={depthMask:!0,depthTest:{enabled:!0},blending:g.ALPHA_BLEND};return y.prototype.update=function(e){var r=this._texture,i=!t(r)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var o=e.drawingBufferWidth,g=e.drawingBufferHeight,v=!t(r)||r.width!==o||r.height!==g;if((v||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new d({context:e,width:o,height:g,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),i&&!t(this._previousFramebuffer)&&(this._classifiedTexture=new d({context:e,width:o,height:g,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),this._depthStencilTexture=new d({context:e,width:o,height:g,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}))),!t(this._fbo)||v||i){this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy();var _,y;t(this._previousFramebuffer)?(_=this._previousFramebuffer.depthStencilTexture,y=this._previousFramebuffer.depthStencilRenderbuffer):_=this._depthStencilTexture,this._fbo=new a({context:e,colorTextures:[this._texture],depthStencilTexture:_,depthStencilRenderbuffer:y,destroyAttachments:!1}),t(this._previousFramebuffer)||(this._fboClassified=new a({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:_,destroyAttachments:!1}))}if(t(this._rsUnclassified)||(this._rsUnclassified=l.fromCache(b),this._rsClassified=l.fromCache(C),this._rsDefault=l.fromCache(w)),!t(this._unclassifiedCommand)||i){t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());var S=t(this._previousFramebuffer)?"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(u_texture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n":"#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_texture;\nuniform sampler2D u_depth;\nuniform sampler2D u_classified;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(u_texture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(u_classified, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(u_depth, v_textureCoordinates).r;\n}\n",T=new c({defines:["UNCLASSIFIED"],sources:[S]}),E=new c({sources:[S]});this._unclassifiedCommand=e.createViewportQuadCommand(T,{renderState:t(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(E,{renderState:t(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),t(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),t(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(m,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},y.prototype.clear=function(e,r){var i=r.framebuffer;t(this._previousFramebuffer)?(r.framebuffer=this._fbo,this._clearColorCommand.execute(e,r)):(r.framebuffer=this._fbo,this._clearCommand.execute(e,r),r.framebuffer=this._fboClassified,this._clearCommand.execute(e,r)),r.framebuffer=i},y.prototype.executeClassified=function(e,r){if(!t(this._previousFramebuffer)){var i=r.framebuffer;r.framebuffer=this._fboClassified,this._translucentCommand.execute(e,r),r.framebuffer=i}this._classifiedCommand.execute(e,r)},y.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i(this)},y}),define("Scene/JobScheduler",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","./JobType"],function(e,t,r,i,n){"use strict";function o(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function a(t){var r=new Array(n.NUMBER_OF_JOB_TYPES);r[n.TEXTURE]=new o(e(t)?t[n.TEXTURE]:10),r[n.PROGRAM]=new o(e(t)?t[n.PROGRAM]:10),r[n.BUFFER]=new o(e(t)?t[n.BUFFER]:30);var i,a=r.length,s=0;for(i=0;i<a;++i)s+=r[i].total;var l=new Array(a);for(i=0;i<a;++i)l[i]=!1;this._totalBudget=s,this._totalUsedThisFrame=0,this._budgets=r,this._executedThisFrame=l}return t(o.prototype,{total:{get:function(){return this._total}}}),a.getTimestamp=i,t(a.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),a.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},a.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,r=0;r<t;++r){var i=e[r];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},a.prototype.execute=function(e,t){var r=this._budgets,i=r[t],n=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&n)return i.starvedThisFrame=!0,!1;var o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){var s,l=r.length;for(s=0;s<l&&(o=r[s],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total)||o.starvedLastFrame);++s);if(s===l&&n)return!1;n&&(i.starvedThisFrame=!0)}var u=a.getTimestamp();e.execute();var c=a.getTimestamp()-u;return this._totalUsedThisFrame+=c,o?o.stolenFromMeThisFrame+=c:i.usedThisFrame+=c,this._executedThisFrame[t]=!0,!0},a}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var n=i.mapId,s=t(i.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(i.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(i.accessToken);var d=t(i.format,"png");/\./.test(d)||(d="."+d),this._format=d;var h=s;if(l.test(s)||(h+="/"),h+=n+"/{z}/{x}/{y}"+this._format,r(this._accessToken)&&(h+="?access_token="+this._accessToken),r(i.credit)){var p=i.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:h,proxy:i.proxy,credit:u,ellipsoid:i.ellipsoid,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,rectangle:i.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return i(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,i){var n=c.slice();return r(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,r,i){return this._imageryProvider.requestImage(e,t,r,i)},s.prototype.pickFeatures=function(e,t,r,i,n){return this._imageryProvider.pickFeatures(e,t,r,i,n)},s}),define("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){t=r(t,r.EMPTY_OBJECT);var n=t.textureUrl;i(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=r(t.show,!0),this.textureUrl=n,this._ellipsoid=r(t.ellipsoid,a.MOON),this.onlySunLighting=r(t.onlySunLighting,!0), this._ellipsoidPrimitive=new h({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m=new l,g=new l,v=new t,_=[];return f.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var r=e.time;i(d.computeIcrfToFixedMatrix(r,m))||d.computeTemeToPseudoFixedMatrix(r,m);var n=this._axes.evaluate(r,g);l.transpose(n,n),l.multiply(m,n,n);var o=c.computeMoonPositionInEarthInertialFrame(r,v);l.multiplyByVector(m,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=_,_.length=0,t.update(e),e.commandList=a,1===_.length?_[0]:void 0}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},f}),define("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),define("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),define("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n"}),define("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(r){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var i=r.floatingPointTexture&&r.depthTexture;this._translucentMRTSupport=r.drawBuffers&&i,this._translucentMultipassSupport=!this._translucentMRTSupport&&i,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0}function _(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function b(e){_(e),y(e)}function C(e,t,r,i){_(e);var o=new Float32Array(r*i*4);e._accumulationTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}}),e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}})}function w(e,t){y(e);var r=o.FRAMEBUFFER_COMPLETE,i=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===r&&e._adjustTranslucentFBO.status===r||(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===r,a=e._alphaFBO.status===r,s=e._adjustTranslucentFBO.status===r,u=e._adjustAlphaFBO.status===r;n&&a&&s&&u||(b(e),e._translucentMultipassSupport=!1,i=!1)}return i}function S(e,t,i,n){var o=i[n.id];if(!r(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),i[n.id]=o}return o}function T(e,t,r){return S(t,R,e._translucentRenderStateCache,r)}function E(e,t,r){return S(t,L,e._translucentRenderStateCache,r)}function x(e,t,r){return S(t,N,e._alphaRenderStateCache,r)}function P(e,t,i,n){var o=e.shaderCache.getDerivedShaderProgram(t,i);if(!r(o)){var a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,(-1!==n.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),s.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function A(e,t){return P(e,t,"translucentMRT",k)}function D(e,t){return P(e,t,"translucentMultipass",F)}function I(e,t){return P(e,t,"alphaMultipass",B)}function O(e,t,i,n,o,a){var s,l,u,c=t.context,d=n.framebuffer,h=o.length,p=t.frameState.shadowHints.shadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var f=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;u<h;++u)s=o[u],l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,i(l,t,c,n,f);for(r(a)&&(s=a.unclassifiedCommand,l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,i(l,t,c,n,f)),n.framebuffer=e._alphaFBO,u=0;u<h;++u)s=o[u],l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,i(l,t,c,n,f);r(a)&&(s=a.unclassifiedCommand,l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,i(l,t,c,n,f)),n.framebuffer=d}function M(e,t,i,n,o,a){var s=t.context,l=n.framebuffer,u=o.length,c=t.frameState.shadowHints.shadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(s,n);var d=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var h,p,f=0;f<u;++f)h=o[f],p=c&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,i(p,t,s,n,d);r(a)&&(h=a.unclassifiedCommand,p=c&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,i(p,t,s,n,d)),n.framebuffer=l}v.prototype.update=function(t,i,n){if(this.isSupported()){this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.depthStencilTexture;var o=this._opaqueTexture.width,a=this._opaqueTexture.height,s=this._accumulationTexture,l=!r(s)||s.width!==o||s.height!==a;if(l&&C(this,t,o,a),r(this._translucentFBO)&&!l||w(this,t)){var u,h,m=this;r(this._compositeCommand)||(u=new d({sources:[f]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return m._opaqueTexture},u_accumulation:function(){return m._accumulationTexture},u_revealage:function(){return m._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),r(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new d({defines:["MRT"],sources:[p]}),h={u_bgColor:function(){return m._translucentMRTClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new d({sources:[p]}),h={u_bgColor:function(){return m._translucentMultipassClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}),h={u_bgColor:function(){return m._alphaClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=o,this._viewport.height=a;var g=!e.equals(this._viewport,i.viewport),v=g!==this._useScissorTest;this._useScissorTest=g,e.equals(this._scissorRectangle,i.viewport)||(this._scissorRectangle=e.clone(i.viewport,this._scissorRectangle),v=!0),r(this._rs)&&e.equals(this._viewport,this._rs.viewport)&&!v||(this._rs=c.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),r(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var R={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},N={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},k=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",B=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,i){if(r(i)||(i={}),this._translucentMRTSupport){var n,o;r(i.translucentCommand)&&(n=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),r(n)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=n,i.translucentCommand.renderState=o):(i.translucentCommand.shaderProgram=A(t,e.shaderProgram),i.translucentCommand.renderState=T(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;r(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,l=i.translucentCommand.renderState,u=i.alphaCommand.shaderProgram,c=i.alphaCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),i.alphaCommand=s.shallowClone(e,i.alphaCommand),r(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=l,i.alphaCommand.shaderProgram=u,i.alphaCommand.renderState=c):(i.translucentCommand.shaderProgram=D(t,e.shaderProgram),i.translucentCommand.renderState=E(this,t,e.renderState),i.alphaCommand.shaderProgram=I(t,e.shaderProgram),i.alphaCommand.renderState=x(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}return i},v.prototype.executeCommands=function(e,t,r,i,n){if(this._translucentMRTSupport)return void M(this,e,t,r,i,n);O(this,e,t,r,i,n)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,r,i){var n=r.framebuffer;r.framebuffer=this._opaqueFBO,t.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,r),r.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,r),this._translucentMultipassSupport&&(r.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,r)),r.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return b(this),r(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),r(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),i(this)},v}),define("Scene/Particle",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties"],function(e,t,r,i,n,o){"use strict";function a(n){n=i(n,i.EMPTY_OBJECT),this.mass=i(n.mass,1),this.position=t.clone(i(n.position,t.ZERO)),this.velocity=t.clone(i(n.velocity,t.ZERO)),this.life=i(n.life,Number.MAX_VALUE),this.image=n.image,this.startColor=r.clone(i(n.startColor,r.WHITE)),this.endColor=r.clone(i(n.endColor,r.WHITE)),this.startScale=i(n.startScale,1),this.endScale=i(n.endScale,1),this.size=e.clone(i(n.size,s)),this._age=0,this._normalizedAge=0,this._billboard=void 0}var s=new e(1,1);o(a.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var l=new t;return a.prototype.update=function(e,r){if(t.multiplyByScalar(this.velocity,e,l),t.add(this.position,l,this.position),n(r))for(var i=r.length,o=0;o<i;++o){var a=r[o];"function"==typeof a&&a(this,e)}return this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life},a}),define("Scene/ParticleBurst",["../Core/defaultValue","../Core/defineProperties"],function(e,t){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.time=e(t.time,0),this.minimum=e(t.minimum,0),this.maximum=e(t.maximum,50),this._complete=!1}return t(r.prototype,{complete:{get:function(){return this._complete}}}),r}),define("Scene/ParticleEmitter",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(e){}return r.prototype.emit=function(e){t.throwInstantiationError()},r}),define("Scene/ParticleSystem",["../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event","../Core/JulianDate","../Core/Math","../Core/Matrix4","./BillboardCollection","./CircleEmitter","./Particle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT),this.show=n(e.show,!0),this.forces=e.forces,this.loop=n(e.loop,!0),this.image=n(e.image,void 0);var t=e.emitter;o(t)||(t=new p(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=d.clone(n(e.modelMatrix,d.IDENTITY)),this._emitterModelMatrix=d.clone(n(e.emitterModelMatrix,d.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new d,this._startColor=i.clone(n(e.startColor,i.WHITE)),this._endColor=i.clone(n(e.endColor,i.WHITE)),this._startScale=n(e.startScale,1),this._endScale=n(e.endScale,1),this._rate=n(e.rate,5),this._minimumSpeed=n(e.speed,n(e.minimumSpeed,1)),this._maximumSpeed=n(e.speed,n(e.maximumSpeed,1)),this._minimumLife=n(e.life,n(e.minimumLife,5)),this._maximumLife=n(e.life,n(e.maximumLife,5)),this._minimumMass=n(e.mass,n(e.minimumMass,1)),this._maximumMass=n(e.mass,n(e.maximumMass,1)),this._minimumWidth=n(e.width,n(e.minimumWidth,1)),this._maximumWidth=n(e.width,n(e.maximumWidth,1)),this._minimumHeight=n(e.height,n(e.minimumHeight,1)),this._maximumHeight=n(e.height,n(e.maximumHeight,1)),this._lifeTime=n(e.lifeTime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new l,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function g(e){var t=e._rate,r=e._maximumLife,i=0,n=e._bursts;if(o(n))for(var a=n.length,s=0;s<a;++s)i+=n[s].maximum;for(var l=e._billboardCollection,u=e.image,c=Math.ceil(t*r+i),d=e._particles,h=e._particlePool,p=Math.max(c-d.length-h.length,0),m=0;m<p;++m){var g=new f;g._billboard=l.add({image:u}),h.push(g)}e._particleEstimate=c}function v(e){var t=e._particlePool.pop();return o(t)||(t=new f),t}function _(e,t){e._particlePool.push(t)}function y(e){for(var t=e._particles,r=e._particlePool,i=e._billboardCollection,n=t.length,o=r.length,a=e._particleEstimate,s=o-Math.max(a-n-o,0),l=s;l<o;++l){var u=r[l];i.remove(u._billboard)}r.length=s}function b(e){o(e._billboard)&&(e._billboard.show=!1)}function C(e,t){var r=t._billboard;o(r)||(r=t._billboard=e._billboardCollection.add({image:t.image})),r.width=t.size.x,r.height=t.size.y,r.position=t.position,r.show=!0;var n=c.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),a=c.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),s=c.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),l=c.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);r.color=new i(n,a,s,l);var u=c.lerp(t.startScale,t.endScale,t.normalizedAge);r.scale=u}function w(r,n){n.startColor=i.clone(r._startColor,n.startColor),n.endColor=i.clone(r._endColor,n.endColor),n.startScale=r._startScale,n.endScale=r._endScale,n.image=r.image,n.life=c.randomBetween(r._minimumLife,r._maximumLife),n.mass=c.randomBetween(r._minimumMass,r._maximumMass);var o=c.randomBetween(r._minimumWidth,r._maximumWidth),a=c.randomBetween(r._minimumHeight,r._maximumHeight);n.size=e.fromElements(o,a,n.size),n._normalizedAge=0,n._age=0;var s=c.randomBetween(r._minimumSpeed,r._maximumSpeed);t.multiplyByScalar(n.velocity,s,n.velocity),r._particles.push(n)}function S(e,t){if(e._isComplete)return 0;t=c.mod(t,e._lifeTime);var r=t*e._rate,i=Math.floor(r);if(e._carryOver+=r-i,e._carryOver>1&&(i++,e._carryOver-=1),o(e.bursts))for(var n=e.bursts.length,a=0;a<n;a++){var s=e.bursts[a],l=e._currentTime;o(s)&&!s._complete&&l>s.time&&(i+=c.randomBetween(s.minimum,s.maximum),s._complete=!0)}return i}a(m.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._modelMatrix,e),d.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._emitterModelMatrix,e),d.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){i.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){i.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},rate:{get:function(){return this._rate},set:function(e){this._rate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumLife:{get:function(){return this._minimumLife},set:function(e){this._minimumLife=e}},maximumLife:{get:function(){return this._maximumLife},set:function(e){this._maximumLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumWidth:{get:function(){return this._minimumWidth},set:function(e){this._minimumWidth=e}},maximumWidth:{get:function(){return this._maximumWidth},set:function(e){this._maximumWidth=e}},minimumHeight:{get:function(){return this._minimumHeight},set:function(e){this._minimumHeight=e}},maximumHeight:{get:function(){return this._maximumHeight},set:function(e){this._maximumHeight=e}},lifeTime:{get:function(){return this._lifeTime},set:function(e){this._lifeTime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var T=new t;return m.prototype.update=function(e){if(this.show){o(this._billboardCollection)||(this._billboardCollection=new h),this._updateParticlePool&&(g(this),this._updateParticlePool=!1);var r=0;this._previousTime&&(r=u.secondsDifference(e.time,this._previousTime)),r<0&&(r=0);var i,n,a=this._particles,s=this._emitter,l=this.forces,p=a.length;for(i=0;i<p;++i)n=a[i],n.update(r,l)?C(this,n):(b(n),_(this,n),a[i]=a[p-1],--i,--p);a.length=p;var f=S(this,r);if(f>0&&o(s)){this._matrixDirty&&(this._combinedMatrix=d.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);var m=this._combinedMatrix;for(i=0;i<f;i++)n=v(this),this._emitter.emit(n),t.add(n.position,n.velocity,T),d.multiplyByPoint(m,T,T),n.position=d.multiplyByPoint(m,n.position,n.position),t.subtract(T,n.position,n.velocity),t.normalize(n.velocity,n.velocity),w(this,n),C(this,n)}if(this._billboardCollection.update(e),this._previousTime=u.clone(e.time,this._previousTime),this._currentTime+=r,this._lifeTime!==Number.MAX_VALUE&&this._currentTime>this._lifeTime)if(this.loop){if(this._currentTime=c.mod(this._currentTime,this._lifeTime),this.bursts){var E=this.bursts.length;for(i=0;i<E;i++)this.bursts[i]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&y(this)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),s(this)},m}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){e=document.getElementById(e)}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,r,i,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var r=o(t.container);this._container=r;var i=document.createElement("div");i.className="cesium-performanceDisplay";var a=document.createElement("div");a.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),a.appendChild(this._fpsText);var s=document.createElement("div");s.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),s.appendChild(this._msText),i.appendChild(s),i.appendChild(a),this._container.appendChild(i),this._lastFpsSampleTime=n(),this._lastMsSampleTime=n(),this._fpsFrameCount=0,this._msFrameCount=0}return a.prototype.update=function(){var e=n();this._fpsFrameCount++;var t=e-this._lastFpsSampleTime;if(t>1e3){var r=1e3*this._fpsFrameCount/t|0;this._fpsText.nodeValue=r+" FPS",this._lastFpsSampleTime=e,this._fpsFrameCount=0}this._msFrameCount++;var i=e-this._lastMsSampleTime;i>200&&(this._msText.nodeValue=(i/this._msFrameCount).toFixed(2)+" MS",this._lastMsSampleTime=e,this._msFrameCount=0)},a.prototype.destroy=function(){return r(this)},a}),define("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,r,i,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,r,i){if(!e(t._debugPickDepthViewportCommand)){t._debugPickDepthViewportCommand=r.createViewportQuadCommand("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",{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(r,i)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function d(e,t,i,o){e._depthTexture=new a({context:t,width:i,height:o,pixelFormat:r.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function h(e,t,r,n){u(e),c(e),d(e,t,r,n),e.framebuffer=new i({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,r,i){var n=i.width,o=i.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||h(t,r,n,o)}function f(t,r,i){if(!e(t._copyDepthCommand)){t._copyDepthCommand=r.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=i,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),f(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),define("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(r){r=t(r,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(r.show,!0),this.destroyPrimitives=t(r.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return i(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{};return(t._composites=t._composites||{})[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(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,r=0;r<t;++r)e[r].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(r(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(t!==i.length-1){var n=i[t];i[t]=i[t+1],i[t+1]=n}}},a.prototype.raiseToTop=function(e){if(r(e)){var t=s(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},a.prototype.lower=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(0!==t){var n=i[t];i[t]=i[t-1],i[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(r(e)){var t=s(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,r=0;r<t.length;++r)t[r].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return r.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(r.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),r.prototype.beginUpdate=t.throwInstantiationError,r.prototype.endUpdate=t.throwInstantiationError,r.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,r.prototype.loadTile=t.throwInstantiationError,r.prototype.computeTileVisibility=t.throwInstantiationError,r.prototype.showTileThisFrame=t.throwInstantiationError,r.prototype.computeDistanceToTile=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r}),define("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}function y(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new p(e._scene.canvas,!1);var r=function(){e._morphCancelled=!0,t(e)};e._completeMorph=r,e._morphHandler.setInputAction(r,f.LEFT_DOWN),e._morphHandler.setInputAction(r,f.MIDDLE_DOWN),e._morphHandler.setInputAction(r,f.RIGHT_DOWN),e._morphHandler.setInputAction(r,f.WHEEL)}}function b(e){for(var t=e._currentTweens,r=0;r<t.length;++r)t[r].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function C(e,t){ var r=e._scene,i=r.camera,n=Y,o=n.position,a=n.direction,s=n.up,u=r.mapProjection.unproject(i.position,Q);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,Z),d=m.eastNorthUpToFixedFrame(c,t,K);return l.multiplyByPointAsVector(d,i.direction,a),l.multiplyByPointAsVector(d,i.up,s),n}function w(t,r,i,n){function o(t){T(c,p,t.time,u.position),T(d,f,t.time,u.direction),T(h,m,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}r*=.5;var s=t._scene,u=s.camera,c=e.clone(u.position,J),d=e.clone(u.direction,$),h=e.clone(u.up,ee),p=l.multiplyByPoint(g.TRANSFORM_2D_INVERSE,i.position,te),f=l.multiplyByPointAsVector(g.TRANSFORM_2D_INVERSE,i.direction,re),m=l.multiplyByPointAsVector(g.TRANSFORM_2D_INVERSE,i.up,ie),v=s.tweens.add({duration:r,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:o,complete:function(){O(t,s,0,1,r,n)}});t._currentTweens.push(v)}function S(t,r,i){function n(t){T(p,g,t.time,u.position),T(f,_,t.time,u.direction),T(m,b,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var r=u.frustum;r.right=s.lerp(S,E,t.time),r.left=-r.right,r.top=r.right*(l.drawingBufferHeight/l.drawingBufferWidth),r.bottom=-r.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}r/=3;var o,l=t._scene,u=l.camera;r>0?(o=Y,e.fromDegrees(0,0,5*i.maximumRadius,i,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):(u.position.z=u.frustum.right-u.frustum.left,o=C(t,i));var c;t._morphToOrthographic?(c=ne,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.width=u.frustum.right-u.frustum.left):(c=X,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.fov=s.toRadians(60)),o.frustum=c;var d=M(o);y(t,d);var h,p=e.clone(u.position,oe),f=e.clone(u.direction,ae),m=e.clone(u.up,se),g=e.fromElements(0,0,5*i.maximumRadius,le),_=e.negate(e.UNIT_Z,ue),b=e.clone(e.UNIT_Y,ce),S=u.frustum.right,E=.5*g.z;if(h=t._morphToOrthographic?function(){w(t,r,o,d)}:function(){A(t,r,o,function(){w(t,r,o,d)})},r>0){var x=l.tweens.add({duration:r,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l._mode=v.MORPHING,h()}});t._currentTweens.push(x)}else h()}function T(t,r,i,n){return e.lerp(t,r,i,n)}function E(e,t,r,i,n){function o(e){c.frustum.fov=s.lerp(d,h,e.time);var t=p/Math.tan(.5*c.frustum.fov);i(c,t)}var l=e._scene,c=l.camera;if(!(c.frustum instanceof u)){var d=c.frustum.fov,h=.5*s.RADIANS_PER_DEGREE,p=r.position.z*Math.tan(.5*d);c.frustum.far=p/Math.tan(.5*h)+1e7;var f=l.tweens.add({duration:t,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:o,complete:function(){c.frustum=r.frustum.clone(),n(e)}});e._currentTweens.push(f)}}function x(t,r){function n(t){T(c,m,t.time,u.position),T(d,p,t.time,u.direction),T(h,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right),u._adjustOrthographicFrustum(!0)}function o(e,t){e.position.z=t}r*=.5;var s=t._scene,u=s.camera,c=e.clone(u.position,de),d=e.clone(u.direction,he),h=e.clone(u.up,pe),p=e.negate(e.UNIT_Z,me),f=e.clone(e.UNIT_Y,ge),m=fe;if(r>0)e.clone(e.ZERO,fe),m.z=5*s.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,fe);var v=_e;l.multiplyByPoint(g.TRANSFORM_2D,c,v.origin),l.multiplyByPointAsVector(g.TRANSFORM_2D,d,v.direction);var _=s.globe;if(i(_)){var b=_.pick(v,s,ye);i(b)&&(l.multiplyByPoint(g.TRANSFORM_2D_INVERSE,b,m),m.z+=e.distance(c,m))}}var C=ve;C.right=.5*m.z,C.left=-C.right,C.top=C.right*(s.drawingBufferHeight/s.drawingBufferWidth),C.bottom=-C.top;var w=be;w.position=m,w.direction=p,w.up=f,w.frustum=C;var S=R(w);y(t,S);var x=s.tweens.add({duration:r,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,w,o,S)}});t._currentTweens.push(x)}function P(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,S)}r*=.5;var s=t._scene,u=s.camera,c=we;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,Ce),s.mapProjection.project(Ce,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var d=Ee;e.clone(c.position2D,d.origin);var h=e.clone(u.directionWC,d.direction),p=n.scaleToGeodeticSurface(u.positionWC,Pe),f=m.eastNorthUpToFixedFrame(p,n,xe);l.inverseTransformation(f,f),l.multiplyByPointAsVector(f,h,h),l.multiplyByPointAsVector(g.TRANSFORM_2D,h,h);var v=s.globe;if(i(v)){var _=v.pick(d,s,Te);if(i(_)){var b=e.distance(c.position2D,_);_.x+=b,e.clone(_,c.position2D)}}}l.multiplyByPoint(g.TRANSFORM_2D,c.position,c.position2D),l.multiplyByPointAsVector(g.TRANSFORM_2D,c.direction,c.direction2D),l.multiplyByPointAsVector(g.TRANSFORM_2D,c.up,c.up2D);var C=c.frustum;C.right=.5*c.position.z,C.left=-C.right,C.top=C.right*(s.drawingBufferHeight/s.drawingBufferWidth),C.bottom=-C.top;var w=Se;l.multiplyByPoint(g.TRANSFORM_2D_INVERSE,c.position2D,w.position),e.clone(c.direction,w.direction),e.clone(c.up,w.up),w.frustum=C;var S=R(w);y(t,S),I(t,r,c,a)}function A(e,t,r,i){function n(e){l.frustum.fov=s.lerp(d,c,e.time),l.position.z=h/Math.tan(.5*l.frustum.fov)}var o=e._scene,l=o.camera,u=l.frustum.right-l.frustum.left;l.frustum=r.frustum.clone();var c=l.frustum.fov,d=.5*s.RADIANS_PER_DEGREE,h=u*Math.tan(.5*c);l.frustum.far=h/Math.tan(.5*d)+1e7,l.frustum.fov=d;var p=o.tweens.add({duration:t,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){i(e)}});e._currentTweens.push(p)}function D(t,r,i,n){function o(){function o(t){T(h,u,t.time,l.position),T(p,c,t.time,l.direction),T(f,d,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}l.frustum=i.frustum.clone();var h=e.clone(l.position,oe),p=e.clone(l.direction,ae),f=e.clone(l.up,se);h.z=u.z;var m=s.tweens.add({duration:r,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:o,complete:function(){n(t)}});t._currentTweens.push(m)}r*=.5;var s=t._scene,l=s.camera,u=e.clone(i.position,le),c=e.clone(i.direction,ue),d=e.clone(i.up,ce);s._mode=v.MORPHING,t._morphToOrthographic?o():A(t,0,i,o)}function I(t,r,i,n){function o(t){T(u,h,t.time,l.position),T(c,p,t.time,l.direction),T(d,f,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right),l._adjustOrthographicFrustum(!0)}var s=t._scene,l=s.camera,u=e.clone(l.position,oe),c=e.clone(l.direction,ae),d=e.clone(l.up,se),h=e.clone(i.position2D,le),p=e.clone(i.direction2D,ue),f=e.clone(i.up2D,ce),m=s.tweens.add({duration:r,easingFunction:a.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:o,complete:function(){O(t,s,1,0,r,n)}});t._currentTweens.push(m)}function O(e,t,r,n,o,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:o,easingFunction:a.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=v.SCENE3D,n.morphTime=v.getMorphTime(v.SCENE3D),b(r),r._previousMode!==v.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),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,v.SCENE3D,a)}}function R(t){return function(r){var n=r._scene;n._mode=v.SCENE2D,n.morphTime=v.getMorphTime(v.SCENE2D),b(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,v.SCENE2D,a)}}function L(t){return function(r){var n=r._scene;if(n._mode=v.COLUMBUS_VIEW,n.morphTime=v.getMorphTime(v.COLUMBUS_VIEW),b(r),r._previousModeMode!==v.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,v.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._morphToOrthographic=r.camera.frustum instanceof u,this._previousMode!==v.SCENE2D&&this._previousMode!==v.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,v.SCENE2D,!0),r._mode=v.MORPHING,r.camera._setTransform(l.IDENTITY),this._previousMode===v.COLUMBUS_VIEW?x(this,e):P(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var N=new e,k=new e,F=new e,B=new e,U=new e,V=new e,z=new e,G=new t,H=new l,W=new d,j=new u,q={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!==v.COLUMBUS_VIEW&&this._previousMode!==v.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,v.COLUMBUS_VIEW,!0),n.camera._setTransform(l.IDENTITY);var o=N,a=k,u=F;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*r.maximumRadius,o),e.negate(e.normalize(o,a),a),e.cross(e.UNIT_X,a,u);else{var c=n.camera;if(this._previousMode===v.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,a),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,a),e.clone(c.upWC,u);var d=r.scaleToGeodeticSurface(o,z),h=m.eastNorthUpToFixedFrame(d,r,H);l.inverseTransformation(h,h),n.mapProjection.project(r.cartesianToCartographic(o,G),o),l.multiplyByPointAsVector(h,a,a),l.multiplyByPointAsVector(h,u,u)}}var p;this._morphToOrthographic?(p=j,p.width=n.camera.frustum.right-n.camera.frustum.left,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(p=W,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,p.fov=s.toRadians(60));var f=q;f.position=o,f.direction=a,f.up=u,f.frustum=p;var _=L(f);y(this,_),this._previousMode===v.SCENE2D?D(this,t,f,_):(f.position2D=l.multiplyByPoint(g.TRANSFORM_2D,o,B),f.direction2D=l.multiplyByPointAsVector(g.TRANSFORM_2D,a,U),f.up2D=l.multiplyByPointAsVector(g.TRANSFORM_2D,u,V),n._mode=v.MORPHING,I(this,t,f,_)),0===t&&i(this._completeMorph)&&this._completeMorph()}};var Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new d;_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==v.SCENE3D&&this._previousMode!==v.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,v.SCENE3D,!0),n._mode=v.MORPHING,n.camera._setTransform(l.IDENTITY),this._previousMode===v.SCENE2D)S(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=C(this,r);var a,c=n.camera;c.frustum instanceof u?a=c.frustum.clone():(a=X,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=s.toRadians(60)),o.frustum=a;var d=M(o);y(this,d),w(this,t,o,d)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return b(this),n(this)};var Q=new t,Z=new e,K=new l,J=new e,$=new e,ee=new e,te=new e,re=new e,ie=new e,ne=new u,oe=new e,ae=new e,se=new e,le=new e,ue=new e,ce=new e,de=new e,he=new e,pe=new e,fe=new e,me=new e,ge=new e,ve=new c,_e=new h,ye=new e,be={position:void 0,direction:void 0,up:void 0,frustum:void 0},Ce=new t,we={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new c},Se={position:new e,direction:new e,up:new e,frustum:void 0},Te=new e,Ee=new h,xe=new l,Pe=new e;return _}),define("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=r,this._startObject=e(i),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return i(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},i(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(i){if(i=t(i,t.EMPTY_OBJECT),0===i.duration)return r(i.complete)&&i.complete(),new u(this);var n=i.duration/s.SECONDS_PER_MILLISECOND,a=t(i.delay,0),c=a/s.SECONDS_PER_MILLISECOND,d=t(i.easingFunction,o.LINEAR_NONE),h=i.startObject,p=new l.Tween(h);p.to(e(i.stopObject),n),p.delay(c),p.easing(d),r(i.update)&&p.onUpdate(function(){i.update(h)}),p.onComplete(t(i.complete,null)),p.repeat(t(i._repeat,0));var f=new u(this,p,i.startObject,i.stopObject,i.duration,a,d,i.update,i.complete,i.cancel);return this._tweens.push(f),f},c.prototype.addProperty=function(e){function r(e){i[n]=e.value}e=t(e,t.EMPTY_OBJECT);var i=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function i(e){for(var t=o.length,r=0;r<t;++r)n.uniforms[o[r]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&r(n.uniforms[a])&&r(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.material,i=r.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!r(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),r(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),r(i.cancel)&&i.cancel()}e.length=0},c.prototype.contains=function(e){return r(e)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,i=0;for(e=r(e)?e/s.SECONDS_PER_MILLISECOND:a();i<t.length;){var n=t[i],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?i++:(o.stop(),t.splice(i,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRoll","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x){"use strict";function P(r){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=w.LEFT_DRAG,this.zoomEventTypes=[w.RIGHT_DRAG,w.WHEEL,w.PINCH],this.rotateEventTypes=w.LEFT_DRAG,this.tiltEventTypes=[w.MIDDLE_DRAG,w.PINCH,{eventType:w.LEFT_DRAG,modifier:h.CTRL},{eventType:w.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:w.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=r,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new C(r.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new x,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=r.mapProjection;this._maxCoord=n.project(new i(Math.PI,p.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 A(e,t){if(e<0)return 0;var r=25*(1-t);return Math.exp(-r*e)}function D(t){return e.equalsEpsilon(t.startPosition,t.endPosition,p.EPSILON14)}function I(t,r,i,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(r,i),d=t.getButtonReleaseTime(r,i),h=c&&d&&(d.getTime()-c.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(c&&d&&h<te){var m=A(f,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var g=t.getLastMovement(r,i);if(!o(g)||D(g))return;u.motion.x=.5*(g.endPosition.x-g.startPosition.x),u.motion.y=.5*(g.endPosition.y-g.startPosition.y),u.startPosition=e.clone(g.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(r,i)){a(s,t.getStartMousePosition(r,i),u)}}else u.active=!1}function O(e,t,r,i,n,a){if(o(r)){var s=e._aggregator;d(r)||(re[0]=r,r=re);for(var l=r.length,u=0;u<l;++u){var c=r[u],h=o(c.eventType)?c.eventType:c,p=c.modifier,f=s.isMoving(h,p)&&s.getMovement(h,p),m=s.getStartMousePosition(h,p);e.enableInputs&&t&&(f?i(e,m,f):n<1&&I(s,h,p,n,i,e,a))}}}function M(r,i,n,a,s,l){var u=1;o(l)&&(u=p.clamp(Math.abs(l),.25,1));var c=r.minimumZoomDistance*u,d=r.maximumZoomDistance,h=s-c,f=a*h;f=p.clamp(f,r._minimumZoomRate,r._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,v=m/r._scene.canvas.clientHeight;v=Math.min(v,r.maximumMovementRatio);var _=f*v;if(!(_>0&&Math.abs(s-c)<1||_<0&&Math.abs(s-d)<1)){s-_<c?_=s-c-1:s-_>d&&(_=s-d);var y=r._scene,b=y.camera,C=y.mode,w=xe.orientation;if(w.heading=b.heading,w.pitch=b.pitch,w.roll=b.roll,b.frustum instanceof g)return void(Math.abs(_)>0&&(b.zoomIn(_),b._adjustOrthographicFrustum()));var S,x=e.equals(i,r._zoomMouseStart),P=r._zoomingOnVector,A=r._rotatingZoom;if(x||(r._zoomMouseStart=e.clone(i,r._zoomMouseStart),o(r._globe)&&(S=C!==T.SCENE2D?B(r,i,ne):b.getPickRay(i,ie).origin),o(S)?(r._useZoomWorldPosition=!0,r._zoomWorldPosition=t.clone(S,r._zoomWorldPosition)):r._useZoomWorldPosition=!1,P=r._zoomingOnVector=!1,A=r._rotatingZoom=!1),!r._useZoomWorldPosition)return void b.zoomIn(_);var D=C===T.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(A=!0),!x||A){if(C===T.SCENE2D){var I=r._zoomWorldPosition,O=b.position;if(!t.equals(I,O)&&b.positionCartographic.height<2*r._maxCoord.x){var M=b.position.x,R=t.subtract(I,O,ae);t.normalize(R,R);var L=t.distance(I,O)*_/(.5*b.getMagnitude());b.move(R,.5*L),(b.position.x<0&&M>0||b.position.x>0&&M<0)&&(S=b.getPickRay(i,ie).origin,r._zoomWorldPosition=t.clone(S,r._zoomWorldPosition))}}else if(C===T.SCENE3D){var N=t.normalize(b.position,he);if(b.positionCartographic.height<3e3&&Math.abs(t.dot(b.direction,N))<.6)D=!0;else{var k=y.canvas,F=se;F.x=k.clientWidth/2,F.y=k.clientHeight/2;var U=B(r,F,le);if(o(U)&&b.positionCartographic.height<1e6){var V=fe;t.clone(b.position,V);var z=r._zoomWorldPosition,G=pe;if(G=t.normalize(z,G),t.dot(G,N)<0)return;var H=we,W=ve;t.clone(b.direction,W),t.add(V,t.multiplyByScalar(W,1e3,Se),H);var j=_e,q=ye;t.subtract(z,V,j),t.normalize(j,q);var Y=t.dot(N,q);if(Y>=0)return void(r._zoomMouseStart.x=-1);var X=Math.acos(-Y),Q=t.magnitude(V),Z=t.magnitude(z),K=Q-_,J=t.magnitude(j),$=Math.asin(p.clamp(J/Z*Math.sin(X),-1,1)),ee=Math.asin(p.clamp(K/Z*Math.sin(X),-1,1)),te=$-ee+X,re=me;t.normalize(V,re);var Pe=ge;Pe=t.cross(q,re,Pe),Pe=t.normalize(Pe,Pe),t.normalize(t.cross(re,Pe,Se),W),t.multiplyByScalar(t.normalize(H,Se),t.magnitude(H)-_,H),t.normalize(V,V),t.multiplyByScalar(V,K,V);var Ae=be;t.multiplyByScalar(t.add(t.multiplyByScalar(re,Math.cos(te)-1,Te),t.multiplyByScalar(W,Math.sin(te),Ee),Se),K,Ae),t.add(V,Ae,V),t.normalize(H,re),t.normalize(t.cross(re,Pe,Se),W);var De=Ce;return t.multiplyByScalar(t.add(t.multiplyByScalar(re,Math.cos(te)-1,Te),t.multiplyByScalar(W,Math.sin(te),Ee),Se),t.magnitude(H),De),t.add(H,De,H),t.clone(V,b.position),t.normalize(t.subtract(H,V,Se),b.direction),t.clone(b.direction,b.direction),t.cross(b.direction,b.up,b.right),t.cross(b.right,b.direction,b.up),void b.setView(xe)}if(o(U)){var Ie=t.normalize(U,ue),Oe=t.normalize(r._zoomWorldPosition,ce),Me=t.dot(Oe,Ie);if(Me>0&&Me<1){var Re=p.acosClamped(Me),Le=t.cross(Oe,Ie,de),Ne=Math.abs(Re)>p.toRadians(20)?.75*b.positionCartographic.height:b.positionCartographic.height-_,ke=_/Ne;b.rotate(Le,Re*ke)}}else D=!0}}r._rotatingZoom=!D}if(!x&&D||P){var Fe,Be=E.wgs84ToWindowCoordinates(y,r._zoomWorldPosition,oe);Fe=C!==T.COLUMBUS_VIEW&&e.equals(i,r._zoomMouseStart)&&o(Be)?b.getPickRay(Be,ie):b.getPickRay(i,ie);var Ue=Fe.direction;C===T.COLUMBUS_VIEW&&t.fromElements(Ue.y,Ue.z,Ue.x,Ue),b.move(Ue,_),r._zoomingOnVector=!0}else b.zoomIn(_);b.setView(xe)}}function R(e,r,i){var n=e._scene,o=n.camera,a=o.getPickRay(i.startPosition,Pe).origin,s=o.getPickRay(i.endPosition,Ae).origin,l=t.subtract(a,s,De),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function L(e,t,r){o(r.distance)&&(r=r.distance);var i=e._scene,n=i.camera;M(e,t,r,e._zoomFactor,n.getMagnitude())}function N(t,r,i){if(o(i.angleAndHeight))return void k(t,r,i.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ie;c.x=2/l*i.startPosition.x-1,c.y=2/u*(u-i.startPosition.y)-1,c=e.normalize(c,c);var d=Oe;d.x=2/l*i.endPosition.x-1,d.y=2/u*(u-i.endPosition.y)-1,d=e.normalize(d,d);var h=p.acosClamped(c.x);c.y<0&&(h=p.TWO_PI-h);var f=p.acosClamped(d.x);d.y<0&&(f=p.TWO_PI-f);var m=f-h;a.twistRight(m)}function k(e,t,r){var i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(r.endPosition.x-r.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=i*s*Math.PI*4;o.twistRight(l)}function F(e){var t=e._scene.mapMode2D===S.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(O(e,e.enableTranslate,e.translateEventTypes,R,e.inertiaTranslate,"_lastInertiaTranslateMovement"),O(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&O(e,e.enableRotate,e.tiltEventTypes,N,e.inertiaSpin,"_lastInertiaTiltMovement")):(O(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&O(e,e.enableRotate,e.translateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,r,i){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(r,Re));var u=s.getPickRay(r,Me),c=a.pick(u,n,Le);return(o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY)<(o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY)?t.clone(l,i):t.clone(c,i)}}function U(r,i,n){if(t.equals(i,r._translateMousePosition)||(r._looking=!1),t.equals(i,r._strafeMousePosition)||(r._strafing=!1),r._looking)return void $(r,i,n);if(r._strafing)return void j(r,i,n);var a,s=r._scene,l=s.camera,u=e.clone(n.startPosition,Ge),d=e.clone(n.endPosition,He),h=l.getPickRay(u,Ne),f=t.clone(t.ZERO,Ve),m=t.UNIT_X;if(l.position.z<r._minimumPickingTerrainHeight&&(a=B(r,u,Fe),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,r._strafeStartPosition),r._strafing=!0,j(r,i,n),void(r._strafeMousePosition=e.clone(i,r._strafeMousePosition));var g=v.fromPointNormal(f,m,ze);h=l.getPickRay(u,Ne);var _=c.rayPlane(h,g,Fe),y=l.getPickRay(d,ke),b=c.rayPlane(y,g,Be);if(!o(_)||!o(b))return r._looking=!0,$(r,i,n),void e.clone(i,r._translateMousePosition);var C=t.subtract(_,b,Ue),w=C.x;C.x=C.y,C.y=C.z,C.z=w;var S=t.magnitude(C);S>p.EPSILON6&&(t.normalize(C,C),l.move(C,S))}function V(t,r,i){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void $(t,r,i);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,z(t,r,i)):G(t,r,i)}function z(r,i,n){var a=r._scene,s=a.camera,u=a.canvas,c=We;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,h=s.getPickRay(c,je),f=t.UNIT_X,g=h.origin,v=h.direction,_=t.dot(f,v);if(Math.abs(_)>p.EPSILON6&&(d=-t.dot(f,g)/_),!o(d)||d<=0)return r._looking=!0,$(r,i,n),void e.clone(i,r._tiltCenterMousePosition);var y=t.multiplyByScalar(v,d,qe);t.add(g,y,y);var C=a.mapProjection,w=C.ellipsoid;t.fromElements(y.y,y.z,y.x,y);var S=C.unproject(y,$e);w.cartographicToCartesian(S,y);var T=b.eastNorthUpToFixedFrame(y,w,Xe),E=r._globe,x=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var P=m.clone(s.transform,et);s._setTransform(T),Y(r,i,n,t.UNIT_Z),s._setTransform(P),r._globe=E,r._ellipsoid=x;var A=x.maximumRadius;r._rotateFactor=1/A,r._rotateRateRangeAdjustment=A}function G(r,i,n){var a,s,u=r._scene,d=u.camera,h=t.UNIT_X;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,qe);else{if(d.position.z<r._minimumPickingTerrainHeight&&(a=B(r,i,qe)),!o(a)){s=d.getPickRay(i,je);var g,y=s.origin,C=s.direction,w=t.dot(h,C);if(Math.abs(w)>p.EPSILON6&&(g=-t.dot(h,y)/w),!o(g)||g<=0)return r._looking=!0,$(r,i,n),void e.clone(i,r._tiltCenterMousePosition);a=t.multiplyByScalar(C,g,qe),t.add(y,a,a)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var S=u.canvas,T=We;T.x=S.clientWidth/2,T.y=r._tiltCenterMousePosition.y,s=d.getPickRay(T,je);var E=t.clone(t.ZERO,Ze);E.x=a.x;var x=v.fromPointNormal(E,h,Ke),P=c.rayPlane(s,x,Ye),A=d._projection,D=A.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var I=A.unproject(a,$e);D.cartographicToCartesian(I,a);var O,M=b.eastNorthUpToFixedFrame(a,D,Xe);o(P)?(t.fromElements(P.y,P.z,P.x,P),I=A.unproject(P,$e),D.cartographicToCartesian(I,P),O=b.eastNorthUpToFixedFrame(P,D,Qe)):O=M;var R=r._globe,L=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var N=t.UNIT_Z,k=m.clone(d.transform,et);d._setTransform(M);var F=t.cross(t.UNIT_Z,t.normalize(d.position,Je),Je),U=t.dot(d.right,F);if(Y(r,i,n,N,!1,!0),d._setTransform(O),U<0){n.startPosition.y>n.endPosition.y&&(N=void 0);var V=d.constrainedAxis;d.constrainedAxis=void 0,Y(r,i,n,N,!0,!1),d.constrainedAxis=V}else Y(r,i,n,N,!0,!1);if(o(d.constrainedAxis)){var z=t.cross(d.direction,d.constrainedAxis,it);t.equalsEpsilon(z,t.ZERO,p.EPSILON6)||(t.dot(z,d.right)<0&&t.negate(z,z),t.cross(z,d.direction,d.up),t.cross(d.direction,d.up,d.right),t.normalize(d.up,d.up),t.normalize(d.right,d.right))}d._setTransform(k),r._globe=R,r._ellipsoid=L;var G=L.maximumRadius;r._rotateFactor=1/G,r._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Je);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(O),d.worldToCameraCoordinatesPoint(H,H);var W=t.magnitudeSquared(H);t.magnitudeSquared(d.position)>W&&(t.normalize(d.position,d.position),t.multiplyByScalar(d.position,Math.sqrt(W),d.position));var j=t.angleBetween(H,d.position),q=t.cross(H,d.position,H);t.normalize(q,q);var X=_.fromAxisAngle(q,j,tt),Q=f.fromQuaternion(X,rt);f.multiplyByVector(Q,d.direction,d.direction),f.multiplyByVector(Q,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(k)}}function H(e,r,i){o(i.distance)&&(i=i.distance);var n=e._scene,a=n.camera,s=n.canvas,l=nt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,ot);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,at));var d;if(o(u))d=t.distance(c.origin,u);else{var h=t.UNIT_X,p=c.origin,f=c.direction;d=-t.dot(h,p)/t.dot(h,f)}M(e,r,i,e._zoomFactor,d)}function W(e){var t=e._scene,r=t.camera;if(m.equals(m.IDENTITY,r.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),O(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),O(e,e.enableTranslate,e.translateEventTypes,U,e.inertiaTranslate,"_lastInertiaTranslateMovement"),O(e,e.enableZoom,e.zoomEventTypes,H,e.inertiaZoom,"_lastInertiaZoomMovement"),O(e,e.enableLook,e.lookEventTypes,$),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=i.add(n))}i.update()}else O(e,e.enableRotate,e.rotateEventTypes,Y,e.inertiaSpin,"_lastInertiaSpinMovement"),O(e,e.enableZoom,e.zoomEventTypes,Q,e.inertiaZoom,"_lastInertiaZoomMovement")}function j(e,r,i){var n=e._scene,a=n.camera,s=B(e,i.startPosition,dt);if(o(s)){var l=i.endPosition,u=a.getPickRay(l,st),d=t.clone(a.direction,ct);n.mode===T.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=v.fromPointNormal(s,d,lt),p=c.rayPlane(u,h,ut);o(p)&&(d=t.subtract(s,p,d),n.mode===T.COLUMBUS_VIEW&&t.fromElements(d.y,d.z,d.x,d),t.add(a.position,d,a.position))}}function q(r,i,n){var a=r._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void Y(r,i,n);var u,c,d,h,p=r._ellipsoid.geodeticSurfaceNormal(s.position,gt),f=r._ellipsoid.cartesianToCartographic(s.positionWC,pt).height,g=r._globe,v=!1;if(o(g)&&f<r._minimumPickingTerrainHeight&&(h=B(r,n.startPosition,dt),o(h))){var _=s.getPickRay(n.startPosition,Me),y=r._ellipsoid.geodeticSurfaceNormal(h);v=Math.abs(t.dot(_.direction,y))<.05,v&&!r._looking&&(r._rotating=!1,r._strafing=!0)}if(e.equals(i,r._rotateMousePosition))return void(r._looking?$(r,i,n,p):r._rotating?Y(r,i,n):r._strafing?(t.clone(h,r._strafeStartPosition),j(r,i,n)):(u=t.magnitude(r._rotateStartPosition),c=ft,c.x=c.y=c.z=u, d=l.fromCartesian3(c,mt),X(r,i,n,d)));r._looking=!1,r._rotating=!1,r._strafing=!1,o(g)&&f<r._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,r._strafeStartPosition),r._strafing=!0,j(r,i,n)):(u=t.magnitude(h),c=ft,c.x=c.y=c.z=u,d=l.fromCartesian3(c,mt),X(r,i,n,d),t.clone(h,r._rotateStartPosition)):(r._looking=!0,$(r,i,n,p)):o(s.pickEllipsoid(n.startPosition,r._ellipsoid,ht))?(X(r,i,n,r._ellipsoid),t.clone(ht,r._rotateStartPosition)):f>r._minimumTrackBallHeight?(r._rotating=!0,Y(r,i,n)):(r._looking=!0,$(r,i,n,p)),e.clone(i,r._rotateMousePosition)}function Y(e,r,i,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,d=u.canvas,h=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),f=e._rotateFactor*(p-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);var m=(i.startPosition.x-i.endPosition.x)/d.clientWidth,g=(i.startPosition.y-i.endPosition.y)/d.clientHeight;m=Math.min(m,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);var v=f*m*Math.PI*2,_=f*g*Math.PI;s||c.rotateRight(v),l||c.rotateUp(_),c.constrainedAxis=h}function X(r,i,n,a){var s=r._scene,l=s.camera,u=e.clone(n.startPosition,St),c=e.clone(n.endPosition,Tt),d=l.pickEllipsoid(u,a,vt),h=l.pickEllipsoid(c,a,_t);if(!o(d)||!o(h))return r._rotating=!0,void Y(r,i,n);if(d=l.worldToCameraCoordinates(d,d),h=l.worldToCameraCoordinates(h,h),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,yt);t.cross(m,f,m),t.normalize(m,m);var g=t.cross(f,m,bt),v=t.magnitude(d),_=t.dot(f,d),y=Math.acos(_/v),b=t.multiplyByScalar(f,_,Ct);t.subtract(d,b,b),t.normalize(b,b);var C=t.magnitude(h),w=t.dot(f,h),S=Math.acos(w/C),T=t.multiplyByScalar(f,w,wt);t.subtract(h,T,T),t.normalize(T,T);var E=Math.acos(t.dot(b,m));t.dot(b,g)<0&&(E=p.TWO_PI-E);var x=Math.acos(t.dot(T,m));t.dot(T,g)<0&&(x=p.TWO_PI-x);var P,A=E-x;P=t.equalsEpsilon(f,l.position,p.EPSILON2)?l.right:t.cross(f,l.position,yt);var D,I=t.cross(f,P,yt),O=t.dot(I,t.subtract(d,f,bt)),M=t.dot(I,t.subtract(h,f,bt));D=O>0&&M>0?S-y:O>0&&M<=0?t.dot(l.position,f)>0?-y-S:y+S:y-S,l.rotateRight(A),l.rotateUp(D)}else{t.normalize(d,d),t.normalize(h,h);var R=t.dot(d,h),L=t.cross(d,h,yt);if(R<1&&!t.equalsEpsilon(L,t.ZERO,p.EPSILON14)){var N=Math.acos(R);l.rotate(L,N)}}}function Q(e,r,i){o(i.distance)&&(i=i.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=nt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=s.getPickRay(u,ot),h=n.cartesianToCartographic(s.position,xt).height;h<e._minimumPickingTerrainHeight&&(c=B(e,u,at));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,Et);M(e,r,i,e._zoomFactor,p,t.dot(f,s.direction))}function Z(t,r,i){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){return void $(t,r,i,t._ellipsoid.geodeticSurfaceNormal(a.position,Ft))}var s=t._ellipsoid,l=s.cartesianToCartographic(a.position,kt);t._tiltOnEllipsoid||l.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,K(t,r,i)):J(t,r,i)}}function K(r,i,n){var a=r._ellipsoid,s=r._scene,u=s.camera,d=.25*r.minimumZoomDistance,h=a.cartesianToCartographic(u.positionWC,Bt).height;if(!(h-d-1<p.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,g=Pt;g.x=f.clientWidth/2,g.y=f.clientHeight/2;var v,_=u.getPickRay(g,At),C=c.rayEllipsoid(_,a);if(o(C))v=y.getPoint(_,C.start,Dt);else{if(!(h>r._minimumTrackBallHeight)){r._looking=!0;return $(r,i,n,r._ellipsoid.geodeticSurfaceNormal(u.position,Ft)),void e.clone(i,r._tiltCenterMousePosition)}var w=c.grazingAltitudeLocation(_,a);if(!o(w))return;var S=a.cartesianToCartographic(w,kt);S.height=0,v=a.cartographicToCartesian(S,Dt)}var T=b.eastNorthUpToFixedFrame(v,a,Ot),E=r._globe,x=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var P=m.clone(u.transform,Rt);u._setTransform(T),Y(r,i,n,t.UNIT_Z),u._setTransform(P),r._globe=E,r._ellipsoid=x;var A=x.maximumRadius;r._rotateFactor=1/A,r._rotateRateRangeAdjustment=A}}function J(r,i,n){var a,s,u,d=r._ellipsoid,h=r._scene,g=h.camera;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,Dt);else{if(a=B(r,i,Dt),!o(a)){if(s=g.getPickRay(i,At),u=c.rayEllipsoid(s,d),!o(u)){if(d.cartesianToCartographic(g.position,kt).height<=r._minimumTrackBallHeight){r._looking=!0;$(r,i,n,r._ellipsoid.geodeticSurfaceNormal(g.position,Ft)),e.clone(i,r._tiltCenterMousePosition)}return}a=y.getPoint(s,u.start,Dt)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var v=h.canvas,C=Pt;C.x=v.clientWidth/2,C.y=r._tiltCenterMousePosition.y,s=g.getPickRay(C,At);var w=t.magnitude(a),S=t.fromElements(w,w,w,ft),T=l.fromCartesian3(S,mt);if(u=c.rayEllipsoid(s,T),o(u)){var E=t.magnitude(s.origin)>w?u.start:u.stop,x=y.getPoint(s,E,It),P=b.eastNorthUpToFixedFrame(a,d,Ot),A=b.eastNorthUpToFixedFrame(x,T,Mt),D=r._globe,I=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,M=m.clone(g.transform,Rt);g._setTransform(P);var R=t.cross(x,g.positionWC,it),L=t.dot(g.rightWC,R);if(Y(r,i,n,O,!1,!0),g._setTransform(A),L<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var N=g.constrainedAxis;g.constrainedAxis=void 0,Y(r,i,n,O,!0,!1),g.constrainedAxis=N}else Y(r,i,n,O,!0,!1);if(o(g.constrainedAxis)){var k=t.cross(g.direction,g.constrainedAxis,it);t.equalsEpsilon(k,t.ZERO,p.EPSILON6)||(t.dot(k,g.right)<0&&t.negate(k,k),t.cross(k,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g._setTransform(M),r._globe=D,r._ellipsoid=I;var F=I.maximumRadius;r._rotateFactor=1/F,r._rotateRateRangeAdjustment=F;var U=t.clone(g.positionWC,it);if(g._adjustHeightForTerrain(),!t.equals(g.positionWC,U)){g._setTransform(A),g.worldToCameraCoordinatesPoint(U,U);var V=t.magnitudeSquared(U);t.magnitudeSquared(g.position)>V&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(V),g.position));var z=t.angleBetween(U,g.position),G=t.cross(U,g.position,U);t.normalize(G,G);var H=_.fromAxisAngle(G,z,Lt),W=f.fromQuaternion(H,Nt);f.multiplyByVector(W,g.direction,g.direction),f.multiplyByVector(W,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g._setTransform(M)}}}function $(e,r,i,a){var s=e._scene,l=s.camera,u=Ut;u.x=i.startPosition.x,u.y=0;var c=Vt;c.x=i.endPosition.x,c.y=0;var d,h,f=l.getPickRay(u,zt),m=l.getPickRay(c,Gt),v=0;l.frustum instanceof g?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction);var _=t.dot(d,h);_<1&&(v=Math.acos(_)),v=i.startPosition.x>i.endPosition.x?-v:v;var y=e._horizontalRotationAxis;if(o(a)?l.look(a,-v):o(y)?l.look(y,-v):l.lookLeft(v),u.x=0,u.y=i.startPosition.y,c.x=0,c.y=i.endPosition.y,f=l.getPickRay(u,zt),m=l.getPickRay(c,Gt),v=0,l.frustum instanceof g?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction),_=t.dot(d,h),_<1&&(v=Math.acos(_)),v=i.startPosition.y>i.endPosition.y?-v:v,a=n(a,y),o(a)){var b=l.direction,C=t.negate(a,Ht),w=t.equalsEpsilon(b,a,p.EPSILON2),S=t.equalsEpsilon(b,C,p.EPSILON2);if(w||S)(w&&v<0||S&&v>0)&&l.look(l.right,-v);else{_=t.dot(b,a);var T=p.acosClamped(_);v>0&&v>T&&(v=T-p.EPSILON4),_=t.dot(b,C),T=p.acosClamped(_),v<0&&-v>T&&(v=-T+p.EPSILON4);var E=t.cross(a,b,Wt);l.look(E,v)}}else l.lookUp(v)}function ee(e){O(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),O(e,e.enableZoom,e.zoomEventTypes,Q,e.inertiaZoom,"_lastInertiaZoomMovement"),O(e,e.enableTilt,e.tiltEventTypes,Z,e.inertiaSpin,"_lastInertiaTiltMovement"),O(e,e.enableLook,e.lookEventTypes,$)}var te=.4,re=[],ie=new y,ne=new t,oe=new e,ae=new t,se=new e,le=new t,ue=new t,ce=new t,de=new t,he=new t,pe=new t,fe=new t,me=new t,ge=new t,ve=new t,_e=new t,ye=new t,be=new t,Ce=new t,we=new t,Se=new t,Te=new t,Ee=new t,xe={orientation:new u},Pe=new y,Ae=new y,De=new t,Ie=new e,Oe=new e,Me=new y,Re=new t,Le=new t,Ne=new y,ke=new y,Fe=new t,Be=new t,Ue=new t,Ve=new t,ze=new v(t.UNIT_X,0),Ge=new e,He=new e,We=new e,je=new y,qe=new t,Ye=new t,Xe=new m,Qe=new m,Ze=new t,Ke=new v(t.UNIT_X,0),Je=new t,$e=new i,et=new m,tt=new _,rt=new f,it=new t,nt=new e,ot=new y,at=new t,st=new y,lt=new v(t.UNIT_X,0),ut=new t,ct=new t,dt=new t,ht=new t,pt=new i,ft=new t,mt=new l,gt=new t,vt=r.clone(r.UNIT_W),_t=r.clone(r.UNIT_W),yt=new t,bt=new t,Ct=new t,wt=new t,St=new e,Tt=new e,Et=new t,xt=new i,Pt=new e,At=new y,Dt=new t,It=new t,Ot=new m,Mt=new m,Rt=new m,Lt=new _,Nt=new f,kt=new i,Ft=new t,Bt=new i,Ut=new e,Vt=new e,zt=new y,Gt=new y,Ht=new t,Wt=new t;return P.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 r=this._scene,i=r.mode;i===T.SCENE2D?F(this):i===T.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,W(this)):i===T.SCENE3D&&(this._horizontalRotationAxis=void 0,ee(this)),this._aggregator.reset()},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},P}),define("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function r(){}return r.getShadowCastShaderKeyword=function(e,t,r,i){return"castShadow "+e+" "+t+" "+r+" "+i},r.createShadowCastVertexShader=function(r,i,n){var o=r.defines.slice(0),a=r.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(r),l=e(s);if(i&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");a.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new t({defines:o,sources:a})},r.createShadowCastFragmentShader=function(r,i,n,o){var a=r.defines.slice(0),s=r.sources.slice(0),l=t.findPositionVarying(r),u=e(l);u||(l="v_positionEC");for(var c=s.length,d=0;d<c;++d)s[d]=t.replaceMain(s[d],"czm_shadow_cast_main");var h="";return i&&(u||(h+="varying vec3 v_positionEC; \n"),h+="uniform vec4 shadowMap_lightPositionEC; \n"),h+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",h+=i?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",h+="} \n",s.push(h),new t({defines:a,sources:s})},r.getShadowReceiveShaderKeyword=function(e,t,r,i){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(e._numberOfCascades>1)+e.debugCascadeColors+e.softShadows+t+r+i},r.createShadowReceiveVertexShader=function(e,r,i){var n=e.defines.slice(0),o=e.sources.slice(0);return r&&(i?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},r.createShadowReceiveFragmentShader=function(r,i,n,o,a){for(var s=t.findNormalVarying(r),l=!o&&e(s)||o&&a,u=t.findPositionVarying(r),c=e(u),d=i._usesDepthTexture,h=i._polygonOffsetSupported,p=i._isPointLight,f=i._isSpotLight,m=i._numberOfCascades>1,g=i.debugCascadeColors,v=i.softShadows,_=p?i._pointBias:o?i._terrainBias:i._primitiveBias,y=r.defines.slice(0),b=r.sources.slice(0),C=b.length,w=0;w<C;++w)b[w]=t.replaceMain(b[w],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):d&&y.push("USE_SHADOW_DEPTH_TEXTURE"),v&&!p&&y.push("USE_SOFT_SHADOWS"),m&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var S="";return S+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",S+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(_.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",S+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",S+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?S+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(S+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),S+=p?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":f?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":m?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(g?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",S+=" gl_FragColor.rgb *= visibility; \n} \n",b.push(S),new t({defines:y,sources:b})},r}),define("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./DebugCameraPrimitive","./PerInstanceColorAppearance","./Primitive","./ShadowMapShader"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q){"use strict";function Z(e){e=h(e,h.EMPTY_OBJECT);var r=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this._normalOffset=h(e.normalOffset,!0),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;(v.isInternetExplorer()||v.isEdge()||(v.isChrome()||v.isFirefox())&&v.isWindows()&&!r.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new 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 i,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new w:p(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 K(r);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=r.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$(this),this._clearCommand=new A({depth:1,color:new l}),this._clearPassState=new L(r),this._size=h(e.size,2048),this.size=this._size}function K(e){this.camera=new fe,this.passState=new L(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return B.fromCache({cull:{enabled:!0,face:j.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function $(e){var t=!e._usesDepthTexture;e._primitiveRenderState=J(t,e._primitiveBias),e._terrainRenderState=J(t,e._terrainBias),e._pointRenderState=J(t,e._pointBias)}function ee(e){for(var t=e._passes.length,r=0;r<t;++r){var i=e._passes[r],n=i.framebuffer;p(n)&&!n.isDestroyed()&&n.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function te(){return new U({wrapS:H.CLAMP_TO_EDGE,wrapT:H.CLAMP_TO_EDGE,minificationFilter:G.NEAREST,magnificationFilter:z.NEAREST})}function re(e,t){for(var r=new k({context:t,width:e._textureSize.x,height:e._textureSize.y,format:F.DEPTH_COMPONENT16}),i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:T.RGBA,pixelDatatype:N.UNSIGNED_BYTE,sampler:te()}),n=new M({context:t,depthRenderbuffer:r,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=i,e._depthAttachment=r,e._colorAttachment=i}function ie(e,t){for(var r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:T.DEPTH_STENCIL,pixelDatatype:N.UNSIGNED_INT_24_8,sampler:te()}),i=new M({context:t,depthStencilTexture:r,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=r,e._depthAttachment=r}function ne(e,t){for(var r=new k({context:t,width:e._textureSize.x,height:e._textureSize.y,format:F.DEPTH_COMPONENT16}),i=new I({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:T.RGBA,pixelDatatype:N.UNSIGNED_BYTE,sampler:te()}),n=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ],o=0;o<6;++o){var a=new M({context:t,depthRenderbuffer:r,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=r,e._colorAttachment=i}function oe(e,t){e._isPointLight?ne(e,t):e._usesDepthTexture?ie(e,t):re(e,t)}function ae(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==P.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){p(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(ee(e),oe(e,t),ae(e,t),le(e,t))}function le(e,t,r){r=h(r,0),(e._isPointLight||0===r)&&(e._clearCommand.framebuffer=e._passes[r].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ue(t,r){t._size=r;var i=t._passes,n=i.length,o=t._textureSize;if(t._isPointLight){r=D.maximumCubeMapSize>=r?r:D.maximumCubeMapSize,o.x=r,o.y=r;var a=new e(0,0,r,r);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===n?(r=D.maximumTextureSize>=r?r:D.maximumTextureSize,o.x=r,o.y=r,i[0].passState.viewport=new e(0,0,r,r)):4===n&&(r=D.maximumTextureSize>=2*r?r:D.maximumTextureSize/2,o.x=2*r,o.y=2*r,i[0].passState.viewport=new e(0,0,r,r),i[1].passState.viewport=new e(r,0,r,r),i[2].passState.viewport=new e(0,r,r,r),i[3].passState.viewport=new e(r,r,r,r));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=i[s],u=l.passState.viewport,c=u.x/o.x,d=u.y/o.y,h=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(h,0,0,c,0,p,0,d,0,0,1,0,0,0,0,1)}}function ce(e,t){var r;r=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var i=t.createViewportQuadCommand(r,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=R.OVERLAY,i}function de(t,r){var i=r.context,n=r.context.drawingBufferWidth,o=r.context.drawingBufferHeight,a=.3*Math.min(n,o),s=we;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;p(l)||(l=ce(t,i),t._debugShadowViewCommand=l),p(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=B.fromCache({viewport:e.clone(s)})),r.commandList.push(t._debugShadowViewCommand)}function he(e,t){var i=new _({geometry:new r({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new _({geometry:new x({radius:.5}),attributes:{color:u.fromColor(t)}});return new X({geometryInstances:[i,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function pe(e,t){de(e,t);var r=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(r&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new q({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){r&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var i=0;i<e._numberOfCascades;++i)r&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new q({camera:e._passes[i].camera,color:Pe[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!p(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=E.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Ae),c=C.fromTranslationQuaternionRotationScale(o,a,u,Te);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else p(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 me(e,t){var r,i=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,d=l/s,h=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,h=.9);var f=Me,m=Ie;for(m[0]=s,m[u]=l,r=0;r<u;++r){var g=(r+1)/u,v=s*Math.pow(d,g),_=s+c*g,y=b.lerp(_,v,h);m[r+1]=y,f[r]=y-m[r]}if(p){for(r=0;r<u;++r)f[r]=Math.min(f[r],e._maximumCascadeDistances[r]);var w=m[0];for(r=0;r<u-1;++r)w+=f[r],m[r+1]=w}o.unpack(m,0,e._cascadeSplits[0]),o.unpack(m,1,e._cascadeSplits[1]),o.unpack(f,0,e._cascadeDistances);var S=i.frustum,T=S.left,E=S.right,x=S.bottom,P=S.top,A=S.near,D=S.far,I=i.positionWC,O=i.directionWC,M=i.upWC,R=a.frustum.clone(Oe),L=i.getViewProjection();for(r=0;r<u;++r){R.near=m[r],R.far=m[r+1];for(var N=C.multiply(R.projectionMatrix,a.viewMatrix,Te),k=C.inverse(N,Te),F=C.multiply(L,k,Te),B=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Re),U=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),V=0;V<8;++V){var z=o.clone(Se[V],Ee[V]);C.multiplyByVector(F,z,z),n.divideByScalar(z,z.w,z),n.minimumByComponent(z,B,B),n.maximumByComponent(z,U,U)}B.x=Math.max(B.x,0),B.y=Math.max(B.y,0),B.z=0,U.x=Math.min(U.x,1),U.y=Math.min(U.y,1),U.z=Math.min(U.z,1);var G=e._passes[r],H=G.camera;H.clone(i);var W=H.frustum;W.left=T+B.x*(E-T),W.right=T+U.x*(E-T),W.bottom=x+B.y*(P-x),W.top=x+U.y*(P-x),W.near=A+B.z*(D-A),W.far=A+U.z*(D-A),G.cullingVolume=H.frustum.computeCullingVolume(I,O,M);var j=e._cascadeMatrices[r];C.multiply(H.getViewProjection(),a.inverseViewMatrix,j),C.multiply(G.textureOffsets,j,j)}}function ge(e,t){var r=e._shadowMapCamera,i=e._sceneCamera,a=C.multiply(i.frustum.projectionMatrix,i.viewMatrix,Te),s=C.inverse(a,Te),l=r.directionWC,u=i.directionWC,c=n.cross(l,u,ke);u=n.cross(c,l,Fe),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,Be),h=C.computeView(d,l,u,c,Ne),p=C.multiply(h,s,Te),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Re),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),g=0;g<8;++g){var v=o.clone(Se[g],Ee[g]);C.multiplyByVector(p,v,v),n.divideByScalar(v,v.w,v),n.minimumByComponent(v,f,f),n.maximumByComponent(v,m,m)}m.z+=1e3,f.z-=10;var _=Be ;_.x=-.5*(f.x+m.x),_.y=-.5*(f.y+m.y),_.z=-m.z;var y=C.fromTranslation(_,Te);h=C.multiply(y,h,h);var b=.5*(m.x-f.x),w=.5*(m.y-f.y),S=m.z-f.z,T=r.frustum;T.left=-b,T.right=b,T.bottom=-w,T.top=w,T.near=.01,T.far=S,C.clone(h,r.viewMatrix),C.inverse(h,r.inverseViewMatrix),C.getTranslation(r.inverseViewMatrix,r.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),n.clone(l,r.directionWC),n.clone(u,r.upWC),n.clone(c,r.rightWC)}function ve(e,t){var r=new S;r.fov=b.PI_OVER_TWO,r.near=1,r.far=e._pointLightRadius,r.aspectRatio=1;for(var i=0;i<6;++i){var n=e._passes[i].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=Ue[i],n.upWC=Ve[i],n.rightWC=ze[i],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=r}}function _e(e,r){var i=e._sceneCamera,o=e._shadowMapCamera,a=We;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=r.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,Ge),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=b.clamp(u/.1,0,1);if(e._darkness=b.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=r.cullingVolume.computeVisibility(a)===y.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var d=o.frustum.far/2,h=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,d,je),je);a.center=h,a.radius=d,e._outOfView=r.cullingVolume.computeVisibility(a)===y.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function ye(e,t){var r=t.camera,i=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(i.directionWC,a.directionWC):e._isPointLight?n.clone(i.positionWC,a.positionWC):a.clone(i);var s=e._lightDirectionEC;C.multiplyByPointAsVector(r.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(r.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=r.frustum.near,u=e.maximumDistance),e._sceneCamera=W.clone(r,o),r.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,_e(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function be(e,t,r){var i=e._isPointLight?e._pointBias:r?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=qe;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Ce(e,t,r,i,n,o){var a,l,u;if(p(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=O.shallowClone(r,o),o.castShadows=!0,o.receiveShadows=!1,!p(a)||n!==r.shaderProgram.id||t){var c=r.shaderProgram,d=r.pass===R.GLOBE,h=r.pass!==R.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,g=Q.getShadowCastShaderKeyword(f,d,m,h);if(a=i.shaderCache.getDerivedShaderProgram(c,g),!p(a)){var v=c.vertexShaderSource,_=c.fragmentShaderSource,y=Q.createShadowCastVertexShader(v,f,d),b=Q.createShadowCastFragmentShader(_,f,m,h);a=i.shaderCache.createDerivedShaderProgram(c,g,{vertexShaderSource:y,fragmentShaderSource:b,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);r.renderState.cull.enabled||(l=s(l,!1),l.cull=s(l.cull,!1),l.cull.enabled=!1,l=B.fromCache(l)),u=be(e,r.uniformMap,d)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Z.MAXIMUM_DISTANCE=2e4,Z.prototype.debugCreateRenderStates=function(){$(this)},f(Z.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ue(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var we=new e,Se=new Array(8);Se[0]=new o(-1,-1,-1,1),Se[1]=new o(1,-1,-1,1),Se[2]=new o(1,1,-1,1),Se[3]=new o(-1,1,-1,1),Se[4]=new o(-1,-1,1,1),Se[5]=new o(1,-1,1,1),Se[6]=new o(1,1,1,1),Se[7]=new o(-1,1,1,1);for(var Te=new C,Ee=new Array(8),xe=0;xe<8;++xe)Ee[xe]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Ae=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 De=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(De,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Oe=new S,Me=new Array(4),Re=new n,Le=new n,Ne=new C,ke=new n,Fe=new n,Be=new n,Ue=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ve=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],ze=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],Ge=new n,He=new n,We=new t,je=We.center;Z.prototype.update=function(e){if(ye(this,e),this._needsUpdate)if(se(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&me(this,e)),this._isPointLight)this._shadowMapCullingVolume=d.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,r=t.positionWC,i=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(r,i,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&pe(this,e)},Z.prototype.updatePass=function(e,t){le(this,e,t)};var qe=new i;return Z.createDerivedCommands=function(e,t,r,i,n,o){p(o)||(o={});var a=t.length>0,s=r.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=r.pass===R.GLOBE,d=!1;if(c&&(d=r.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),r.castShadows){var h=o.castCommands;p(h)||(h=o.castCommands=[]);var f=o.castShaderProgramId,m=e.length;h.length=m;for(var g=0;g<m;++g)h[g]=Ce(e[g],i,r,n,f,h[g]);o.castShaderProgramId=r.shaderProgram.id}if(r.receiveShadows&&a){var v,_;p(o.receiveCommand)&&(v=o.receiveCommand.shaderProgram,_=o.receiveCommand.uniformMap),o.receiveCommand=O.shallowClone(r,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==r.castShadows,b=o.receiveShaderProgramId!==r.shaderProgram.id;if(!p(v)||b||i||y){var C=Q.getShadowReceiveShaderKeyword(t[0],r.castShadows,c,d);if(v=n.shaderCache.getDerivedShaderProgram(s,C),!p(v)){var w=Q.createShadowReceiveVertexShader(l,c,d),S=Q.createShadowReceiveFragmentShader(u,t[0],r.castShadows,c,d);v=n.shaderCache.createDerivedShaderProgram(s,C,{vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}_=be(t[0],r.uniformMap,c)}o.receiveCommand.shaderProgram=v,o.receiveCommand.uniformMap=_,o.receiveShaderProgramId=r.shaderProgram.id,o.receiveShaderCastShadows=r.castShadows}return o},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){ee(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return m(this)},Z}),define("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),define("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),define("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),define("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}S.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(n(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(n(t,i.BLACK),r.color),r.execute(e)},S.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var T=new e,E=new e,x=new r,P=new t,A=new t,D=new l;return S.prototype.update=function(e){var r=e.context,n=e.viewport,a=r.drawingBufferWidth,p=r.drawingBufferHeight,S=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new d({color:new i}),this._clearFBO2Command=new d({color:new i});var I={};this._downSampleCommand=r.createViewportQuadCommand(w,{uniformMap:I,owner:this}),I={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=r.createViewportQuadCommand(b,{uniformMap:I,owner:this});I={delta:function(){return 1},sigma:function(){return 2},direction:function(){return 0}},this._blurXCommand=r.createViewportQuadCommand(C,{uniformMap:I,owner:this}),I={delta:function(){return 1},sigma:function(){return 2},direction:function(){return 1}},this._blurYCommand=r.createViewportQuadCommand(C,{uniformMap:I,owner:this}),I={u_center:function(){return S._uCenter},u_radius:function(){return S._uRadius}},this._blendCommand=r.createViewportQuadCommand(y,{uniformMap:I,owner:this}),I={},this._fullScreenCommand=r.createViewportQuadCommand(w,{uniformMap:I,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),M=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),R=Math.max(1,O,M),L=E;L.width=R,L.height=R;var N=this._fbo,k=o(N)&&N.getColorTexture(0)||void 0;if(!o(k)||k.width!==a||k.height!==p){N=N&&N.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/R;var F=[new _({context:r,width:a,height:p})];N=r.depthTexture?this._fbo=new h({context:r,colorTextures:F,depthTexture:new _({context:r,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:f.UNSIGNED_SHORT})}):this._fbo=new h({context:r,colorTextures:F,depthRenderbuffer:new m({context:r,format:g.DEPTH_COMPONENT16})}),this._downSampleFBO1=new h({context:r,colorTextures:[new _({context:r,width:R,height:R})]}),this._downSampleFBO2=new h({context:r,colorTextures:[new _({context:r,width:R,height:R})]}),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 B=v.fromCache({viewport:L});this._downSampleCommand.uniformMap.u_texture=function(){return N.getColorTexture(0)},this._downSampleCommand.renderState=B,this._brightPassCommand.uniformMap.u_texture=function(){return S._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=B,this._blurXCommand.uniformMap.u_texture=function(){return S._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return S._blurStep},this._blurXCommand.renderState=B,this._blurYCommand.uniformMap.u_texture=function(){return S._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return S._blurStep},this._blurYCommand.renderState=B;var U=T;U.width=a,U.height=p;var V=v.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return N.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return S._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=V,this._fullScreenCommand.uniformMap.u_texture=function(){return N.getColorTexture(0)},this._fullScreenCommand.renderState=V}var z=r.uniformState,G=z.sunPositionWC,H=z.view,W=z.viewProjection,j=z.projection,q=l.computeViewportTransformation(n,0,1,D),Y=l.multiplyByPoint(H,G,x),X=c.pointToGLWindowCoordinates(W,q,G,P);Y.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(j,q,Y,Y),Z=30*t.magnitude(t.subtract(Q,X,Q))*2,K=A;K.x=Z,K.y=Z;var J=this._upSamplePassState.scissorTest.rectangle;return J.x=Math.max(X.x-.5*K.x,0),J.y=Math.max(X.y-.5*K.y,0),J.width=Math.min(K.x,a),J.height=Math.min(K.y,p),this._uCenter=t.clone(X,this._uCenter),this._uRadius=.15*Math.max(K.x,K.y),q=l.computeViewportTransformation(L,0,1,D),X=c.pointToGLWindowCoordinates(W,q,G,P),K.x*=O/a,K.y*=M/p,J=this._downSamplePassState.scissorTest.rectangle,J.x=Math.max(X.x-.5*K.x,0),J.y=Math.max(X.y-.5*K.y,0),J.width=Math.min(K.x,a),J.height=Math.min(K.y,p),this._downSamplePassState.context=r,this._upSamplePassState.context=r,this._fbo},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},S}),define("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/CullingVolume","../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/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/PixelFormat","../Core/RequestScheduler","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/loadCubeMap","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","./BrdfLutGenerator","./Camera","./CreditDisplay","./DebugCameraPrimitive","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./InvertClassification","./JobScheduler","./MapMode2D","./OIT","./PerformanceDisplay","./PerInstanceColorAppearance","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Te,Ee){"use strict";function xe(t){t=h(t,h.EMPTY_OBJECT);var r=t.canvas,i=t.contextOptions,n=t.creditContainer,o=new V(r,i);p(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",r.parentNode.appendChild(n)),this._id=c(),this._jobScheduler=new de,this._frameState=new ae(o,new te(n),this._jobScheduler),this._frameState.scene3DOnly=h(t.scene3DOnly,!1);var a=new q(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=r,this._context=o,this._computeEngine=new U(o),this._globe=void 0,this._primitives=new _e,this._groundPrimitives=new _e,this._tweens=new Ee,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=h(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var s;o.depthTexture&&(s=new ue);var u;this._useOIT&&p(s)&&(u=new pe(o)),this._globeDepth=s,this._depthPlane=new ie,this._oit=u,this._fxaa=new le,this._clearColorCommand=new B({color:new l,stencil:0,owner:this}),this._depthClearCommand=new B({depth:1,owner:this}),this._stencilClearCommand=new B({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._pickDepthPassState=void 0,this._pickDepthFramebuffer=void 0,this._pickDepthFramebufferWidth=void 0,this._pickDepthFramebufferHeight=void 0,this._depthOnlyRenderStateCache={},this._transitioner=new Ce(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this._pickPositionCache={},this._pickPositionCacheDirty=!1,this._minimumDisableDepthTestDistance=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=l.clone(l.BLACK),this._mode=ye.SCENE3D,this._mapProjection=p(t.mapProjection)?t.mapProjection:new y,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.fxaa=!0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new oe,this._sunCamera=new ee(this),this.shadowMap=new Se({context:o,lightCamera:this._sunCamera,enabled:h(t.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=l.clone(l.WHITE),this._actualInvertClassificationColor=l.clone(this._invertClassificationColor),this._invertClassification=new ce,this.focalLength=void 0,this.eyeSeparation=void 0,this._brdfLutGenerator=new $,this._terrainExaggeration=h(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var d=new ee(this);this._camera=d,this._cameraClone=ee.clone(d),this._screenSpaceCameraController=new we(this),this._mapMode2D=h(t.mapMode2D,he.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,useInvertClassification:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var f=d.frustum.near,m=d.frustum.far,g=Math.ceil(Math.log(m/f)/Math.log(this.farToNearRatio));Re(f,m,this.farToNearRatio,g,this._frustumCommandsList,!1,void 0),Me(this,0,E.now()),this.initializeFrame()}function Pe(e,t){var r=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(r,i),n)}function Ae(e,t,r){var i=1/Math.max(1,Pe(e.position,t.position));return o.multiplyByScalar(e.position,i,gt),o.multiplyByScalar(t.position,i,vt),o.equalsEpsilon(gt,vt,r)&&o.equalsEpsilon(e.direction,t.direction,r)&&o.equalsEpsilon(e.up,t.up,r)&&o.equalsEpsilon(e.right,t.right,r)&&P.equalsEpsilon(e.transform,t.transform,r)}function De(e,t){var r=e.frameState,i=e._context,n=r.shadowHints.shadowsEnabled,o=r.shadowHints.shadowMaps,a=r.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=r.shadowHints.lastDirtyTime;t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0);var c=t.derivedCommands;if(t.dirty&&p(c)){t.dirty=!1,n&&(t.receiveShadows||t.castShadows)&&(c.shadows=Se.createDerivedCommands(o,a,t,l,i,c.shadows));var d=e._oit;t.pass===j.TRANSLUCENT&&p(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=p(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,i,c.oit.shadows)):c.oit=d.createDerivedCommands(t,i,c.oit)),c.depth=ht(e,t,i,c.depth)}}function Ie(e){var t=e.globe;if(e._mode===ye.SCENE3D&&p(t)){var r=t.ellipsoid;return _t.radius=r.minimumRadius,mt=D.fromBoundingSphere(_t,e._camera.positionWC,mt)}}function Oe(e){e.render=!1,e.pick=!1,e.depth=!1}function Me(e,t,r){var i=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.brdfLutGenerator=e._brdfLutGenerator,n.environmentMap=e.skyBox&&e.skyBox._cubeMap,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=Ie(e),n.terrainExaggeration=e._terrainExaggeration,n.minimumDisableDepthTestDistance=e._minimumDisableDepthTestDistance,n.invertClassification=e.invertClassification,e._actualInvertClassificationColor=l.clone(e.invertClassificationColor,e._actualInvertClassificationColor),ce.isTranslucencySupported(e._context)||(e._actualInvertClassificationColor.alpha=1),n.invertClassificationColor=e._actualInvertClassificationColor,p(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,Oe(n.passes)}function Re(e,t,r,i,n,o,a){n.length=i;for(var s=0;s<i;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(r,s)*e),u=Math.min(t,r*l));var c=n[s];p(c)?(c.near=l,c.far=u):c=n[s]=new se(l,u)}}function Le(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||De(e,t);for(var i=e._frustumCommandsList,n=i.length,o=0;o<n;++o){var a=i[o],s=a.near,l=a.far;if(!(r.start>l)){if(r.stop<s)break;var u=t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=p(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function Ne(e,t,r){return p(e)&&(!p(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==S.OUTSIDE&&(!p(r)||!e.boundingVolume.isOccluded(r)))}function ke(e){var t=e._frameState,r=t.camera,i=r.directionWC,n=r.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=j.NUMBER_OF_PASSES,d=0;d<u;++d)for(var h=0;h<c;++h)l[d].indices[h]=0;o.length=0,a.length=0;for(var f=Number.MAX_VALUE,m=-Number.MAX_VALUE,g=!1,v=t.shadowHints.shadowsEnabled,_=Number.MAX_VALUE,y=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=t.mode===ye.SCENE3D?t.occluder:void 0,w=t.cullingVolume,S=yt.planes,T=0;T<5;++T)S[T]=w.planes[T];w=yt;for(var E=s.length,P=0;P<E;++P){var A=s[P],D=A.pass;if(D===j.COMPUTE)o.push(A);else if(D===j.OVERLAY)a.push(A);else{var I=A.boundingVolume;if(p(I)){if(!Ne(A,w,C))continue;if(bt=I.computePlaneDistances(n,i,bt),f=Math.min(f,bt.start),m=Math.max(m,bt.stop),v&&A.receiveShadows&&bt.start<Se.MAXIMUM_DISTANCE&&!(D===j.GLOBE&&bt.start<-100&&bt.stop>100)){var O=bt.stop-bt.start;D!==j.GLOBE&&bt.start<100&&(b=Math.min(b,O)),_=Math.min(_,bt.start),y=Math.max(y,bt.stop)}}else bt.start=r.frustum.near,bt.stop=r.frustum.far,g=!(A instanceof B);Le(e,A,bt)}}g?(f=r.frustum.near,m=r.frustum.far):(f=Math.min(Math.max(f,r.frustum.near),r.frustum.far),m=Math.max(Math.min(m,r.frustum.far),f),v&&(_=Math.min(Math.max(_,r.frustum.near),r.frustum.far),y=Math.max(Math.min(y,r.frustum.far),_))),v&&(t.shadowHints.nearPlane=_,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=b);var M,R=e.mode===ye.SCENE2D,L=e.farToNearRatio;R?(m=Math.min(m,r.position.z+e.nearToFarDistance2D),f=Math.min(f,m),M=Math.ceil(Math.max(1,m-f)/e.nearToFarDistance2D)):M=Math.ceil(Math.log(m/f)/Math.log(L)),f!==Number.MAX_VALUE&&(M!==u||0!==l.length&&(f<l[0].near||m>l[u-1].far&&!x.equalsEpsilon(m,l[u-1].far,x.EPSILON8)))&&(Re(f,m,L,M,l,R,e.nearToFarDistance2D),ke(e));var N=t.frustumSplits;N.length=M+1;for(var k=0;k<M;++k)N[k]=l[k].near,k===M-1&&(N[k+1]=l[k].far)}function Fe(e){var t={},r=e.vertexAttributes;for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function Be(e,t,r){var i=t.context,n=h(r,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=K.replaceMain(e,"czm_Debug_main");for(var t,r=/gl_FragData\[(\d+)\]/g;null!==(t=r.exec(e));)-1===a.indexOf(t[1])&&a.push(t[1]);return e});var s,u=a.length,c="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){p(e._debugColor)||(e._debugColor=l.fromRandom());var d=e._debugColor;if(u>0)for(s=0;s<u;++s)c+=" gl_FragData["+a[s]+"].rgb *= vec3("+d.red+", "+d.green+", "+d.blue+"); \n";else c+=" gl_FragColor.rgb *= vec3("+d.red+", "+d.green+", "+d.blue+"); \n"}if(t.debugShowFrustums){var f=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",g=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(s=0;s<u;++s)c+=" gl_FragData["+a[s]+"].rgb *= vec3("+f+", "+m+", "+g+"); \n";else c+=" gl_FragColor.rgb *= vec3("+f+", "+m+", "+g+"); \n"}c+="}",o.sources.push(c);var v=Fe(n);return Z.fromCache({context:i,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:v})}function Ue(e,t,r){var i=G.shallowClone(e);i.shaderProgram=Be(e,t),i.execute(t.context,r),i.shaderProgram.destroy()}function Ve(e,t,i,n,a){if(!p(t.debugCommandFilter)||t.debugCommandFilter(e)){if(e instanceof B)return void e.execute(i,n);var s=t.frameState.shadowHints.shadowsEnabled,l=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Ue(e,t,n):l&&e.receiveShadows&&p(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,n):t.frameState.passes.depth&&p(e.derivedCommands.depth)?e.derivedCommands.depth.depthOnlyCommand.execute(i,n):e.execute(i,n), e.debugShowBoundingVolume&&p(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;p(t._debugVolume)&&t._debugVolume.destroy();var h,f=o.clone(d.center);if(c.mode!==ye.SCENE3D){f=P.multiplyByPoint(Ct,f,f);var m=c.mapProjection,g=m.unproject(f);f=m.ellipsoid.cartographicToCartesian(g)}if(p(d.radius)){var _=d.radius;h=C.toWireframe(v.createGeometry(new v({radii:new o(_,_,_),vertexFormat:me.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ve({geometryInstances:new b({geometry:h,modelMatrix:P.fromTranslation(f),attributes:{color:new u(1,0,0,1)}}),appearance:new me({flat:!0,translucent:!1}),asynchronous:!1})}else{var y=d.halfAxes;h=C.toWireframe(r.createGeometry(r.fromDimensions({dimensions:new o(2,2,2),vertexFormat:me.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ve({geometryInstances:new b({geometry:h,modelMatrix:P.fromRotationTranslation(y,f,new P),attributes:{color:new u(1,0,0,1)}}),appearance:new me({flat:!0,translucent:!1}),asynchronous:!1})}var w=c.commandList,S=c.commandList=[];t._debugVolume.update(c);var T;p(a)&&(T=n.framebuffer,n.framebuffer=a),S[0].execute(i,n),p(T)&&(n.framebuffer=T),c.commandList=w}}}function ze(e,t,r){return t.boundingVolume.distanceSquaredTo(r)-e.boundingVolume.distanceSquaredTo(r)}function Ge(e,t,r,i,n){var o=e.context;A(i,ze,e._camera.positionWC),p(n)&&t(n.unclassifiedCommand,e,o,r);for(var a=i.length,s=0;s<a;++s)t(i[s],e,o,r)}function He(e,t){var r=e._debugGlobeDepths[t];return!p(r)&&e.context.depthTexture&&(r=new ue,e._debugGlobeDepths[t]=r),r}function We(e,t){var r=e._pickDepths[t];return p(r)||(r=new ge,e._pickDepths[t]=r),r}function je(e,t){var r=e._camera,i=e.context,n=i.uniformState;n.updateCamera(r);var o;o=p(r.frustum.fov)?r.frustum.clone(wt):p(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(St):p(r.frustum.width)?r.frustum.clone(Tt):r.frustum.clone(Et),o.near=r.frustum.near,o.far=r.frustum.far,n.updateFrustum(o),n.updatePass(j.ENVIRONMENT);var a=e._useWebVR&&e.mode!==ye.SCENE2D,s=e._frameState.passes,l=s.pick,u=s.depth,c=e._environmentState;if(!l){var d=c.skyBoxCommand;if(p(d)&&Ve(d,e,i,t),c.isSkyAtmosphereVisible&&Ve(c.skyAtmosphereCommand,e,i,t),c.isSunVisible&&(c.sunDrawCommand.execute(i,t),e.sunBloom&&!a)){var h;h=c.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:c.useFXAA?e._fxaa.getColorFramebuffer():c.originalFramebuffer,e._sunPostProcess.execute(i,h),t.framebuffer=h}c.isMoonVisible&&c.moonCommand.execute(i,t)}var f;c.useOIT?(p(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i,n){e._oit.executeCommands(e,t,r,i,n)}),f=e._executeOITFunction):f=Ge;for(var m,g=c.clearGlobeDepth,v=c.useDepthPlane,_=e._depthClearCommand,y=e._depthPlane,b=r.position.z,C=e._frustumCommandsList,w=C.length,S=0;S<w;++S){var T=w-S-1,E=C[T];e.mode===ye.SCENE2D?(r.position.z=b-E.near+1,o.far=Math.max(1,E.far-E.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==T?E.near*ft:E.near,o.far=E.far,n.updateFrustum(o));var x,P=e.debugShowGlobeDepth?He(e,T):e._globeDepth;e.debugShowGlobeDepth&&p(P)&&c.useGlobeDepthFramebuffer&&(x=t.framebuffer,t.framebuffer=P.framebuffer),_.execute(i,t),e._stencilClearCommand.execute(i,t),n.updatePass(j.GLOBE);var A=E.commands[j.GLOBE],D=E.indices[j.GLOBE];for(m=0;m<D;++m)Ve(A[m],e,i,t);for(p(P)&&c.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(P.update(i,t),P.executeCopyDepth(i,t)),e.debugShowGlobeDepth&&p(P)&&c.useGlobeDepthFramebuffer&&(t.framebuffer=x),n.updatePass(j.TERRAIN_CLASSIFICATION),A=E.commands[j.TERRAIN_CLASSIFICATION],D=E.indices[j.TERRAIN_CLASSIFICATION],m=0;m<D;++m)Ve(A[m],e,i,t);if(g&&_.execute(i,t),!c.useInvertClassification||l){for(n.updatePass(j.CESIUM_3D_TILE),A=E.commands[j.CESIUM_3D_TILE],D=E.indices[j.CESIUM_3D_TILE],m=0;m<D;++m)Ve(A[m],e,i,t);for(n.updatePass(j.CESIUM_3D_TILE_CLASSIFICATION),A=E.commands[j.CESIUM_3D_TILE_CLASSIFICATION],D=E.indices[j.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<D;++m)Ve(A[m],e,i,t)}else{e._invertClassification.clear(i,t);var I=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,n.updatePass(j.CESIUM_3D_TILE),A=E.commands[j.CESIUM_3D_TILE],D=E.indices[j.CESIUM_3D_TILE],m=0;m<D;++m)Ve(A[m],e,i,t);for(n.updatePass(j.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),A=E.commands[j.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],D=E.indices[j.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],m=0;m<D;++m)Ve(A[m],e,i,t);for(t.framebuffer=I,e._invertClassification.executeClassified(i,t),1===e.frameState.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(i,t),D>0&&i.stencilBuffer&&e._stencilClearCommand.execute(i,t),n.updatePass(j.CESIUM_3D_TILE_CLASSIFICATION),A=E.commands[j.CESIUM_3D_TILE_CLASSIFICATION],D=E.indices[j.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<D;++m)Ve(A[m],e,i,t)}D>0&&i.stencilBuffer&&e._stencilClearCommand.execute(i,t),g&&v&&y.execute(i,t);for(var O=j.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW+1,M=j.TRANSLUCENT,R=O;R<M;++R)for(n.updatePass(R),A=E.commands[R],D=E.indices[R],m=0;m<D;++m)Ve(A[m],e,i,t);0!==T&&e.mode!==ye.SCENE2D&&(o.near=E.near,n.updateFrustum(o));var L;if(!l&&c.useInvertClassification&&e.frameState.invertClassificationColor.alpha<1&&(L=e._invertClassification),n.updatePass(j.TRANSLUCENT),A=E.commands[j.TRANSLUCENT],A.length=E.indices[j.TRANSLUCENT],f(e,Ve,t,A,L),p(P)&&(c.useGlobeDepthFramebuffer||u)&&e.useDepthPicking){var N=u?t.framebuffer.depthStencilTexture:P.framebuffer.depthStencilTexture,k=We(e,T);k.update(i,N),k.executeCopyDepth(i,t)}}}function qe(e){e.context.uniformState.updatePass(j.COMPUTE);var t=e._environmentState.sunComputeCommand;p(t)&&t.execute(e._computeEngine);for(var r=e._computeCommandList,i=r.length,n=0;n<i;++n)r[n].execute(e._computeEngine)}function Ye(e,t){e.context.uniformState.updatePass(j.OVERLAY);for(var r=e.context,i=e._overlayCommandList,n=i.length,o=0;o<n;++o)i[o].execute(r,t)}function Xe(e,t,r){for(var i=r.shadowMapCullingVolume,n=r.isPointLight,o=r.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(De(e,u),u.castShadows&&(u.pass===j.GLOBE||u.pass===j.CESIUM_3D_TILE||u.pass===j.OPAQUE||u.pass===j.TRANSLUCENT)&&Ne(u,i))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var d=!1,h=a-1;h>=0;--h){var p=o[h].cullingVolume;if(Ne(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function Qe(e){var t=e.frameState,r=t.shadowHints.shadowMaps,i=r.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<i;++a){var s=r[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var d=e.frameState.commandList;for(Xe(e,d,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];o.updatePass(m.pass),Ve(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function Ze(e,t,r){var i=e._context,n=t.viewport;n.x=0,n.y=0,n.width=i.drawingBufferWidth,n.height=i.drawingBufferHeight;var a=e._frameState,s=a.camera,l=a.mode,u=a.passes.depth;if(e._useWebVR&&l!==ye.SCENE2D){it(e,t,r),u||rt(e),ke(e),u||(qe(e),Qe(e)),n.x=0,n.y=0,n.width=.5*i.drawingBufferWidth,n.height=i.drawingBufferHeight;var c=ee.clone(s,e._cameraVR),d=s.frustum.near,p=d*h(e.focalLength,5),f=h(e.eyeSeparation,p/30),m=o.multiplyByScalar(c.right,.5*f,xt);s.frustum.aspectRatio=n.width/n.height;var g=.5*f*d/p;o.add(c.position,m,s.position),s.frustum.xOffset=g,je(e,t),n.x=t.viewport.width,o.subtract(c.position,m,s.position),s.frustum.xOffset=-g,je(e,t),ee.clone(c,s)}else l!==ye.SCENE2D||e._mapMode2D===he.ROTATE?Je(!0,e,t,r):(it(e,t,r),Ke(e,t))}function Ke(t,r){var i=t.context,n=t.frameState,a=t.camera,s=r.viewport,l=e.clone(s,Lt);r.viewport=l;var u=Pt,c=At;t.mapProjection.project(u,c);var d=o.clone(a.position,Dt),h=P.clone(a.transform,Ot),p=a.frustum.clone();a._setTransform(P.IDENTITY);var f=P.computeViewportTransformation(l,0,1,It),m=a.frustum.projectionMatrix,g=a.positionWC.y,v=o.fromElements(x.sign(g)*c.x-g,0,-a.positionWC.x,Mt),_=F.pointToGLWindowCoordinates(m,f,v,Rt);_.x=Math.floor(_.x);var y=l.x,b=l.width;if(0===g||_.x<=y||_.x>=y+b)Je(!0,t,r);else if(Math.abs(y+.5*b-_.x)<1)l.width=_.x-l.x,a.position.x*=x.sign(a.position.x),a.frustum.right=0,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!0,t,r),l.x=_.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!1,t,r);else if(_.x>y+.5*b){l.width=_.x-y;var C=a.frustum.right;a.frustum.right=c.x-g,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!0,t,r),l.x=_.x,l.width=y+b-_.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=C-2*a.frustum.right,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!1,t,r)}else{l.x=_.x,l.width=y+b-_.x;var w=a.frustum.left;a.frustum.left=-c.x-g,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!0,t,r),l.x=y,l.width=_.x-y,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=w-2*a.frustum.left,n.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(n),Je(!1,t,r)}a._setTransform(h),o.clone(d,a.position),a.frustum=p.clone(),r.viewport=s}function Je(e,t,r,i){var n=t.frameState.passes.depth;e||n||(t.frameState.commandList.length=0),n||rt(t),ke(t),e&&(p(i)&&it(t,r,i),n||(qe(t),Qe(t))),je(t,r)}function $e(e,t){var r=e._frameState,i=e._environmentState,n=r.passes.render,o=e.skyAtmosphere,a=e.globe;if(!n||e._mode!==ye.SCENE2D&&r.camera.frustum instanceof I)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{p(o)&&p(a)&&(o.setDynamicAtmosphereColor(a.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||a._surface._tilesToRender.length>0),i.skyAtmosphereCommand=p(o)?o.update(r):void 0,i.skyBoxCommand=p(e.skyBox)?e.skyBox.update(r):void 0;var s=p(e.sun)?e.sun.update(r,t):void 0;i.sunDrawCommand=p(s)?s.drawCommand:void 0,i.sunComputeCommand=p(s)?s.computeCommand:void 0,i.moonCommand=p(e.moon)?e.moon.update(r):void 0}var l=i.clearGlobeDepth=p(a)&&(!a.depthTestAgainstTerrain||e.mode===ye.SCENE2D);(i.useDepthPlane=l&&e.mode===ye.SCENE3D)&&e._depthPlane.update(r);for(var u=r.mode===ye.SCENE3D?r.occluder:void 0,c=r.cullingVolume,d=yt.planes,h=0;h<5;++h)d[h]=c.planes[h];c=yt,i.isSkyAtmosphereVisible=p(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=Ne(i.sunDrawCommand,c,u),i.isMoonVisible=Ne(i.moonCommand,c,u)}function et(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new re({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),p(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function tt(e){var t=e._frameState,r=t.shadowMaps,i=r.length,n=i>0&&!t.passes.pick&&e.mode===ye.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<i;++o)if(r[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<i;++a){var s=r[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function rt(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),et(e),tt(e),e._globe&&e._globe.update(t)}function it(e,t,r){var i=e._context,n=e._environmentState,o=e._frameState.passes,a=o.pick,s=e._useWebVR&&e.mode!==ye.SCENE2D;n.originalFramebuffer=t.framebuffer,p(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!s?e._sunPostProcess=new Te:p(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!p(e.sun)&&p(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var u=e._clearColorCommand;l.clone(r,u.color),u.execute(i,t);var c=n.useGlobeDepthFramebuffer=!a&&p(e._globeDepth);c&&(e._globeDepth.update(i,t),e._globeDepth.clear(i,t,r));var d=n.useOIT=!a&&p(e._oit)&&e._oit.isSupported();d&&(e._oit.update(i,t,e._globeDepth.framebuffer),e._oit.clear(i,t,r),n.useOIT=e._oit.isSupported());var h=n.useFXAA=!a&&e.fxaa;if(h&&(e._fxaa.update(i,t),e._fxaa.clear(i,t,r)),n.isSunVisible&&e.sunBloom&&!s?t.framebuffer=e._sunPostProcess.update(t):c?t.framebuffer=e._globeDepth.framebuffer:h&&(t.framebuffer=e._fxaa.getColorFramebuffer()),p(t.framebuffer)&&u.execute(i,t),n.useInvertClassification=p(t.framebuffer)&&e.invertClassification){var f;if(1===e.frameState.invertClassificationColor.alpha&&(n.useGlobeDepthFramebuffer?f=e._globeDepth.framebuffer:n.useFXAA&&(f=e._fxaa.getColorFramebuffer())),e._invertClassification.previousFramebuffer=f,e._invertClassification.update(i),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&d){var m=e._invertClassification.unclassifiedCommand,g=m.derivedCommands;g.oit=e._oit.createDerivedCommands(m,i,g.oit)}}}function nt(e,t){var r=e._context,i=e._environmentState,n=i.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){He(e,e.debugShowDepthFrustum-1).executeDebugGlobeDepth(r,t)}if(e.debugShowPickDepth&&n){We(e,e.debugShowDepthFrustum-1).executeDebugPickDepth(r,t)}var o=i.useOIT,a=i.useFXAA;o&&(t.framebuffer=a?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(r,t)),a&&(!o&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(r,t)),t.framebuffer=i.originalFramebuffer,e._fxaa.execute(r,t)),o||a||!n||(t.framebuffer=i.originalFramebuffer,e._globeDepth.executeCopyColor(r,t))}function ot(e){for(var t=e.afterRender,r=0,i=t.length;r<i;++r)t[r]();t.length=0}function at(e,t){e._pickPositionCacheDirty=!0,p(t)||(t=E.now());var r=e._camera;Ae(r,e._cameraClone,x.EPSILON6)?e._cameraStartFired&&w()-e._cameraMovedTime>e.cameraEventWaitTime&&(r.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(r.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=w(),ee.clone(r,e._cameraClone)),e._preRender.raiseEvent(e,t),e._jobScheduler.resetBudgets();var i=e.context,n=i.uniformState,a=e._frameState;Me(e,x.incrementWrap(a.frameNumber,15e6,1),t),a.passes.render=!0;var s=h(e.backgroundColor,l.BLACK);a.backgroundColor=s,a.creditDisplay.beginFrame(),e.fog.update(a),n.update(a);var u=e.shadowMap;p(u)&&u.enabled&&(o.negate(n.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var c=e._passState;if(c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,p(e.globe)&&e.globe.beginFrame(a),$e(e,c),Ze(e,c,s),nt(e,c),Ye(e,c),p(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!p(e._performanceDisplay)){var d=document.createElement("div");d.className="cesium-performanceDisplay-defaultContainer";e._canvas.parentNode.appendChild(d);var f=new fe({container:d});e._performanceDisplay=f,e._performanceContainer=d}e._performanceDisplay.update()}else p(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));i.endFrame(),N.update(),ot(a),e._postRender.raiseEvent(e,t)}function st(e,t,r,i){var n=e._camera,a=n.frustum;p(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=P.clone(n.transform,Ut);n._setTransform(P.IDENTITY);var d=o.clone(n.position,kt);o.multiplyByScalar(n.right,l,Ft),o.add(Ft,d,d),o.multiplyByScalar(n.up,u,Ft),o.add(Ft,d,d),n._setTransform(c),e.mode===ye.SCENE2D&&o.fromElements(d.z,d.x,d.y,d);var h=a.getPixelDimensions(s.width,s.height,1,Bt),f=Nt;return f.right=.5*h.x,f.left=-f.right,f.top=.5*h.y,f.bottom=-f.top,f.near=a.near,f.far=a.far,f.computeCullingVolume(d,n.directionWC,n.upWC)}function lt(e,t,r,i){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,d=2*(u.height-t.y-u.y)/u.height-1,h=c*a*l,p=d*a*s,f=o.getPixelDimensions(u.width,u.height,1,Bt),m=f.x*r*.5,g=f.y*i*.5,v=Vt;return v.top=p+g,v.bottom=p-g,v.right=h+m,v.left=h-m,v.near=a,v.far=o.far,v.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function ut(e,t,r,i){var n=e.camera.frustum;return n instanceof I||n instanceof O?st(e,t,r,i):lt(e,t,r,i)}function ct(e,t){var r=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!p(r)){for(var i=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length,l=0;l<s;++l)if(qt.test(a[l])||Yt.test(a[l])){o=!0;break}o||(n=new K({sources:["void main() { gl_FragColor = vec4(1.0); }"]})),r=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:i})}return r}function dt(e,t){var r=e._depthOnlyRenderStateCache,i=r[t.id];if(!p(i)){var n=X.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=X.fromCache(n),r[t.id]=i}return i}function ht(e,t,r,i){p(i)||(i={});var n,o;return p(i.depthOnlyCommand)&&(n=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=G.shallowClone(t,i.depthOnlyCommand),p(n)&&i.shaderProgramId===t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=n,i.depthOnlyCommand.renderState=o):(i.depthOnlyCommand.shaderProgram=ct(r,t.shaderProgram),i.depthOnlyCommand.renderState=dt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id),i}function pt(t,r){var i=t._context,n=t._frameState;Oe(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=ut(t,r,1,1);var o=t._pickDepthPassState;p(o)||(o=t._pickDepthPassState=new q(i),o.scissorTest={enabled:!0,rectangle:new e},o.viewport=new e);var a=i.drawingBufferWidth,s=i.drawingBufferHeight,l=t._pickDepthFramebuffer,u=t._pickDepthFramebufferWidth,c=t._pickDepthFramebufferHeight;p(l)&&u===a&&c===s||(t._pickDepthFramebuffer=t._pickDepthFramebuffer&&t._pickDepthFramebuffer.destroy(),l=t._pickDepthFramebuffer=new H({context:i,depthStencilTexture:new J({context:i,width:a,height:s,pixelFormat:L.DEPTH_STENCIL,pixelDatatype:Y.UNSIGNED_INT_24_8})}),t._pickDepthFramebufferWidth=a,t._pickDepthFramebufferHeight=s),o.framebuffer=l,o.viewport.width=a,o.viewport.height=s,o.scissorTest.rectangle.x=r.x,o.scissorTest.rectangle.y=s-r.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,$e(t,o),Ze(t,o,Wt),nt(t,o),i.endFrame()}var ft=.9999;f(xe.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 z.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return z.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(){if(p(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(p(this.globe))return this.globe.terrainProvider},set:function(e){p(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(p(this.globe))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 p(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ye.SCENE2D?this.morphTo2D(0):e===ye.SCENE3D?this.morphTo3D(0):e===ye.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 ee(this),p(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new ne(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}}}),xe.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1};var mt,gt=new o,vt=new o,_t=new t,yt=new d,bt=new T,Ct=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Ct=P.inverseTransformation(Ct,Ct);var wt=new M,St=new R,Tt=new I,Et=new O,xt=new o,Pt=new s(Math.PI,x.PI_OVER_TWO),At=new o,Dt=new o,It=new P,Ot=new P,Mt=new o,Rt=new o,Lt=new e;xe.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),p(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()},xe.prototype.render=function(e){try{at(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},xe.prototype.clampLineWidth=function(e){return Math.max(z.minimumAliasedLineWidth,Math.min(e,z.maximumAliasedLineWidth))};var Nt=new O,kt=new o,Ft=new o,Bt=new n,Ut=new P,Vt=new R,zt=3,Gt=3,Ht=new e(0,0,zt,Gt),Wt=new l(0,0,0,0),jt=new n;xe.prototype.pick=function(e,t,r){zt=h(t,3),Gt=h(r,zt);var i=this._context,n=i.uniformState,o=this._frameState,a=be.transformWindowToDrawingBuffer(this,e,jt);p(this._pickFramebuffer)||(this._pickFramebuffer=i.createPickFramebuffer()),this._jobScheduler.disableThisFrame(),Me(this,o.frameNumber,o.time),o.cullingVolume=ut(this,a,zt,Gt),o.invertClassification=!1,o.passes.pick=!0,n.update(o),Ht.x=a.x-.5*(zt-1),Ht.y=this.drawingBufferHeight-a.y-.5*(Gt-1),Ht.width=zt,Ht.height=Gt;var s=this._pickFramebuffer.begin(Ht);$e(this,s),Ze(this,s,Wt),nt(this,s);var l=this._pickFramebuffer.end(Ht);return i.endFrame(),ot(o),l};var qt=/\bgl_FragDepthEXT\b/,Yt=/\bdiscard\b/,Xt=new a,Qt=new a(1,1/255,1/65025,1/16581375);xe.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var r=e.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return o.clone(this._pickPositionCache[r],t);var i=this._context,n=i.uniformState,s=be.transformWindowToDrawingBuffer(this,e,jt);this.pickTranslucentDepth&&pt(this,s),s.y=this.drawingBufferHeight-s.y;var l,u=this._camera;l=p(u.frustum.fov)?u.frustum.clone(wt):p(u.frustum.infiniteProjectionMatrix)?u.frustum.clone(St):p(u.frustum.width)?u.frustum.clone(Tt):u.frustum.clone(Et);for(var c=this.numberOfFrustums,d=0;d<c;++d){var h=We(this,d),f=i.readPixels({x:s.x,y:s.y,width:1,height:1,framebuffer:h.framebuffer}),m=a.unpack(f,0,Xt);a.divideByScalar(m,255,m);var g=a.dot(m,Qt);if(g>0&&g<1){var v,_=this._frustumCommandsList[d];return this.mode===ye.SCENE2D?(v=u.position.z,u.position.z=v-_.near+1,l.far=Math.max(1,_.far-_.near),l.near=1,n.update(this.frameState),n.updateFrustum(l)):(l.near=_.near*(0!==d?ft:1),l.far=_.far,n.updateFrustum(l)),t=be.drawingBufferToWgs84Coordinates(this,s,g,t),this.mode===ye.SCENE2D&&(u.position.z=v,n.update(this.frameState)),this._pickPositionCache[r]=o.clone(t),t}}this._pickPositionCache[r]=void 0}};var Zt=new s;return xe.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),p(t)&&this.mode!==ye.SCENE3D){o.fromElements(t.y,t.z,t.x,t);var r=this.mapProjection,i=r.ellipsoid,n=r.unproject(t,Zt);i.cartographicToCartesian(n,t)}return t},xe.prototype.drillPick=function(e,t){var r,i,n=[],o=[],a=[];p(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);p(s)&&p(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&p(s.id)&&(i=l.getGeometryInstanceAttributes(s.id),p(i)&&p(i.show)&&(u=!0,i.show=k.toValue(!1,i.show),a.push(i))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(r=0;r<o.length;++r)o[r].show=!0;for(r=0;r<a.length;++r)i=a[r],i.show=k.toValue(!0,i.show);return n},xe.prototype.completeMorph=function(){this._transitioner.completeMorph()},xe.prototype.morphTo2D=function(e){var t,r=this.globe;t=p(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphTo2D(e,t)},xe.prototype.morphToColumbusView=function(e){var t,r=this.globe;t=p(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphToColumbusView(e,t)},xe.prototype.morphTo3D=function(e){var t,r=this.globe;t=p(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=h(e,2),this._transitioner.morphTo3D(e,t)},xe.prototype.isDestroyed=function(){return!1},xe.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._pickDepthFramebuffer=this._pickDepthFramebuffer&&this._pickDepthFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),p(this._globeDepth)&&this._globeDepth.destroy(),p(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),p(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),m(this)},xe.prototype.cartesianToCanvasCoordinates=function(e,t){return be.wgs84ToWindowCoordinates(this,e,t)},xe}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(i){function n(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,C._readyPromise.resolve(!0),c.handleSuccess(C._errorEvent)}function h(e){var t="Failed to load image "+_+".";b=c.handleError(b,C,C._errorEvent,t,0,0,0,p,e),C._readyPromise.reject(new u(t))}function p(){d(s(_),n,h)}i=t(i,{});var f=i.url;this._url=f;var m=i.proxy;this._proxy=m;var g=t(i.rectangle,l.MAX_VALUE),v=new a({rectangle:g,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid});this._tilingScheme=v,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _=f;r(m)&&(_=m.getURL(_));var y=i.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var b,C=this;p()}return i(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(e,t,r){},h.prototype.requestImage=function(e,t,r,i){return this._image},h.prototype.pickFeatures=function(e,t,r,i,n){},h}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\nfloat atmosphereAlpha = clamp((u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.x) / (u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.z), 0.0, 1.0);\nfloat nightAlpha = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\ngl_FragColor = vec4(rgb, mix(rgb.b, 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),define("Shaders/SkyAtmosphereVS",[],function(){"use strict" ;return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),define("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(i){i=r(i,a.WGS84),this.show=!0,this._ellipsoid=i,this._command=new h({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(i.radii,1.025,new e)),n.z=i.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function S(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(w.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),w.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},w.prototype.update=function(t){if(this.show){var r=t.mode;if((r===C.SCENE3D||r===C.MORPHING)&&t.passes.render){var n=this._command;if(!i(n.vertexArray)){var o=t.context,a=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));n.vertexArray=g.fromGeometry({context:o,geometry:a,attributeLocations:l.createAttributeLocations(a),bufferUsage:d.STATIC_DRAW}),n.renderState=p.fromCache({cull:{enabled:!0,face:b.FRONT},blending:y.ALPHA_BLEND});var u=new m({defines:["SKY_FROM_SPACE"],sources:[_]});this._spSkyFromSpace=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:v}),u=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[_]}),this._spSkyFromAtmosphere=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:v})}var h=S(this);if(h&&(!i(this._spSkyFromSpaceColorCorrect)||!i(this._spSkyFromAtmosphereColorCorrect))){var w=t.context,T=new m({defines:["SKY_FROM_SPACE"],sources:[_]}),E=new m({defines:["COLOR_CORRECT"],sources:[v]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:w,vertexShaderSource:T,fragmentShaderSource:E}),T=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[_]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:w,vertexShaderSource:T,fragmentShaderSource:E})}var x=t.camera.positionWC,P=e.magnitude(x);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=P,P>this._cameraAndRadiiAndDynamicAtmosphereColor.y?n.shaderProgram=h?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:n.shaderProgram=h?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,n}}},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},w}),define("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),define("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),define("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(e){this.sources=e.sources,this._sources=void 0,this.show=r(e.show,!0),this._command=new d({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return b.prototype.update=function(r){var n=this;if(this.show&&(r.mode===y.SCENE3D||r.mode===y.MORPHING)&&r.passes.render){var o=r.context;if(this._sources!==this.sources){this._sources=this.sources;var s=this.sources;"string"==typeof s.positiveX?h(o,this._sources).then(function(e){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:o,source:s}))}var d=this._command;if(!i(d.vertexArray)){d.uniformMap={u_cubeMap:function(){return n._cubeMap}};var b=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),C=a.createAttributeLocations(b);d.vertexArray=m.fromGeometry({context:o,geometry:b,attributeLocations:C,bufferUsage:u.STATIC_DRAW}),d.shaderProgram=f.fromCache({context:o,vertexShaderSource:v,fragmentShaderSource:g,attributeLocations:C}),d.renderState=p.fromCache({blending:_.ALPHA_BLEND})}if(i(this._cubeMap))return d}},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},b}),define("Scene/SphereEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(e){e=r(e,1),this._radius=r(e,1)}return i(o.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),o.prototype.emit=function(t){var r=n.randomBetween(0,n.TWO_PI),i=n.randomBetween(0,n.PI),o=n.randomBetween(0,this._radius),a=o*Math.cos(r)*Math.sin(i),s=o*Math.sin(r)*Math.sin(i),l=o*Math.cos(i);t.position=e.fromElements(a,s,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Scene/StyleExpression",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.evaluate=function(t,r,i){e.throwInstantiationError()},t.prototype.evaluateColor=function(t,r,i){e.throwInstantiationError()},t.prototype.getShaderFunction=function(t,r,i,n){e.throwInstantiationError()},t}),define("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),define("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),define("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x){"use strict";function P(){this.show=!0,this._drawCommand=new g({primitiveType:h.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(P.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var A=new t,D=new t,I=new i,O=new i;return P.prototype.update=function(i,a){if(this.show){var s=i.mode;if(s!==E.SCENE2D&&s!==E.MORPHING&&i.passes.render){var h=i.context,g=a.viewport.width,P=a.viewport.height;if(!o(this._texture)||g!==this._drawingBufferWidth||P!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=g,this._drawingBufferHeight=P,this._glowFactorDirty=!1;var M=Math.max(g,P);M=Math.pow(2,Math.ceil(Math.log(M)/Math.log(2))-2),M=Math.max(1,M),this._texture=new y({context:h,width:M,height:M,pixelFormat:d.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var R=this,L={u_glowLengthTS:function(){return R._glowLengthTS},u_radiusTS:function(){return R._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:w,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){R._commands.computeCommand=void 0}})}var N=this._drawCommand;if(!o(N.vertexArray)){var k={direction:0},F=new Uint8Array(8);F[0]=0,F[1]=0,F[2]=255,F[3]=0,F[4]=255,F[5]=255,F[6]=0,F[7]=255;var B=p.createVertexBuffer({context:h,typedArray:F,usage:f.STATIC_DRAW}),U=[{index:k.direction,vertexBuffer:B,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],V=p.createIndexBuffer({context:h,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});N.vertexArray=new b({context:h,attributes:U,indexBuffer:V}),N.shaderProgram=_.fromCache({context:h,vertexShaderSource:S,fragmentShaderSource:C,attributeLocations:k}),N.renderState=v.fromCache({blending:T.ALPHA_BLEND}),N.uniformMap=this._uniformMap}var z=h.uniformState.sunPositionWC,G=h.uniformState.sunPositionColumbusView,H=this._boundingVolume,W=this._boundingVolume2D;r.clone(z,H.center),W.center.x=G.z,W.center.y=G.x,W.center.z=G.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,W.radius=H.radius,s===E.SCENE3D?e.clone(H,N.boundingVolume):s===E.COLUMBUS_VIEW&&e.clone(W,N.boundingVolume);var j=x.computeActualWgs84Position(i,z,O),q=r.magnitude(r.subtract(j,i.camera.position,O)),Y=h.uniformState.projection,X=I;X.x=0,X.y=0,X.z=-q,X.w=1;var Q=c.multiplyByVector(Y,X,O),Z=x.clipToGLWindowCoordinates(a.viewport,Q,A);X.x=u.SOLAR_RADIUS;var K=c.multiplyByVector(Y,X,O),J=x.clipToGLWindowCoordinates(a.viewport,K,D);return this._size=Math.ceil(t.magnitude(t.subtract(J,Z,O))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},P}),define("Scene/TileBoundingVolume",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.boundingVolume=void 0,t.prototype.boundingSphere=void 0,t.prototype.distanceToCamera=function(t){e.throwInstantiationError()},t.prototype.intersectPlane=function(t){e.throwInstantiationError()},t.prototype.createDebugVolume=function(t){e.throwInstantiationError()},t}),define("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT),this._tilingScheme=r(i.tilingScheme)?i.tilingScheme:new o({ellipsoid:i.ellipsoid}),this._color=t(i.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(i.tileWidth,256),this._tileHeight=t(i.tileHeight,256),this._readyPromise=a.resolve(!0)}return i(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,r){},s.prototype.requestImage=function(e,t,r,i){var n=document.createElement("canvas");n.width=256,n.height=256;var o=n.getContext("2d"),a=this._color.toCssColorString();o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255);var s="L"+r+"X"+e+"Y"+t;return o.font="bold 25px Arial",o.textAlign="center",o.fillStyle="black",o.fillText(s,127,127),o.fillStyle=a,o.fillText(s,124,124),n},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),define("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";return e({START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3})}),define("Scene/TimeDynamicImagery",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/JulianDate","../Core/Request","../Core/RequestType"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var r=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,r.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(r)}function u(e,t,r){return e+"-"+t+"-"+r}function c(e){var t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function d(e){var t=e._times;if(r(t)){var i=e._clock,n=i.currentTime,a=i.canAnimate&&i.shouldAnimate,s=i.multiplier;if(a||0===s){var l,u=t.indexOf(n);if(-1!==u){var c=t.get(u);return s>0?(l=o.secondsDifference(c.stop,n),++u):(l=o.secondsDifference(c.start,n),--u),l/=s,u>=0&&l<=5?t.get(u):void 0}}}}function h(e,t,i){var n=e._times.indexOf(i.start),o=e._tileCache,l=o[n];r(l)||(l=o[n]={});var u=t.key;if(r(l[u]))return!0;var d=c(u),h=new a({throttle:!0,throttleByServer:!0,type:s.IMAGERY,priorityFunction:t.priorityFunction}),p=e._requestImageFunction(d.x,d.y,d.level,h,i);return!!r(p)&&(l[u]={promise:p,request:h},!0)}return i(l.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),l.prototype.getFromCache=function(e,t,i,n){var o,a=u(e,t,i),s=this._tileCache[this._currentIntervalIndex];if(r(s)&&r(s[a])){var l=s[a];o=l.promise.otherwise(function(e){throw n.state=l.request.state,e}),delete s[a]}return o},l.prototype.checkApproachingInterval=function(e,t,i,n){var o=u(e,t,i),a=this._tilesRequestedForInterval,s=d(this),l={key:o,priorityFunction:n.priorityFunction};r(s)&&h(this,l,s)||a.push(l),a.length>=512&&a.splice(0,256)},l.prototype._clockOnTick=function(e){var t=e.currentTime,i=this._times,n=i.indexOf(t),o=this._currentIntervalIndex;if(n!==o){var a=this._tileCache[o];for(var s in a)a.hasOwnProperty(s)&&a[s].request.cancel();return delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=n,void this._reloadFunction()}var l=d(this);if(r(l))for(var u=this._tilesRequestedForInterval,c=!0;c&&0!==u.length;){var p=u.pop();(c=h(this,p,l))||u.push(p)}},l}),define("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),define("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(i,n){this.show=!0,r(i)||(i=new e),this.rectangle=e.clone(i),r(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return d.prototype.update=function(t){if(this.show){var i=this._rs;r(i)&&e.equals(i.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));if(t.passes.render){var n=t.context;if(this._material!==this.material||!r(this._overlayCommand)){this._material=this.material,r(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var c=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=n.createViewportQuadCommand(c,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i(this)},d}),define("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(i){function n(e,t){r(m[e])||(m[e]=t),r(_)&&!r(_[e])&&(_[e]=t)}i=t(i,t.EMPTY_OBJECT),this._url=i.url,this._layers=i.layers;var o=t(i.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),d=new c(i.url),m=l(t(d.query,"")),g=e(f(t(i.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);m=e(g,m);var v,_;v=new c(i.url),_=l(t(v.query,""));var y=e(f(t(i.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);_=e(y,_),n("layers",i.layers),parseFloat(g.version)>=1.3?n("crs",i.tilingScheme instanceof u?"EPSG:3857":"CRS:84"):n("srs",i.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),d.query=s(m);var b,C=d.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");r(_)&&(r(_.query_layers)||(_.query_layers=i.layers),r(_.x)||(_.x="{i}"),r(_.y)||(_.y="{j}"),r(_.info_format)||(_.info_format="{format}"),v.query=s(_),b=v.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new h({url:C,pickFeaturesUrl:b,tilingScheme:t(i.tilingScheme,new a({ellipsoid:i.ellipsoid})),rectangle:i.rectangle,tileWidth:i.tileWidth,tileHeight:i.tileHeight,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,proxy:i.proxy,subdomains:i.subdomains,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,getFeatureInfoFormats:o,enablePickFeatures:i.enablePickFeatures})}function f(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r.toLowerCase()]=e[r]);return t}return i(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,r){return this._tileProvider.getTileCredits(e,t,r)},p.prototype.requestImage=function(e,t,r,i){return this._tileProvider.requestImage(e,t,r,i)},p.prototype.pickFeatures=function(e,t,r,i,n){return this._tileProvider.pickFeatures(e,t,r,i,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new d("json","application/json")),o(new d("xml","text/xml")),o(new d("text","text/html"))]),p}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/Request","../Core/RequestType","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider","./TimeDynamicImagery"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(e){e=r(e,r.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=r(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new f({ellipsoid:e.ellipsoid}),this._tileWidth=r(e.tileWidth,256),this._tileHeight=r(e.tileHeight,256),this._minimumLevel=r(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=r(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var n=this;this._reload=void 0,i(e.times)&&(this._timeDynamicImagery=new _({clock:e.clock,times:e.times,requestImageFunction:function(e,t,r,i,o){return b(n,e,t,r,i,o)},reloadFunction:function(){i(n._reload)&&n._reload()}})),this._readyPromise=g.resolve(!0);var o=this._tilingScheme.positionToTileXY(d.southwest(this._rectangle),this._minimumLevel),s=this._tilingScheme.positionToTileXY(d.northeast(this._rectangle),this._minimumLevel);Math.abs(s.x-o.x),Math.abs(s.y-o.y);this._errorEvent=new a;var u=e.credit;this._credit="string"==typeof u?new t(u):u,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():i(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function b(t,n,o,a,s,l){var d,h,p=t._tileMatrixLabels,f=i(p)?p[a]:a.toString(),g=t._subdomains,_=t._dimensions,y=i(l)?l.data:void 0;if(t._url.indexOf("{")>=0){if(d=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",f).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",g[(n+o+a)%g.length]),i(_))for(h in _)_.hasOwnProperty(h)&&(d=d.replace("{"+h+"}",_[h]));if(i(y))for(h in y)y.hasOwnProperty(h)&&(d=d.replace("{"+h+"}",y[h]))}else{var b=new m(t._url),w=c(r(b.query,""));if(w=e(C,w),w.tilematrix=f,w.layer=t._layer,w.style=t._style,w.tilerow=o,w.tilecol=n,w.tilematrixset=t._tileMatrixSetID,w.format=t._format,i(_))for(h in _)_.hasOwnProperty(h)&&(w[h]=_[h]);if(i(y))for(h in y)y.hasOwnProperty(h)&&(w[h]=y[h]);b.query=u(w),d=b.toString()}var S=t._proxy;return i(S)&&(d=S.getURL(d)),v.loadImage(t,d,s)}var C=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(y.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}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,i(this._reload)&&this._reload())}}}),y.prototype.getTileCredits=function(e,t,r){},y.prototype.requestImage=function(e,t,r,n){var o,a,s=this._timeDynamicImagery;return i(s)&&(a=s.currentInterval,o=s.getFromCache(e,t,r,n)),i(o)||(o=b(this,e,t,r,n,a)),i(o)&&i(s)&&s.checkApproachingInterval(e,t,r,n),o},y.prototype.pickFeatures=function(e,t,r,i,n){},y}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,r,i){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16": HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch(t=t||"i8","*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}function allocate(e,t,r,i){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=r==ALLOC_NONE?i:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(o,s?1:t.length)),n){var l,i=a;for(assert(0==(3&a)),l=a+(-4&o);i<l;i+=4)HEAP32[i>>2]=0;for(l=a+o;i<l;)HEAP8[i++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var u,c,d,h=0;h<o;){var p=e[h];"function"==typeof p&&(p=Runtime.getFunctionIndex(p)),u=s||t[h],0!==u?("i64"==u&&(u="i32"),setValue(a+h,p,u),d!==u&&(c=Runtime.getNativeTypeSize(u),d=u),h+=c):h++}return a}function getMemory(e){return staticSealed?void 0!==_sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var r,i=0,n=0;;){if(r=HEAPU8[e+n>>0],i|=r,0==r&&!t)break;if(n++,t&&n==t)break}t||(t=n);var o="";if(i<128){for(var a;t>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,1024))),o=o?o+a:a,e+=1024,t-=1024;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var r=HEAP8[e++>>0];if(!r)return t;t+=String.fromCharCode(r)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}function UTF8ArrayToString(e,t){for(var r,i,n,o,a,s,l="";;){if(!(r=e[t++]))return l;if(128&r)if(i=63&e[t++],192!=(224&r))if(n=63&e[t++],224==(240&r)?r=(15&r)<<12|i<<6|n:(o=63&e[t++],240==(248&r)?r=(7&r)<<18|i<<12|n<<6|o:(a=63&e[t++],248==(252&r)?r=(3&r)<<24|i<<18|n<<12|o<<6|a:(s=63&e[t++],r=(1&r)<<30|i<<24|n<<18|o<<12|a<<6|s))),r<65536)l+=String.fromCharCode(r);else{var u=r-65536;l+=String.fromCharCode(55296|u>>10,56320|1023&u)}else l+=String.fromCharCode((31&r)<<6|i);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,r,i){if(!(i>0))return 0;for(var n=r,o=r+i-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=2097151){if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=67108863){if(r+4>=o)break;t[r++]=248|s>>24,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+5>=o)break;t[r++]=252|s>>30,t[r++]=128|s>>24&63,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t+=i<=2047?2:i<=65535?3:i<=2097151?4:i<=67108863?5:6}return t}function UTF16ToString(e){for(var t=0,r="";;){var i=HEAP16[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}}function stringToUTF16(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;r-=2;for(var i=t,n=r<2*e.length?r/2:e.length,o=0;o<n;++o){var a=e.charCodeAt(o);HEAP16[t>>1]=a,t+=2}return HEAP16[t>>1]=0,t-i}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var t=0,r="";;){var i=HEAP32[e+4*t>>2];if(0==i)return r;if(++t,i>=65536){var n=i-65536;r+=String.fromCharCode(55296|n>>10,56320|1023&n)}else r+=String.fromCharCode(i)}}function stringToUTF32(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var i=t,n=i+r-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)}if(HEAP32[t>>2]=a,(t+=4)+4>n)break}return HEAP32[t>>2]=0,t-i}function lengthBytesUTF32(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i>=55296&&i<=57343&&++r,t+=4}return t}function demangle(e){function t(){s++,"K"===e[s]&&s++;for(var t=[];"E"!==e[s];)if("S"!==e[s])if("C"!==e[s]){var r=parseInt(e.substr(s)),i=r.toString().length;if(!r||!i){s--;break}var n=e.substr(s+i,r);t.push(n),u.push(n),s+=i+r}else t.push(t[t.length-1]),s+=2;else{s++;var o=e.indexOf("_",s),a=e.substring(s,o)||0;t.push(u[a]||"?"),s=o+1}return s++,t}function r(i,n,o){n=n||1/0;var a,u="",d=[];if("N"===e[s]){if(a=t().join("::"),0===--n)return i?[a]:a}else{("K"===e[s]||c&&"L"===e[s])&&s++;var h=parseInt(e.substr(s));if(h){var p=h.toString().length;a=e.substr(s+p,h),s+=p+h}}if(c=!1,"I"===e[s]){s++;var f=r(!0);u+=r(!0,1,!0)[0]+" "+a+"<"+f.join(", ")+">"}else u=a;e:for(;s<e.length&&n-- >0;){var m=e[s++];if(m in l)d.push(l[m]);else switch(m){case"P":d.push(r(!0,1,!0)[0]+"*");break;case"R":d.push(r(!0,1,!0)[0]+"&");break;case"L":s++;var g=e.indexOf("E",s),h=g-s;d.push(e.substr(s,h)),s+=h+2;break;case"A":var h=parseInt(e.substr(s));if(s+=h.toString().length,"_"!==e[s])throw"?";s++,d.push(r(!0,1,!0)[0]+" ["+h+"]");break;case"E":break e;default:u+="?"+m;break e}}return o||1!==d.length||"void"!==d[0]||(d=[]),i?(u&&d.push(u+"?"),d):u+function(){return"("+d.join(", ")+")"}()}var i=!!Module.___cxa_demangle;if(i)try{var n=_malloc(e.length);writeStringToMemory(e.substr(1),n);var o=_malloc(4),a=Module.___cxa_demangle(n,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{n&&_free(n),o&&_free(o),a&&_free(a)}var s=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},u=[],c=!0,d=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}d=r()}catch(e){d+="?"}return d.indexOf("?")>=0&&!i&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),d}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var t=TOTAL_MEMORY;if((TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4))<=t)return!1}if((TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216))>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var r=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}return!!_emscripten_replace_memory(buffer)&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(r),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Runtime.dynCall("v",r):Runtime.dynCall("vi",r,[t.arg]):r(void 0===t.arg?null:t.arg)}else t()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,r){var i=r>0?r:lengthBytesUTF8(e)+1,n=new Array(i),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];i>255&&(i&=255),t.push(String.fromCharCode(i))}return t.join("")}function writeStringToMemory(e,t,r){for(var i=intArrayFromString(e,r),n=0;n<i.length;){var o=i[n];HEAP8[t+n>>0]=o,n+=1}}function writeArrayToMemory(e,t){for(var r=0;r<e.length;r++)HEAP8[t++>>0]=e[r]}function writeAsciiToMemory(e,t,r){for(var i=0;i<e.length;++i)HEAP8[t++>>0]=e.charCodeAt(i);r||(HEAP8[t>>0]=0)}function unSign(e,t,r){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,r){if(e<=0)return e;var i=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=i&&(t<=32||e>i)&&(e=-2*i+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,t){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[t])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,t,r){return HEAPU8.set(HEAPU8.subarray(t,t+r),e),e}function ___syscall6(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var r=DYNAMICTOP;if(0!=e){if(!t.alloc(e))return-1>>>0}return r}function _pthread_key_create(e,t){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,t){function r(e){e.source===window&&e.data===n&&(e.stopPropagation(),i.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,t)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var i=[],n="__emcc";window.addEventListener("message",r,!0),window.setImmediate=function(e){i.push(e),window.postMessage(n,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,t,r,i,n){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=i;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var t=Date.now(),r=Browser.mainLoop.queue.shift();if(r.func(r.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,a=n%1==0?n-1:Math.floor(n);r.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*n+a)/9)}return console.log('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){void 0!==i?Runtime.dynCall("vi",e,[i]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},n||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES.EINVAL}function _time(e){var t=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=t),t}function _pthread_self(){return 0}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD(),i=SYSCALLS.get(),n=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),s=n;return assert(0===i),FS.llseek(r,s,a),HEAP32[o>>2]=r.position,r.getdents&&0===s&&0===a&&(r.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var r=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<i;a++){for(var s=HEAP32[r+8*a>>2],l=HEAP32[r+(8*a+4)>>2],u=0;u<l;u++){var c=HEAPU8[s+u];0===c||10===c?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(c)}n+=l}return n}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,t,r,i){try{return Module.dynCall_iiii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,t,r,i,n,o){try{Module.dynCall_viiiii(e,t,r,i,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,t){try{Module.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,t){try{return Module.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,t,r,i){try{Module.dynCall_viii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,t,r,i,n,o,a){try{Module.dynCall_viiiiii(e,t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,t,r,i,n){try{Module.dynCall_viiii(e,t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function exit(e,t){if(!t||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var t="abort("+e+") at "+stackTrace()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw abortDecorators&&abortDecorators.forEach(function(r){t=r(t,e)}),t}var Module;Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,t){e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return r||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),r=nodeFS.readFileSync(e)),r&&!t&&(r=r.toString()),r},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,r){return r&&r.length?(r.splice||(r=Array.prototype.slice.call(r)),r.splice(0,0,t),Module["dynCall_"+e].apply(null,r)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var r=Runtime.funcWrappers[t];return r[e]||(r[e]=function(){return Runtime.dynCall(t,e,arguments)}),r[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,t},dynamicAlloc:function(e){var t=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,(DYNAMICTOP=DYNAMICTOP+15&-16)>=TOTAL_MEMORY){if(!enlargeMemory())return DYNAMICTOP=t,0}return t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,r){return r?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;return null!==e&&void 0!==e&&0!==e&&(t=Runtime.stackAlloc(1+(e.length<<2)),writeStringToMemory(e,t)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,r,i,n){var o=getCFunc(e),a=[],s=0;if(i)for(var l=0;l<i.length;l++){var u=toC[r[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(i[l])):a[l]=i[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(s)});Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,t){return"$"+t}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=e>>>16,i=65535&e,n=t>>>16,o=65535&t;return i*o+(r*o+i*n<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32 ;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){if(EXCEPTIONS.infos[t].adjusted===e)return t}return e},addRef:function(e){if(e){EXCEPTIONS.infos[e].refcount++}},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert(t.refcount>0),t.refcount--,0===t.refcount&&(t.destructor&&Runtime.dynCall("vi",t.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){EXCEPTIONS.infos[e].refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:-1===t),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;t?t<r?Module.setStatus(e+" ("+(r-t)+"/"+r+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){if(!1===Module.preMainLoop())return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i||document.msPointerLockElement===i}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||void 0!==Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var t={};t.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},t.handle=function(e,t,r,i){var n=null;if(Browser.hasBlobConstructor)try{n=new Blob([e],{type:Browser.getMimetype(t)}),n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!n){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),n=o.getBlob()}var a=Browser.URLObject.createObjectURL(n),s=new Image;s.onload=function(){assert(s.complete,"Image "+t+" could not be decoded");var i=document.createElement("canvas");i.width=s.width,i.height=s.height,i.getContext("2d").drawImage(s,0,0),Module.preloadedImages[t]=i,Browser.URLObject.revokeObjectURL(a),r&&r(e)},s.onerror=function(e){console.log("Image "+a+" could not be decoded"),i&&i()},s.src=a},Module.preloadPlugins.push(t);var r={};r.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},r.handle=function(e,t,r,i){function n(i){a||(a=!0,Module.preloadedAudios[t]=i,r&&r(e))}function o(){a||(a=!0,Module.preloadedAudios[t]=new Audio,i&&i())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var s=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return o()}var l=Browser.URLObject.createObjectURL(s),u=new Audio;u.addEventListener("canplaythrough",function(){n(u)},!1),u.onerror=function(r){a||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",i=0,n=0,o=0;o<e.length;o++)for(i=i<<8|e[o],n+=8;n>=6;){var a=i>>n-6&63;n-=6,r+=t[a]}return 2==n?(r+=t[(3&i)<<4],r+="=="):4==n&&(r+=t[(15&i)<<2],r+="="),r}(e),n(u))},u.src=l,Browser.safeSetTimeout(function(){n(u)},1e4)},Module.preloadPlugins.push(r);var i=Module.canvas;i&&(i.requestPointerLock=i.requestPointerLock||i.mozRequestPointerLock||i.webkitRequestPointerLock||i.msRequestPointerLock||function(){},i.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},i.exitPointerLock=i.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&i.addEventListener("click",function(e){!Browser.pointerLock&&i.requestPointerLock&&(i.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,t,r,i){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var n,o;if(t){var a={antialias:!1,alpha:!1};if(i)for(var s in i)a[s]=i[s];o=GL.createContext(e,a),o&&(n=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else n=e.getContext("2d");return n?(r&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=n,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),n):null},destroyContext:function(e,t,r){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t,r){function i(){Browser.isFullScreen=!1;var e=n.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},n.cancelFullScreen=n.cancelFullScreen.bind(document),Browser.lockPointer&&n.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(n)}Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=r,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var n=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?o.requestFullScreen({vrDisplay:r}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,i=Module.canvas.height,n=void 0!==window.scrollX?window.scrollX:window.pageXOffset,o=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var s=a.pageX-(n+t.left),l=a.pageY-(o+t.top);s*=r/t.width,l*=i/t.height;var u={x:s,y:l};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=u,Browser.touches[a.identifier]=u;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[a.identifier];c||(c=u),Browser.lastTouches[a.identifier]=c,Browser.touches[a.identifier]=u}return}var d=e.pageX-(n+t.left),h=e.pageY-(o+t.top);d*=r/t.width,h*=i/t.height,Browser.mouseMovementX=d-Browser.mouseX,Browser.mouseMovementY=h-Browser.mouseY,Browser.mouseX=d,Browser.mouseY=h}},xhrLoad:function(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)},asyncLoad:function(e,t,r,i){Browser.xhrLoad(e,function(r){assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),i||removeRunDependency("al "+e)},function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()}),i||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,r){var i=Module.canvas;Browser.updateCanvasDimensions(i,e,t),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e} Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var i=t,n=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(i/n<Module.forcedAspectRatio?i=Math.round(n*Module.forcedAspectRatio):n=Math.round(i/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/i,screen.height/n);i=Math.round(i*o),n=Math.round(n*o)}Browser.resizeCanvas?(e.width!=i&&(e.width=i),e.height!=n&&(e.height=n),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(i!=t||n!=r?(e.style.setProperty("width",i+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,t,r){Browser.requestFullScreen(e,t,r)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,r){Browser.setCanvasSize(e,t,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,t,r,i){return Browser.createContext(e,t,r,i)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var l=e.Uint32Array;var u=e.Float32Array;var c=e.Float64Array;var d=new i(r);var h=new n(r);var p=new o(r);var f=new a(r);var m=new s(r);var g=new l(r);var v=new u(r);var _=new c(r);var y=e.byteLength;var b=t.STACKTOP|0;var C=t.STACK_MAX|0;var w=t.tempDoublePtr|0;var S=t.ABORT|0;var T=t.cttz_i8|0;var E=0;var x=0;var P=0;var A=0;var D=e.NaN,I=e.Infinity;var O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0;var V=0;var z=0;var G=0;var H=0;var W=0;var j=0;var q=0;var Y=0;var X=0;var Q=0;var Z=e.Math.floor;var K=e.Math.abs;var J=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var te=e.Math.sin;var re=e.Math.tan;var ie=e.Math.acos;var ne=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var se=e.Math.exp;var le=e.Math.log;var ue=e.Math.ceil;var ce=e.Math.imul;var de=e.Math.min;var he=e.Math.clz32;var pe=t.abort;var fe=t.assert;var me=t.invoke_iiii;var ge=t.invoke_viiiii;var ve=t.invoke_vi;var _e=t.invoke_ii;var ye=t.invoke_viii;var be=t.invoke_v;var Ce=t.invoke_viiiiii;var we=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Te=t._pthread_getspecific;var Ee=t._pthread_setspecific;var xe=t.__ZSt18uncaught_exceptionv;var Pe=t._emscripten_set_main_loop;var Ae=t._pthread_self;var De=t._abort;var Ie=t._pthread_cleanup_push;var Oe=t.___syscall6;var Me=t._sbrk;var Re=t._time;var Le=t._pthread_key_create;var Ne=t.___setErrNo;var ke=t._emscripten_memcpy_big;var Fe=t.___syscall54;var Be=t.___syscall140;var Ue=t._pthread_once;var Ve=t._emscripten_set_main_loop_timing;var ze=t._sysconf;var Ge=t.___syscall146;var He=t.___cxa_begin_catch;var We=0;function je(e){if(y(e)&16777215||y(e)<=16777215||y(e)>2147483648)return false;d=new i(e);h=new n(e);p=new o(e);f=new a(e);m=new s(e);g=new l(e);v=new u(e);_=new c(e);r=e;return true}function qe(e){e=e|0;var t=0;t=b;b=b+e|0;b=b+15&-16;return t|0}function Ye(){return b|0}function Xe(e){e=e|0;b=e}function Qe(e,t){e=e|0;t=t|0;b=e;C=t}function Ze(e,t){e=e|0;t=t|0;if(!E){E=e;x=t}}function Ke(e){e=e|0;d[w>>0]=d[e>>0];d[w+1>>0]=d[e+1>>0];d[w+2>>0]=d[e+2>>0];d[w+3>>0]=d[e+3>>0]}function Je(e){e=e|0;d[w>>0]=d[e>>0];d[w+1>>0]=d[e+1>>0];d[w+2>>0]=d[e+2>>0];d[w+3>>0]=d[e+3>>0];d[w+4>>0]=d[e+4>>0];d[w+5>>0]=d[e+5>>0];d[w+6>>0]=d[e+6>>0];d[w+7>>0]=d[e+7>>0]}function $e(e){e=e|0;V=e}function et(){return V|0}function tt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0;f=b;b=b+576|0;c=f+48|0;s=f+32|0;a=f+16|0;o=f;u=f+64|0;d=f+60|0;l=e+4|0;h=e+8|0;if((p[l>>2]|0)>>>0>(p[h>>2]|0)>>>0){p[o>>2]=1138;p[o+4>>2]=2119;p[o+8>>2]=1117;yr(u,1084,o)|0;_r(u)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){p[a>>2]=1138;p[a+4>>2]=2120;p[a+8>>2]=1157;yr(u,1084,a)|0;_r(u)|0}a=p[h>>2]|0;if(a>>>0>=t>>>0){h=1;b=f;return h|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){p[s>>2]=1138;p[s+4>>2]=2129;p[s+8>>2]=1205;yr(u,1084,s)|0;_r(u)|0}r=ce(t,i)|0;do{if(!n){o=rt(p[e>>2]|0,r,d,1)|0;if(!o){h=0;b=f;return h|0}else{p[e>>2]=o;break}}else{a=it(r,d)|0;if(!a){h=0;b=f;return h|0}Pi[n&0](a,p[e>>2]|0,p[l>>2]|0);o=p[e>>2]|0;do{if(o)if(!(o&7)){ot(o,0,0,1,0)|0;break}else{p[c>>2]=1138;p[c+4>>2]=2502;p[c+8>>2]=1504;yr(u,1084,c)|0;_r(u)|0;break}}while(0);p[e>>2]=a}}while(0);o=p[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;p[h>>2]=t;h=1;b=f;return h|0}function rt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+560|0;l=u+32|0;o=u+16|0;n=u;s=u+48|0;a=u+44|0;if(e&7){p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1482;yr(s,1084,n)|0;_r(s)|0;l=0;b=u;return l|0}if(t>>>0>2147418112){p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1375;yr(s,1084,o)|0;_r(s)|0;l=0;b=u;return l|0}p[a>>2]=t;i=ot(e,t,a,i,0)|0;if(r)p[r>>2]=p[a>>2];if(!(i&7)){l=i;b=u;return l|0}p[l>>2]=1138;p[l+4>>2]=2554;p[l+8>>2]=1428;yr(s,1084,l)|0;_r(s)|0;l=i;b=u;return l|0}function it(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+560|0;s=l+32|0;a=l+16|0;r=l;o=l+48|0;n=l+44|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1375;yr(o,1084,r)|0;_r(o)|0;s=0;b=l;return s|0}p[n>>2]=i;r=ot(0,i,n,1,0)|0;e=p[n>>2]|0;if(t)p[t>>2]=e;if((r|0)==0|e>>>0<i>>>0){p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1401;yr(o,1084,a)|0;_r(o)|0;s=0;b=l;return s|0}if(!(r&7)){s=r;b=l;return s|0}p[s>>2]=1138;p[s+4>>2]=2529;p[s+8>>2]=1428;yr(o,1084,s)|0;_r(o)|0;s=r;b=l;return s|0}function nt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0;F=b;b=b+880|0;L=F+144|0;R=F+128|0;M=F+112|0;O=F+96|0;A=F+80|0;w=F+64|0;y=F+48|0;C=F+32|0;g=F+16|0;c=F;I=F+360|0;N=F+296|0;k=F+224|0;_=F+156|0;if((t|0)==0|i>>>0>11){e=0;b=F;return e|0}p[e>>2]=t;n=k;o=n+68|0;do{p[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=d[r+o>>0]|0;if(n<<24>>24){D=k+((n&255)<<2)|0;p[D>>2]=(p[D>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=p[k+(u<<2)>>2]|0;if(!n)p[e+28+(u+-1<<2)>>2]=0;else{D=u+-1|0;p[N+(D<<2)>>2]=o;o=n+o|0;P=16-u|0;p[e+28+(D<<2)>>2]=(o+-1<<P|(1<<P)+-1)+1;p[e+96+(D<<2)>>2]=l;p[_+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0<u>>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){D=a;break}else o=o<<1}p[e+4>>2]=l;o=e+172|0;do{if(l>>>0>(p[o>>2]|0)>>>0){p[o>>2]=l;if(l){n=l+-1|0;if(n&l)v=14}else{n=-1;v=14}if((v|0)==14){P=n>>>16|n;P=P>>>8|P;P=P>>>4|P;P=P>>>2|P;P=(P>>>1|P)+1|0;p[o>>2]=P>>>0>t>>>0?t:P}a=e+176|0;n=p[a>>2]|0;do{if(n){P=p[n+-4>>2]|0;n=n+-8|0;if(!((P|0)!=0?(P|0)==(~p[n>>2]|0):0)){p[c>>2]=1138;p[c+4>>2]=647;p[c+8>>2]=1851;yr(I,1084,c)|0;_r(I)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[g>>2]=1138;p[g+4>>2]=2502;p[g+8>>2]=1504;yr(I,1084,g)|0;_r(I)|0;break}}}while(0);o=p[o>>2]|0;o=(o|0)!=0?o:1;n=it((o<<1)+8|0,0)|0;if(!n){p[a>>2]=0;n=0;break}else{p[n+4>>2]=o;p[n>>2]=~o;p[a>>2]=n+8;v=25;break}}else v=25}while(0);e:do{if((v|0)==25){P=e+24|0;d[P>>0]=s;d[e+25>>0]=D;o=e+176|0;a=0;do{x=d[r+a>>0]|0;n=x&255;if(x<<24>>24){if(!(p[k+(n<<2)>>2]|0)){p[C>>2]=1138;p[C+4>>2]=2272;p[C+8>>2]=1249;yr(I,1084,C)|0;_r(I)|0}x=_+(n<<2)|0;n=p[x>>2]|0;p[x>>2]=n+1;if(n>>>0>=l>>>0){p[y>>2]=1138;p[y+4>>2]=2276;p[y+8>>2]=1262;yr(I,1084,y)|0;_r(I)|0}h[(p[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=d[P>>0]|0;E=(n&255)>>>0<i>>>0?i:0;x=e+8|0;p[x>>2]=E;T=(E|0)!=0;if(T){S=1<<E;n=e+164|0;do{if(S>>>0>(p[n>>2]|0)>>>0){p[n>>2]=S;a=e+168|0;n=p[a>>2]|0;do{if(n){C=p[n+-4>>2]|0;n=n+-8|0;if(!((C|0)!=0?(C|0)==(~p[n>>2]|0):0)){p[w>>2]=1138;p[w+4>>2]=647;p[w+8>>2]=1851;yr(I,1084,w)|0;_r(I)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[A>>2]=1138;p[A+4>>2]=2502;p[A+8>>2]=1504;yr(I,1084,A)|0;_r(I)|0;break}}}while(0);n=S<<2;o=it(n+8|0,0)|0;if(!o){p[a>>2]=0;n=0;break e}else{A=o+8|0;p[o+4>>2]=S;p[o>>2]=~S;p[a>>2]=A;o=A;break}}else{o=e+168|0;n=S<<2;a=o;o=p[o>>2]|0}}while(0);Xr(o|0,-1,n|0)|0;_=e+176|0;w=1;do{if(p[k+(w<<2)>>2]|0){y=E-w|0;C=1<<y;o=w+-1|0;s=p[N+(o<<2)>>2]|0;if(o>>>0>=16){p[O>>2]=1138;p[O+4>>2]=1956;p[O+8>>2]=1725;yr(I,1084,O)|0;_r(I)|0}n=p[e+28+(o<<2)>>2]|0;if(!n)t=-1;else t=(n+-1|0)>>>(16-w|0);if(s>>>0<=t>>>0){g=(p[e+96+(o<<2)>>2]|0)-s|0;v=w<<16;do{n=m[(p[_>>2]|0)+(g+s<<1)>>1]|0;if((f[r+n>>0]|0|0)!=(w|0)){p[M>>2]=1138;p[M+4>>2]=2318;p[M+8>>2]=1291;yr(I,1084,M)|0;_r(I)|0}c=s<<y;o=n|v;u=0;do{l=u+c|0;if(l>>>0>=S>>>0){p[R>>2]=1138;p[R+4>>2]=2324;p[R+8>>2]=1325;yr(I,1084,R)|0;_r(I)|0}n=p[a>>2]|0;if((p[n+(l<<2)>>2]|0)!=-1){p[L>>2]=1138;p[L+4>>2]=2326;p[L+8>>2]=1348;yr(I,1084,L)|0;_r(I)|0;n=p[a>>2]|0}p[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0<C>>>0);s=s+1|0}while(s>>>0<=t>>>0)}}w=w+1|0}while(E>>>0>=w>>>0);n=d[P>>0]|0}o=e+96|0;p[o>>2]=(p[o>>2]|0)-(p[N>>2]|0);o=e+100|0;p[o>>2]=(p[o>>2]|0)-(p[N+4>>2]|0);o=e+104|0;p[o>>2]=(p[o>>2]|0)-(p[N+8>>2]|0);o=e+108|0;p[o>>2]=(p[o>>2]|0)-(p[N+12>>2]|0);o=e+112|0;p[o>>2]=(p[o>>2]|0)-(p[N+16>>2]|0);o=e+116|0;p[o>>2]=(p[o>>2]|0)-(p[N+20>>2]|0);o=e+120|0;p[o>>2]=(p[o>>2]|0)-(p[N+24>>2]|0);o=e+124|0;p[o>>2]=(p[o>>2]|0)-(p[N+28>>2]|0);o=e+128|0;p[o>>2]=(p[o>>2]|0)-(p[N+32>>2]|0);o=e+132|0;p[o>>2]=(p[o>>2]|0)-(p[N+36>>2]|0);o=e+136|0;p[o>>2]=(p[o>>2]|0)-(p[N+40>>2]|0);o=e+140|0;p[o>>2]=(p[o>>2]|0)-(p[N+44>>2]|0);o=e+144|0;p[o>>2]=(p[o>>2]|0)-(p[N+48>>2]|0);o=e+148|0;p[o>>2]=(p[o>>2]|0)-(p[N+52>>2]|0);o=e+152|0;p[o>>2]=(p[o>>2]|0)-(p[N+56>>2]|0);o=e+156|0;p[o>>2]=(p[o>>2]|0)-(p[N+60>>2]|0);o=e+16|0;p[o>>2]=0;a=e+20|0;p[a>>2]=n&255;t:do{if(T){while(1){if(!i)break t;n=i+-1|0;if(!(p[k+(i<<2)>>2]|0))i=n;else break}p[o>>2]=p[e+28+(n<<2)>>2];n=E+1|0;p[a>>2]=n;if(n>>>0<=D>>>0){while(1){if(p[k+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>D>>>0)break t}p[a>>2]=n}}}while(0);p[e+92>>2]=-1;p[e+160>>2]=1048575;p[e+12>>2]=32-(p[x>>2]|0);n=1}}while(0);e=n;b=F;return e|0}function ot(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;do{if(!e){i=Ur(t)|0;if(r){if(!i)e=0;else e=Gr(i)|0;p[r>>2]=e}}else{if(!t){Vr(e);if(!r){i=0;break}p[r>>2]=0;i=0;break}if(i){i=zr(e,t)|0;e=(i|0)==0?e:i}else i=0;if(r){t=Gr(e)|0;p[r>>2]=t}}}while(0);return i|0}function at(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((p[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}p[r+4>>2]=(f[e+12>>0]|0)<<8|(f[e+13>>0]|0);p[r+8>>2]=(f[e+14>>0]|0)<<8|(f[e+15>>0]|0);p[r+12>>2]=f[e+16>>0];p[r+16>>2]=f[e+17>>0];t=e+18|0;i=r+32|0;p[i>>2]=f[t>>0];p[i+4>>2]=0;t=d[t>>0]|0;p[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;p[r+24>>2]=(f[e+26>>0]|0)<<16|(f[e+25>>0]|0)<<24|(f[e+27>>0]|0)<<8|(f[e+28>>0]|0);p[r+28>>2]=(f[e+30>>0]|0)<<16|(f[e+29>>0]|0)<<24|(f[e+31>>0]|0)<<8|(f[e+32>>0]|0);r=1;return r|0}function st(e){e=e|0;He(e|0)|0;Ut()}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=b;b=b+528|0;n=o;i=o+16|0;t=p[e+20>>2]|0;if(t)ut(t);t=e+4|0;r=p[t>>2]|0;if(!r){n=e+16|0;d[n>>0]=0;b=o;return}if(!(r&7))ot(r,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(i,1084,n)|0;_r(i)|0}p[t>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;n=e+16|0;d[n>>0]=0;b=o;return}function ut(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;l=b;b=b+592|0;a=l+64|0;o=l+48|0;s=l+32|0;i=l+16|0;r=l;n=l+80|0;if(!e){b=l;return}t=p[e+168>>2]|0;do{if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[r>>2]=1138;p[r+4>>2]=647;p[r+8>>2]=1851;yr(n,1084,r)|0;_r(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1504;yr(n,1084,i)|0;_r(n)|0;break}}}while(0);t=p[e+176>>2]|0;do{if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[s>>2]=1138;p[s+4>>2]=647;p[s+8>>2]=1851;yr(n,1084,s)|0;_r(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yr(n,1084,o)|0;_r(n)|0;break}}}while(0);if(!(e&7)){ot(e,0,0,1,0)|0;b=l;return}else{p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1504;yr(n,1084,a)|0;_r(n)|0;b=l;return}}function ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+544|0;a=l+16|0;t=l;o=l+32|0;n=e+8|0;r=p[n>>2]|0;if((r+-1|0)>>>0>=8192){p[t>>2]=1138;p[t+4>>2]=3002;p[t+8>>2]=1529;yr(o,1084,t)|0;_r(o)|0}p[e>>2]=r;i=e+20|0;t=p[i>>2]|0;if(!t){t=it(180,0)|0;if(!t)t=0;else{s=t+164|0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0}p[i>>2]=t;s=p[e>>2]|0}else s=r;if(!(p[n>>2]|0)){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;a=p[e>>2]|0}else a=s;o=p[e+4>>2]|0;if(a>>>0>16){i=a;r=0}else{e=0;e=nt(t,s,o,e)|0;b=l;return e|0}while(1){n=r+1|0;if(i>>>0>3){i=i>>>1;r=n}else{i=n;break}}e=r+2+((i|0)!=32&1<<i>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=nt(t,s,o,e)|0;b=l;return e|0}function dt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0;I=b;b=b+720|0;E=I+160|0;T=I+144|0;S=I+128|0;w=I+112|0;C=I+96|0;y=I+80|0;_=I+64|0;v=I+48|0;c=I+32|0;s=I+16|0;n=I;A=I+200|0;D=I+176|0;x=ht(e,14)|0;if(!x){p[t>>2]=0;r=t+4|0;i=p[r>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(A,1084,n)|0;_r(A)|0}p[r>>2]=0;p[t+8>>2]=0;p[t+12>>2]=0}d[t+16>>0]=0;r=t+20|0;i=p[r>>2]|0;if(!i){t=1;b=I;return t|0}ut(i);p[r>>2]=0;t=1;b=I;return t|0}m=t+4|0;g=t+8|0;r=p[g>>2]|0;if((r|0)!=(x|0)){if(r>>>0<=x>>>0){do{if((p[t+12>>2]|0)>>>0<x>>>0){if(tt(m,x,(r+1|0)==(x|0),1,0)|0){r=p[g>>2]|0;break}d[t+16>>0]=1;t=0;b=I;return t|0}}while(0);Xr((p[m>>2]|0)+r|0,0,x-r|0)|0}p[g>>2]=x}Xr(p[m>>2]|0,0,x|0)|0;h=e+20|0;r=p[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=p[o>>2]|0;if((i|0)==(p[a>>2]|0))i=0;else{p[o>>2]=i+1;i=f[i>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yr(A,1084,s)|0;_r(A)|0;r=p[h>>2]|0}i=i<<32-r|p[n>>2];p[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=p[i>>2]|0}u=i>>>27;p[n>>2]=i<<5;p[h>>2]=r+-5;if((u+-1|0)>>>0>20){t=0;b=I;return t|0}p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(tt(r,21,0,1,0)|0){s=p[i>>2]|0;l=p[r>>2]|0;Xr(l+s|0,0,21-s|0)|0;p[i>>2]=21;if(u){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=p[h>>2]|0;if((r|0)<3)do{i=p[n>>2]|0;if((i|0)==(p[o>>2]|0))i=0;else{p[n>>2]=i+1;i=f[i>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[c>>2]=1138;p[c+4>>2]=3204;p[c+8>>2]=1638;yr(A,1084,c)|0;_r(A)|0;r=p[h>>2]|0}i=i<<32-r|p[a>>2];p[a>>2]=i}while((r|0)<3);else i=p[a>>2]|0;p[a>>2]=i<<3;p[h>>2]=r+-3;d[l+(f[1599+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(u|0))}if(ct(D)|0){u=e+4|0;s=e+8|0;l=e+16|0;i=0;t:while(1){a=x-i|0;r=pt(e,D)|0;r:do{if(r>>>0<17){if((p[g>>2]|0)>>>0<=i>>>0){p[v>>2]=1138;p[v+4>>2]=906;p[v+8>>2]=1769;yr(A,1084,v)|0;_r(A)|0}d[(p[m>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=p[h>>2]|0;if((r|0)<3)do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[_>>2]=1138;p[_+4>>2]=3204;p[_+8>>2]=1638;yr(A,1084,_)|0;_r(A)|0;r=p[h>>2]|0}n=n<<32-r|p[l>>2];p[l>>2]=n}while((r|0)<3);else n=p[l>>2]|0;p[l>>2]=n<<3;p[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=p[h>>2]|0;if((r|0)<7)do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[y>>2]=1138;p[y+4>>2]=3204;p[y+8>>2]=1638;yr(A,1084,y)|0;_r(A)|0;r=p[h>>2]|0}n=n<<32-r|p[l>>2];p[l>>2]=n}while((r|0)<7);else n=p[l>>2]|0;p[l>>2]=n<<7;p[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){P=90;break t}o=p[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=p[u>>2]|0;if((r|0)==(p[s>>2]|0))o=0;else{p[u>>2]=r+1;o=f[r>>0]|0}r=n+8|0;p[h>>2]=r;if((r|0)>=33){p[C>>2]=1138;p[C+4>>2]=3204;p[C+8>>2]=1638;yr(A,1084,C)|0;_r(A)|0;r=p[h>>2]|0}n=o<<32-r|p[l>>2];p[l>>2]=n;if((r|0)<2)n=r;else break}}else{n=p[l>>2]|0;r=o}p[l>>2]=n<<2;p[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=p[u>>2]|0;if((r|0)==(p[s>>2]|0))o=0;else{p[u>>2]=r+1;o=f[r>>0]|0}r=n+8|0;p[h>>2]=r;if((r|0)>=33){p[w>>2]=1138;p[w+4>>2]=3204;p[w+8>>2]=1638;yr(A,1084,w)|0;_r(A)|0;r=p[h>>2]|0}n=o<<32-r|p[l>>2];p[l>>2]=n;if((r|0)<6)n=r;else break}}else{n=p[l>>2]|0;r=o}p[l>>2]=n<<6;p[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((p[g>>2]|0)>>>0<=r>>>0){p[S>>2]=1138;p[S+4>>2]=906;p[S+8>>2]=1769;yr(A,1084,S)|0;_r(A)|0}n=d[(p[m>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((p[g>>2]|0)>>>0<=i>>>0){p[T>>2]=1138;p[T+4>>2]=906;p[T+8>>2]=1769;yr(A,1084,T)|0;_r(A)|0}d[(p[m>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(x>>>0>r>>>0)i=r;else break}if((P|0)==90){p[E>>2]=1138;p[E+4>>2]=3145;p[E+8>>2]=1620;yr(A,1084,E)|0;_r(A)|0;r=0;break}if((x|0)==(r|0))r=ct(t)|0;else r=0}else r=0}else{d[D+16>>0]=1;r=0}}while(0);lt(D);t=r;b=I;return t|0}function ht(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+528|0;a=u;o=u+16|0;if(!t){l=0;b=u;return l|0}if(t>>>0<=16){l=ft(e,t)|0;b=u;return l|0}s=ft(e,t+-16|0)|0;l=e+20|0;t=p[l>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=p[i>>2]|0;if((e|0)==(p[n>>2]|0))e=0;else{p[i>>2]=e+1;e=f[e>>0]|0}t=t+8|0;p[l>>2]=t;if((t|0)>=33){p[a>>2]=1138;p[a+4>>2]=3204;p[a+8>>2]=1638;yr(o,1084,a)|0;_r(o)|0;t=p[l>>2]|0}e=e<<32-t|p[r>>2];p[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=p[e>>2]|0}p[r>>2]=e<<16;p[l>>2]=t+-16;l=e>>>16|s<<16;b=u;return l|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,g=0,v=0,_=0;_=b;b=b+576|0;d=_+48|0;c=_+32|0;u=_+16|0;l=_;g=_+64|0;h=p[t+20>>2]|0;v=e+20|0;s=p[v>>2]|0;do{if((s|0)<24){a=e+4|0;i=p[a>>2]|0;n=p[e+8>>2]|0;r=i>>>0<n>>>0;if((s|0)>=16){if(r){p[a>>2]=i+1;r=f[i>>0]|0}else r=0;p[v>>2]=s+8;a=e+16|0;o=r<<24-s|p[a>>2];p[a>>2]=o;break}if(r){o=(f[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0<n>>>0){i=f[r>>0]|0;r=r+1|0}else i=0;p[a>>2]=r;p[v>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|p[a>>2];p[a>>2]=o}else{o=e+16|0;a=o;o=p[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(p[h+16>>2]|0)>>>0){i=p[(p[h+168>>2]|0)+(o>>>(32-(p[h+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){p[l>>2]=1138;p[l+4>>2]=3249;p[l+8>>2]=1665;yr(g,1084,l)|0;_r(g)|0}r=i&65535;i=i>>>16;if((p[t+8>>2]|0)>>>0<=r>>>0){p[u>>2]=1138;p[u+4>>2]=905;p[u+8>>2]=1769;yr(g,1084,u)|0;_r(g)|0}if((f[(p[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){p[c>>2]=1138;p[c+4>>2]=3253;p[c+8>>2]=1682;yr(g,1084,c)|0;_r(g)|0}}else{i=p[h+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(p[h+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(p[h+96+(r<<2)>>2]|0)|0;if(r>>>0<(p[t>>2]|0)>>>0){r=m[(p[h+176>>2]|0)+(r<<1)>>1]|0;break}p[d>>2]=1138;p[d+4>>2]=3271;p[d+8>>2]=1620;yr(g,1084,d)|0;_r(g)|0;v=0;b=_;return v|0}}while(0);p[a>>2]=p[a>>2]<<i;p[v>>2]=(p[v>>2]|0)-i;v=r;b=_;return v|0}function ft(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+544|0;s=u+16|0;r=u;a=u+32|0;if(t>>>0>=33){p[r>>2]=1138;p[r+4>>2]=3195;p[r+8>>2]=1622;yr(a,1084,r)|0;_r(a)|0}l=e+20|0;r=p[l>>2]|0;if((r|0)>=(t|0)){n=e+16|0;o=n;n=p[n>>2]|0;a=r;s=32-t|0;s=n>>>s;n=n<<t;p[o>>2]=n;t=a-t|0;p[l>>2]=t;b=u;return s|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=p[n>>2]|0;if((e|0)==(p[o>>2]|0))e=0;else{p[n>>2]=e+1;e=f[e>>0]|0}r=r+8|0;p[l>>2]=r;if((r|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yr(a,1084,s)|0;_r(a)|0;r=p[l>>2]|0}e=e<<32-r|p[i>>2];p[i>>2]=e}while((r|0)<(t|0));s=32-t|0;s=e>>>s;a=e<<t;p[i>>2]=a;t=r-t|0;p[l>>2]=t;b=u;return s|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0;g=b;b=b+528|0;h=g;c=g+16|0;if((e|0)==0|t>>>0<62){m=0;b=g;return m|0}u=it(300,0)|0;if(!u){m=0;b=g;return m|0}p[u>>2]=519686845;r=u+4|0;p[r>>2]=0;i=u+8|0;p[i>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{p[a>>2]=0;a=a+4|0}while((a|0)<(s|0));d[l+44>>0]=0;v=u+184|0;a=u+208|0;s=u+232|0;_=u+252|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;_=u+268|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;_=u+284|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;p[n>>2]=0;p[n+4>>2]=0;p[n+8>>2]=0;p[n+12>>2]=0;p[n+16>>2]=0;d[n+20>>0]=0;p[o>>2]=0;p[o+4>>2]=0;p[o+8>>2]=0;p[o+12>>2]=0;p[o+16>>2]=0;d[o+20>>0]=0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;p[v+12>>2]=0;p[v+16>>2]=0;d[v+20>>0]=0;p[a>>2]=0;p[a+4>>2]=0;p[a+8>>2]=0;p[a+12>>2]=0;p[a+16>>2]=0;d[a+20>>0]=0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0;d[s+16>>0]=0;do{if(((t>>>0>=74?((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)==18552:0)?((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0>=74:0)?((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0<=t>>>0:0){p[l>>2]=e;p[r>>2]=e;p[i>>2]=t;if(Et(u)|0){r=p[l>>2]|0;if((f[r+39>>0]|0)<<8|(f[r+40>>0]|0)){if(!(xt(u)|0))break;if(!(Pt(u)|0))break;r=p[l>>2]|0}if(!((f[r+55>>0]|0)<<8|(f[r+56>>0]|0))){_=u;b=g;return _|0}if(At(u)|0?Dt(u)|0:0){_=u;b=g;return _|0}}}else m=7}while(0);if((m|0)==7)p[l>>2]=0;Lt(u);if(!(u&7)){ot(u,0,0,1,0)|0;_=0;b=g;return _|0}else{p[h>>2]=1138;p[h+4>>2]=2502;p[h+8>>2]=1504;yr(c,1084,h)|0;_r(c)|0;_=0;b=g;return _|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0;c=b;b=b+528|0;u=c;l=c+16|0;o=p[e+88>>2]|0;s=(f[o+70+(n<<2)+1>>0]|0)<<16|(f[o+70+(n<<2)>>0]|0)<<24|(f[o+70+(n<<2)+2>>0]|0)<<8|(f[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(f[o+16>>0]|0)>>>0)o=(f[o+70+(a<<2)+1>>0]|0)<<16|(f[o+70+(a<<2)>>0]|0)<<24|(f[o+70+(a<<2)+2>>0]|0)<<8|(f[o+70+(a<<2)+3>>0]|0);else o=p[e+8>>2]|0;if(o>>>0>s>>>0){l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=vt(e,l,u,t,r,i,n)|0;b=c;return u|0}p[u>>2]=1138;p[u+4>>2]=3690;p[u+8>>2]=1780;yr(l,1084,u)|0;_r(l)|0;l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=vt(e,l,u,t,r,i,n)|0;b=c;return u|0}function vt(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,c=0;c=p[e+88>>2]|0;l=((f[c+12>>0]|0)<<8|(f[c+13>>0]|0))>>>a;u=((f[c+14>>0]|0)<<8|(f[c+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;c=c+18|0;a=d[c>>0]|0;a=ce(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ce(a,u)|0)>>>0>n>>>0){e=0;return e|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!r){e=0;return e|0}p[e+92>>2]=t;p[e+96>>2]=t;p[e+104>>2]=r;p[e+100>>2]=t+r;p[e+108>>2]=0;p[e+112>>2]=0;switch(f[c>>0]|0|0){case 0:{It(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Ot(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 9:{Mt(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 8:case 7:{Rt(e,i,n,a,l,u,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function _t(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+4>>2]|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+8>>2]|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+12>>2]|0}function Ct(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+32>>2]|0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;n=b;b=b+576|0;i=n+40|0;r=n+56|0;o=n;p[o>>2]=40;at(e,t,o)|0;t=o+32|0;e=p[t+4>>2]|0;do{switch(p[t>>2]|0){case 0:{if(!e){o=8;b=n;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;b=n;return o|0}else e=14;break}case 10:{if(!e){o=8;b=n;return o|0}else e=14;break}default:e=14}}while(0);if((e|0)==13){o=16;b=n;return o|0}else if((e|0)==14){p[i>>2]=1138;p[i+4>>2]=2668;p[i+8>>2]=1523;yr(r,1084,i)|0;_r(r)|0;o=0;b=n;return o|0}return 0}function St(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0;s=b;b=b+576|0;o=s+40|0;n=s+56|0;l=s;p[l>>2]=40;at(e,t,l)|0;i=(((p[l+4>>2]|0)>>>r)+3|0)>>>2;t=(((p[l+8>>2]|0)>>>r)+3|0)>>>2;r=l+32|0;e=p[r+4>>2]|0;do{switch(p[r>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}}while(0);if((a|0)==13)e=16;else if((a|0)==14){p[o>>2]=1138;p[o+4>>2]=2668;p[o+8>>2]=1523;yr(n,1084,o)|0;_r(n)|0;e=0}l=ce(ce(t,i)|0,e)|0;b=s;return l|0}function Tt(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0;g=b;b=b+592|0;m=g+56|0;a=g+40|0;h=g+72|0;d=g;f=g+68|0;p[d>>2]=40;at(e,t,d)|0;s=(p[d+4>>2]|0)>>>n;l=(p[d+8>>2]|0)>>>n;d=d+32|0;i=p[d+4>>2]|0;do{switch(p[d>>2]|0){case 0:{if(!i)d=8;else u=14;break}case 1:{if(!i)u=13;else u=14;break}case 2:{if(!i)u=13;else u=14;break}case 3:{if(!i)u=13;else u=14;break}case 4:{if(!i)u=13;else u=14;break}case 5:{if(!i)u=13;else u=14;break}case 6:{if(!i)u=13;else u=14;break}case 7:{if(!i)u=13;else u=14;break}case 8:{if(!i)u=13;else u=14;break}case 9:{if(!i)d=8;else u=14;break}case 10:{if(!i)d=8;else u=14;break}default:u=14}}while(0);if((u|0)==13)d=16;else if((u|0)==14){p[a>>2]=1138;p[a+4>>2]=2668;p[a+8>>2]=1523;yr(h,1084,a)|0;_r(h)|0;d=0}p[f>>2]=r;c=mt(e,t)|0;t=o+n|0;if(t>>>0>n>>>0){u=(c|0)==0;e=r;while(1){i=ce((s+3|0)>>>2,d)|0;a=ce(i,(l+3|0)>>>2)|0;if(!(n>>>0>15|(u|a>>>0<8))?(p[c>>2]|0)==519686845:0)gt(c,f,a,i,n)|0;e=e+a|0;p[f>>2]=e;n=n+1|0;if((n|0)==(t|0))break;else{l=l>>>1;s=s>>>1}}}if(!c){b=g;return}if((p[c>>2]|0)!=519686845){b=g;return}Lt(c);if(!(c&7)){ot(c,0,0,1,0)|0;b=g;return}else{p[m>>2]=1138;p[m+4>>2]=2502;p[m+8>>2]=1504;yr(h,1084,m)|0;_r(h)|0;b=g;return}}function Et(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=p[e+4>>2]|0;o=e+88|0;n=p[o>>2]|0;t=(f[n+68>>0]|0)<<8|(f[n+67>>0]|0)<<16|(f[n+69>>0]|0);r=i+t|0;n=(f[n+65>>0]|0)<<8|(f[n+66>>0]|0);if(!n){e=0;return e|0}p[a>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=i+(n+t);p[e+108>>2]=0;p[e+112>>2]=0;if(!(dt(a,e+116|0)|0)){e=0;return e|0}t=p[o>>2]|0;do{if(!((f[t+39>>0]|0)<<8|(f[t+40>>0]|0))){if(!((f[t+55>>0]|0)<<8|(f[t+56>>0]|0))){e=0;return e|0}}else{if(!(dt(a,e+140|0)|0)){e=0;return e|0}if(dt(a,e+188|0)|0){t=p[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((f[t+55>>0]|0)<<8|(f[t+56>>0]|0)){if(!(dt(a,e+164|0)|0)){e=0;return e|0}if(!(dt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function xt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0;g=b;b=b+576|0;s=g;a=g+64|0;m=g+16|0;i=e+88|0;t=p[i>>2]|0;h=(f[t+39>>0]|0)<<8|(f[t+40>>0]|0);u=e+236|0;o=e+240|0;r=p[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((p[e+244>>2]|0)>>>0<h>>>0){if(tt(u,h,(r+1|0)==(h|0),4,0)|0){t=p[o>>2]|0;break}d[e+248>>0]=1;m=0;b=g;return m|0}else t=r}while(0);Xr((p[u>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=p[i>>2]|0}p[o>>2]=h}l=e+92|0;r=p[e+4>>2]|0;i=(f[t+34>>0]|0)<<8|(f[t+33>>0]|0)<<16|(f[t+35>>0]|0);n=r+i|0;t=(f[t+37>>0]|0)<<8|(f[t+36>>0]|0)<<16|(f[t+38>>0]|0);if(!t){m=0;b=g;return m|0}p[l>>2]=n;p[e+96>>2]=n;p[e+104>>2]=t;p[e+100>>2]=r+(t+i);p[e+108>>2]=0;p[e+112>>2]=0;p[m+20>>2]=0;p[m>>2]=0;p[m+4>>2]=0;p[m+8>>2]=0;p[m+12>>2]=0;d[m+16>>0]=0;e=m+24|0;p[m+44>>2]=0;p[e>>2]=0;p[e+4>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;d[e+16>>0]=0;if(dt(l,m)|0?(c=m+24|0,dt(l,c)|0):0){if(!(p[o>>2]|0)){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yr(a,1084,s)|0;_r(a)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=p[u>>2]|0;while(1){i=(pt(l,m)|0)+i&31;n=(pt(l,c)|0)+n&63;o=(pt(l,m)|0)+o&31;t=(pt(l,m)|0)+t|0;a=(pt(l,c)|0)+a&63;e=(pt(l,m)|0)+e&31;p[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;lt(m+24|0);lt(m);m=t;b=g;return m|0}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0;D=b;b=b+1008|0;a=D;o=D+496|0;A=D+472|0;x=D+276|0;P=D+80|0;E=D+16|0;n=p[e+88>>2]|0;T=(f[n+47>>0]|0)<<8|(f[n+48>>0]|0);S=e+92|0;t=p[e+4>>2]|0;r=(f[n+42>>0]|0)<<8|(f[n+41>>0]|0)<<16|(f[n+43>>0]|0);i=t+r|0;n=(f[n+45>>0]|0)<<8|(f[n+44>>0]|0)<<16|(f[n+46>>0]|0);if(!n){A=0;b=D;return A|0}p[S>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[A+20>>2]=0;p[A>>2]=0;p[A+4>>2]=0;p[A+8>>2]=0;p[A+12>>2]=0;d[A+16>>0]=0;if(dt(S,A)|0){r=0;i=-3;n=-3;while(1){p[x+(r<<2)>>2]=i;p[P+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=E;r=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));w=e+252|0;r=e+256|0;t=p[r>>2]|0;e:do{if((t|0)==(T|0))s=13;else{if(t>>>0<=T>>>0){do{if((p[e+260>>2]|0)>>>0<T>>>0)if(tt(w,T,(t+1|0)==(T|0),4,0)|0){t=p[r>>2]|0;break}else{d[e+264>>0]=1;t=0;break e}}while(0);Xr((p[w>>2]|0)+(t<<2)|0,0,T-t<<2|0)|0}p[r>>2]=T;s=13}}while(0);do{if((s|0)==13){if(!T){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;t=1;break}i=E+4|0;n=E+8|0;e=E+12|0;o=E+16|0;a=E+20|0;s=E+24|0;l=E+28|0;u=E+32|0;c=E+36|0;h=E+40|0;m=E+44|0;g=E+48|0;v=E+52|0;_=E+56|0;y=E+60|0;C=0;r=p[w>>2]|0;while(1){t=0;do{I=pt(S,A)|0;w=t<<1;O=E+(w<<2)|0;p[O>>2]=(p[O>>2]|0)+(p[x+(I<<2)>>2]|0)&3;w=E+((w|1)<<2)|0;p[w>>2]=(p[w>>2]|0)+(p[P+(I<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8) ;p[r>>2]=(f[1713+(p[i>>2]|0)>>0]|0)<<2|(f[1713+(p[E>>2]|0)>>0]|0)|(f[1713+(p[n>>2]|0)>>0]|0)<<4|(f[1713+(p[e>>2]|0)>>0]|0)<<6|(f[1713+(p[o>>2]|0)>>0]|0)<<8|(f[1713+(p[a>>2]|0)>>0]|0)<<10|(f[1713+(p[s>>2]|0)>>0]|0)<<12|(f[1713+(p[l>>2]|0)>>0]|0)<<14|(f[1713+(p[u>>2]|0)>>0]|0)<<16|(f[1713+(p[c>>2]|0)>>0]|0)<<18|(f[1713+(p[h>>2]|0)>>0]|0)<<20|(f[1713+(p[m>>2]|0)>>0]|0)<<22|(f[1713+(p[g>>2]|0)>>0]|0)<<24|(f[1713+(p[v>>2]|0)>>0]|0)<<26|(f[1713+(p[_>>2]|0)>>0]|0)<<28|(f[1713+(p[y>>2]|0)>>0]|0)<<30;C=C+1|0;if((C|0)==(T|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;lt(A);O=t;b=D;return O|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0;m=b;b=b+560|0;s=m;a=m+40|0;c=m+16|0;n=p[e+88>>2]|0;u=(f[n+55>>0]|0)<<8|(f[n+56>>0]|0);l=e+92|0;t=p[e+4>>2]|0;r=(f[n+50>>0]|0)<<8|(f[n+49>>0]|0)<<16|(f[n+51>>0]|0);i=t+r|0;n=(f[n+53>>0]|0)<<8|(f[n+52>>0]|0)<<16|(f[n+54>>0]|0);if(!n){c=0;b=m;return c|0}p[l>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[c+20>>2]=0;p[c>>2]=0;p[c+4>>2]=0;p[c+8>>2]=0;p[c+12>>2]=0;d[c+16>>0]=0;e:do{if(dt(l,c)|0){o=e+268|0;r=e+272|0;t=p[r>>2]|0;if((t|0)!=(u|0)){if(t>>>0<=u>>>0){do{if((p[e+276>>2]|0)>>>0<u>>>0)if(tt(o,u,(t+1|0)==(u|0),2,0)|0){t=p[r>>2]|0;break}else{d[e+280>>0]=1;t=0;break e}}while(0);Xr((p[o>>2]|0)+(t<<1)|0,0,u-t<<1|0)|0}p[r>>2]=u}if(!u){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yr(a,1084,s)|0;_r(a)|0;t=1;break}r=0;i=0;n=0;t=p[o>>2]|0;while(1){s=pt(l,c)|0;r=s+r&255;i=(pt(l,c)|0)+i&255;h[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(u|0)){t=1;break}else t=t+2|0}}else t=0}while(0);lt(c);c=t;b=m;return c|0}function Dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0;I=b;b=b+2416|0;a=I;o=I+1904|0;D=I+1880|0;P=I+980|0;A=I+80|0;x=I+16|0;n=p[e+88>>2]|0;E=(f[n+63>>0]|0)<<8|(f[n+64>>0]|0);T=e+92|0;t=p[e+4>>2]|0;r=(f[n+58>>0]|0)<<8|(f[n+57>>0]|0)<<16|(f[n+59>>0]|0);i=t+r|0;n=(f[n+61>>0]|0)<<8|(f[n+60>>0]|0)<<16|(f[n+62>>0]|0);if(!n){D=0;b=I;return D|0}p[T>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;if(dt(T,D)|0){r=0;i=-7;n=-7;while(1){p[P+(r<<2)>>2]=i;p[A+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=x;r=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));S=e+284|0;r=E*3|0;i=e+288|0;t=p[i>>2]|0;e:do{if((t|0)==(r|0))s=13;else{if(t>>>0<=r>>>0){do{if((p[e+292>>2]|0)>>>0<r>>>0)if(tt(S,r,(t+1|0)==(r|0),2,0)|0){t=p[i>>2]|0;break}else{d[e+296>>0]=1;t=0;break e}}while(0);Xr((p[S>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}p[i>>2]=r;s=13}}while(0);do{if((s|0)==13){if(!E){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;t=1;break}i=x+4|0;n=x+8|0;e=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;c=x+36|0;m=x+40|0;g=x+44|0;v=x+48|0;_=x+52|0;y=x+56|0;C=x+60|0;w=0;r=p[S>>2]|0;while(1){t=0;do{O=pt(T,D)|0;S=t<<1;M=x+(S<<2)|0;p[M>>2]=(p[M>>2]|0)+(p[P+(O<<2)>>2]|0)&7;S=x+((S|1)<<2)|0;p[S>>2]=(p[S>>2]|0)+(p[A+(O<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);O=f[1717+(p[a>>2]|0)>>0]|0;h[r>>1]=(f[1717+(p[i>>2]|0)>>0]|0)<<3|(f[1717+(p[x>>2]|0)>>0]|0)|(f[1717+(p[n>>2]|0)>>0]|0)<<6|(f[1717+(p[e>>2]|0)>>0]|0)<<9|(f[1717+(p[o>>2]|0)>>0]|0)<<12|O<<15;M=f[1717+(p[m>>2]|0)>>0]|0;h[r+2>>1]=(f[1717+(p[s>>2]|0)>>0]|0)<<2|O>>>1|(f[1717+(p[l>>2]|0)>>0]|0)<<5|(f[1717+(p[u>>2]|0)>>0]|0)<<8|(f[1717+(p[c>>2]|0)>>0]|0)<<11|M<<14;h[r+4>>1]=(f[1717+(p[g>>2]|0)>>0]|0)<<1|M>>>2|(f[1717+(p[v>>2]|0)>>0]|0)<<4|(f[1717+(p[_>>2]|0)>>0]|0)<<7|(f[1717+(p[y>>2]|0)>>0]|0)<<10|(f[1717+(p[C>>2]|0)>>0]|0)<<13;w=w+1|0;if((w|0)==(E|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;lt(D);M=t;b=I;return M|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,le=0;ae=b;b=b+656|0;ne=ae+112|0;re=ae+96|0;te=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;ie=ae+16|0;J=ae;Z=ae+144|0;K=ae+128|0;H=e+240|0;W=p[H>>2]|0;Y=e+256|0;X=p[Y>>2]|0;r=d[(p[e+88>>2]|0)+17>>0]|0;Q=i>>>2;if(!(r<<24>>24)){b=ae;return 1}j=(s|0)==0;q=s+-1|0;k=(o&1|0)!=0;F=i<<1;B=e+92|0;U=e+116|0;V=e+140|0;z=e+236|0;G=a+-1|0;N=(n&1|0)!=0;L=e+188|0;D=e+252|0;I=Q+1|0;O=Q+2|0;M=Q+3|0;R=G<<4;P=r&255;r=0;o=0;n=1;A=0;do{if(!j){E=p[t+(A<<2)>>2]|0;x=0;while(1){w=x&1;l=(w|0)==0;C=(w<<5^32)+-16|0;w=(w<<1^2)+-1|0;T=l?a:-1;u=l?0:G;e=(x|0)==(q|0);S=k&e;if((u|0)!=(T|0)){y=k&e^1;_=l?E:E+R|0;while(1){if((n|0)==1)n=pt(B,U)|0|512;v=n&7;n=n>>>3;l=f[1811+v>>0]|0;e=0;do{m=(pt(B,V)|0)+o|0;g=m-W|0;o=g>>31;o=o&m|g&~o;if((p[H>>2]|0)>>>0<=o>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yr(Z,1084,J)|0;_r(Z)|0}p[K+(e<<2)>>2]=p[(p[z>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<l>>>0);g=N&(u|0)==(G|0);if(S|g){m=0;do{c=ce(m,i)|0;e=_+c|0;l=(m|0)==0|y;h=m<<1;le=(pt(B,L)|0)+r|0;se=le-X|0;r=se>>31;r=r&le|se&~r;do{if(g){if(!l){se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;break}p[e>>2]=p[K+((f[1819+(v<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yr(Z,1084,re)|0;_r(Z)|0}p[_+(c+4)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r}else{if(!l){se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;break}p[e>>2]=p[K+((f[1819+(v<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[te>>2]=1138;p[te+4>>2]=906;p[te+8>>2]=1769;yr(Z,1084,te)|0;_r(Z)|0}p[_+(c+4)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;p[_+(c+8)>>2]=p[K+((f[(h|1)+(1819+(v<<2))>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yr(Z,1084,ne)|0;_r(Z)|0}p[_+(c+12)>>2]=p[(p[D>>2]|0)+(r<<2)>>2]}}while(0);m=m+1|0}while((m|0)!=2)}else{p[_>>2]=p[K+((f[1819+(v<<2)>>0]|0)<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yr(Z,1084,ie)|0;_r(Z)|0}p[_+4>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+8>>2]=p[K+((f[1819+(v<<2)+1>>0]|0)<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yr(Z,1084,oe)|0;_r(Z)|0}p[_+12>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+(Q<<2)>>2]=p[K+((f[1819+(v<<2)+2>>0]|0)<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[$>>2]=1138;p[$+4>>2]=906;p[$+8>>2]=1769;yr(Z,1084,$)|0;_r(Z)|0}p[_+(I<<2)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+(O<<2)>>2]=p[K+((f[1819+(v<<2)+3>>0]|0)<<2)>>2];se=(pt(B,L)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[ee>>2]=1138;p[ee+4>>2]=906;p[ee+8>>2]=1769;yr(Z,1084,ee)|0;_r(Z)|0}p[_+(M<<2)>>2]=p[(p[D>>2]|0)+(r<<2)>>2]}u=u+w|0;if((u|0)==(T|0))break;else _=_+C|0}}x=x+1|0;if((x|0)==(s|0))break;else E=E+F|0}}A=A+1|0}while((A|0)!=(P|0));b=ae;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,de=0,he=0,pe=0;he=b;b=b+608|0;ue=he+48|0;de=he+32|0;ce=he+16|0;le=he;ae=he+96|0;se=he+80|0;oe=he+64|0;W=e+240|0;j=p[W>>2]|0;X=e+256|0;re=p[X>>2]|0;ie=e+272|0;ne=p[ie>>2]|0;r=p[e+88>>2]|0;q=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=he;return 1}Y=(s|0)==0;Q=s+-1|0;Z=i<<1;K=e+92|0;J=e+116|0;$=a+-1|0;ee=e+212|0;te=e+188|0;H=(n&1|0)==0;G=(o&1|0)==0;k=e+288|0;F=e+284|0;B=e+252|0;U=e+140|0;V=e+236|0;z=e+164|0;L=e+268|0;N=$<<5;M=r&255;r=0;n=0;o=0;e=0;l=1;R=0;do{if(!Y){I=p[t+(R<<2)>>2]|0;O=0;while(1){A=O&1;u=(A|0)==0;P=(A<<6^64)+-32|0;A=(A<<1^2)+-1|0;D=u?a:-1;c=u?0:$;if((c|0)!=(D|0)){x=G|(O|0)!=(Q|0);E=u?I:I+N|0;while(1){if((l|0)==1)l=pt(K,J)|0|512;T=l&7;l=l>>>3;h=f[1811+T>>0]|0;u=0;do{w=(pt(K,z)|0)+n|0;S=w-ne|0;n=S>>31;n=n&w|S&~n;if((p[ie>>2]|0)>>>0<=n>>>0){p[le>>2]=1138;p[le+4>>2]=906;p[le+8>>2]=1769;yr(ae,1084,le)|0;_r(ae)|0}p[oe+(u<<2)>>2]=m[(p[L>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{w=(pt(K,U)|0)+e|0;S=w-j|0;e=S>>31;e=e&w|S&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ce>>2]=1138;p[ce+4>>2]=906;p[ce+8>>2]=1769;yr(ae,1084,ce)|0;_r(ae)|0}p[se+(u<<2)>>2]=p[(p[V>>2]|0)+(e<<2)>>2];u=u+1|0}while(u>>>0<h>>>0);S=H|(c|0)!=($|0);C=0;w=E;while(1){y=x|(C|0)==0;_=C<<1;g=0;v=w;while(1){h=(pt(K,ee)|0)+r|0;u=h-q|0;r=u>>31;r=r&h|u&~r;u=(pt(K,te)|0)+o|0;h=u-re|0;o=h>>31;o=o&u|h&~o;if((S|(g|0)==0)&y){u=f[g+_+(1819+(T<<2))>>0]|0;h=r*3|0;if((p[k>>2]|0)>>>0<=h>>>0){p[de>>2]=1138;p[de+4>>2]=906;p[de+8>>2]=1769;yr(ae,1084,de)|0;_r(ae)|0}pe=p[F>>2]|0;p[v>>2]=(m[pe+(h<<1)>>1]|0)<<16|p[oe+(u<<2)>>2];p[v+4>>2]=(m[pe+(h+2<<1)>>1]|0)<<16|(m[pe+(h+1<<1)>>1]|0);p[v+8>>2]=p[se+(u<<2)>>2];if((p[X>>2]|0)>>>0<=o>>>0){p[ue>>2]=1138;p[ue+4>>2]=906;p[ue+8>>2]=1769;yr(ae,1084,ue)|0;_r(ae)|0}p[v+12>>2]=p[(p[B>>2]|0)+(o<<2)>>2]}g=g+1|0;if((g|0)==2)break;else v=v+16|0}C=C+1|0;if((C|0)==2)break;else w=w+i|0}c=c+A|0;if((c|0)==(D|0))break;else E=E+P|0}}O=O+1|0;if((O|0)==(s|0))break;else I=I+Z|0}}R=R+1|0}while((R|0)!=(M|0));b=he;return 1}function Mt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0;$=b;b=b+576|0;J=$+32|0;K=$+16|0;Z=$;Q=$+64|0;X=$+48|0;B=e+272|0;U=p[B>>2]|0;r=p[e+88>>2]|0;V=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=$;return 1}z=(s|0)==0;G=s+-1|0;H=i<<1;W=e+92|0;j=e+116|0;q=a+-1|0;Y=e+212|0;F=(o&1|0)==0;L=e+288|0;N=e+284|0;k=e+164|0;M=e+268|0;R=q<<4;O=r&255;I=(n&1|0)!=0;r=0;o=0;e=1;D=0;do{if(!z){P=p[t+(D<<2)>>2]|0;A=0;while(1){E=A&1;n=(E|0)==0;T=(E<<5^32)+-16|0;E=(E<<1^2)+-1|0;x=n?a:-1;l=n?0:q;if((l|0)!=(x|0)){S=F|(A|0)!=(G|0);w=n?P:P+R|0;while(1){if((e|0)==1)e=pt(W,j)|0|512;C=e&7;e=e>>>3;u=f[1811+C>>0]|0;n=0;do{_=(pt(W,k)|0)+o|0;y=_-U|0;o=y>>31;o=o&_|y&~o;if((p[B>>2]|0)>>>0<=o>>>0){p[Z>>2]=1138;p[Z+4>>2]=906;p[Z+8>>2]=1769;yr(Q,1084,Z)|0;_r(Q)|0}p[X+(n<<2)>>2]=m[(p[M>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<u>>>0);y=(l|0)==(q|0)&I;v=0;_=w;while(1){g=S|(v|0)==0;h=v<<1;n=(pt(W,Y)|0)+r|0;c=n-V|0;u=c>>31;u=u&n|c&~u;if(g){r=f[1819+(C<<2)+h>>0]|0;n=u*3|0;if((p[L>>2]|0)>>>0<=n>>>0){p[K>>2]=1138;p[K+4>>2]=906;p[K+8>>2]=1769;yr(Q,1084,K)|0;_r(Q)|0}c=p[N>>2]|0;p[_>>2]=(m[c+(n<<1)>>1]|0)<<16|p[X+(r<<2)>>2];p[_+4>>2]=(m[c+(n+2<<1)>>1]|0)<<16|(m[c+(n+1<<1)>>1]|0)}c=_+8|0;n=(pt(W,Y)|0)+u|0;u=n-V|0;r=u>>31;r=r&n|u&~r;if(!(y|g^1)){n=f[(h|1)+(1819+(C<<2))>>0]|0;u=r*3|0;if((p[L>>2]|0)>>>0<=u>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yr(Q,1084,J)|0;_r(Q)|0}g=p[N>>2]|0;p[c>>2]=(m[g+(u<<1)>>1]|0)<<16|p[X+(n<<2)>>2];p[_+12>>2]=(m[g+(u+2<<1)>>1]|0)<<16|(m[g+(u+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else _=_+i|0}l=l+E|0;if((l|0)==(x|0))break;else w=w+T|0}}A=A+1|0;if((A|0)==(s|0))break;else P=P+H|0}}D=D+1|0}while((D|0)!=(O|0));b=$;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0;se=b;b=b+608|0;ne=se+48|0;ae=se+32|0;oe=se+16|0;ie=se;re=se+96|0;ee=se+80|0;te=se+64|0;W=e+272|0;j=p[W>>2]|0;r=p[e+88>>2]|0;q=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=se;return 1}Y=(s|0)==0;X=s+-1|0;Q=i<<1;Z=e+92|0;K=e+116|0;J=a+-1|0;$=e+212|0;H=(n&1|0)==0;G=(o&1|0)==0;U=e+288|0;V=e+284|0;z=e+164|0;F=e+268|0;B=J<<5;N=r&255;r=0;n=0;o=0;e=0;l=1;k=0;do{if(!Y){R=p[t+(k<<2)>>2]|0;L=0;while(1){O=L&1;u=(O|0)==0;I=(O<<6^64)+-32|0;O=(O<<1^2)+-1|0;M=u?a:-1;c=u?0:J;if((c|0)!=(M|0)){D=G|(L|0)!=(X|0);A=u?R:R+B|0;while(1){if((l|0)==1)l=pt(Z,K)|0|512;P=l&7;l=l>>>3;h=f[1811+P>>0]|0;u=0;do{E=(pt(Z,z)|0)+e|0;x=E-j|0;e=x>>31;e=e&E|x&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yr(re,1084,ie)|0;_r(re)|0}p[ee+(u<<2)>>2]=m[(p[F>>2]|0)+(e<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{E=(pt(Z,z)|0)+n|0;x=E-j|0;n=x>>31;n=n&E|x&~n;if((p[W>>2]|0)>>>0<=n>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yr(re,1084,oe)|0;_r(re)|0}p[te+(u<<2)>>2]=m[(p[F>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);x=H|(c|0)!=(J|0);T=0;E=A;while(1){S=D|(T|0)==0;w=T<<1;y=0;C=E;while(1){_=(pt(Z,$)|0)+o|0;v=_-q|0;o=v>>31;o=o&_|v&~o;v=(pt(Z,$)|0)+r|0;_=v-q|0;r=_>>31;r=r&v|_&~r;if((x|(y|0)==0)&S){v=f[y+w+(1819+(P<<2))>>0]|0;_=o*3|0;u=p[U>>2]|0;if(u>>>0<=_>>>0){p[ae>>2]=1138;p[ae+4>>2]=906;p[ae+8>>2]=1769;yr(re,1084,ae)|0;_r(re)|0;u=p[U>>2]|0}h=p[V>>2]|0;g=r*3|0;if(u>>>0>g>>>0)u=h;else{p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yr(re,1084,ne)|0;_r(re)|0;u=p[V>>2]|0}p[C>>2]=(m[h+(_<<1)>>1]|0)<<16|p[ee+(v<<2)>>2];p[C+4>>2]=(m[h+(_+2<<1)>>1]|0)<<16|(m[h+(_+1<<1)>>1]|0);p[C+8>>2]=(m[u+(g<<1)>>1]|0)<<16|p[te+(v<<2)>>2];p[C+12>>2]=(m[u+(g+2<<1)>>1]|0)<<16|(m[u+(g+1<<1)>>1]|0)}y=y+1|0;if((y|0)==2)break;else C=C+16|0}T=T+1|0;if((T|0)==2)break;else E=E+i|0}c=c+O|0;if((c|0)==(M|0))break;else A=A+I|0}}L=L+1|0;if((L|0)==(s|0))break;else R=R+Q|0}}k=k+1|0}while((k|0)!=(N|0));b=se;return 1}function Lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+576|0;s=l+48|0;o=l+32|0;n=l+16|0;i=l;a=l+64|0;p[e>>2]=0;t=e+284|0;r=p[t>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1504;yr(a,1084,i)|0;_r(a)|0}p[t>>2]=0;p[e+288>>2]=0;p[e+292>>2]=0}d[e+296>>0]=0;r=e+268|0;t=p[r>>2]|0;if(t){if(!(t&7))ot(t,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(a,1084,n)|0;_r(a)|0}p[r>>2]=0;p[e+272>>2]=0;p[e+276>>2]=0}d[e+280>>0]=0;t=e+252|0;r=p[t>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yr(a,1084,o)|0;_r(a)|0}p[t>>2]=0;p[e+256>>2]=0;p[e+260>>2]=0}d[e+264>>0]=0;t=e+236|0;r=p[t>>2]|0;if(!r){s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);b=l;return}if(!(r&7))ot(r,0,0,1,0)|0;else{p[s>>2]=1138;p[s+4>>2]=2502;p[s+8>>2]=1504;yr(a,1084,s)|0;_r(a)|0}p[t>>2]=0;p[e+240>>2]=0;p[e+244>>2]=0;s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);b=l;return}function Nt(e,t){e=e|0;t=t|0;var r=0;r=b;b=b+16|0;p[r>>2]=t;t=p[60]|0;br(t,e,r)|0;fr(10,t)|0;De()}function kt(){var e=0,t=0;e=b;b=b+16|0;if(!(Ue(192,2)|0)){t=Te(p[47]|0)|0;b=e;return t|0}else Nt(2078,e);return 0}function Ft(e){e=e|0;Vr(e);return}function Bt(e){e=e|0;var t=0;t=b;b=b+16|0;Ai[e&3]();Nt(2127,t)}function Ut(){var e=0,t=0;e=kt()|0;if(((e|0)!=0?(t=p[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(p[e>>2]&-256|0)==1126902528?(p[e+4>>2]|0)==1129074247:0):0)Bt(p[t+12>>2]|0);t=p[26]|0;p[26]=t+0;Bt(t)}function Vt(e){e=e|0;return}function zt(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Wt(e){e=e|0;Ft(e);return}function jt(e){e=e|0;Ft(e);return}function qt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=b;b=b+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Zt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));p[o>>2]=n;p[o+8>>2]=e;p[o+12>>2]=-1;p[o+48>>2]=1;Ii[p[(p[n>>2]|0)+28>>2]&3](n,o,p[r>>2]|0,1);if((p[o+24>>2]|0)==1){p[r>>2]=p[o+16>>2];t=1}else t=0}else t=0;else t=1;b=a;return t|0}function Yt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=p[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;p[i>>2]=(p[i>>2]|0)+1;p[t+24>>2]=2;d[t+54>>0]=1;break}e=t+24|0;if((p[e>>2]|0)==2)p[e>>2]=i}else{p[e>>2]=r;p[t+24>>2]=i;p[t+36>>2]=1}}while(0);return}function Xt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,r,i);return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,r,i);else{e=p[e+8>>2]|0;Ii[p[(p[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,f=0,m=0,g=0;g=b;b=b+64|0;m=g;f=p[e>>2]|0;c=e+(p[f+-8>>2]|0)|0;f=p[f+-4>>2]|0;p[m>>2]=r;p[m+4>>2]=e;p[m+8>>2]=t;p[m+12>>2]=i;i=m+16|0;e=m+20|0;t=m+24|0;n=m+28|0;o=m+32|0;a=m+40|0;s=(f|0)==(r|0);l=i;u=l+36|0;do{p[l>>2]=0;l=l+4|0}while((l|0)<(u|0));h[i+36>>1]=0;d[i+38>>0]=0;e:do{if(s){p[m+48>>2]=1;Di[p[(p[r>>2]|0)+20>>2]&3](r,m,c,c,1,0);i=(p[t>>2]|0)==1?c:0}else{Ti[p[(p[f>>2]|0)+24>>2]&3](f,m,c,1,0);switch(p[m+36>>2]|0){case 0:{i=(p[a>>2]|0)==1&(p[n>>2]|0)==1&(p[o>>2]|0)==1?p[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((p[t>>2]|0)!=1?!((p[a>>2]|0)==0&(p[n>>2]|0)==1&(p[o>>2]|0)==1):0){i=0;break}i=p[i>>2]|0}}while(0);b=g;return i|0}function Kt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;d[t+53>>0]=1;do{if((p[t+4>>2]|0)==(i|0)){d[t+52>>0]=1;i=t+16|0;e=p[i>>2]|0;if(!e){p[i>>2]=r;p[t+24>>2]=n;p[t+36>>2]=1;if(!((n|0)==1?(p[t+48>>2]|0)==1:0))break;d[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;p[n>>2]=(p[n>>2]|0)+1;d[t+54>>0]=1;break}e=t+24|0;i=p[e>>2]|0;if((i|0)==2){p[e>>2]=n;i=n}if((i|0)==1?(p[t+48>>2]|0)==1:0)d[t+54>>0]=1}}while(0);return}function Jt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0;e:do{if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(r|0)?(o=t+28|0,(p[o>>2]|0)!=1):0)p[o>>2]=i}else{if((e|0)!=(p[t>>2]|0)){s=p[e+8>>2]|0;Ti[p[(p[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((p[t+16>>2]|0)!=(r|0)?(a=t+20|0,(p[a>>2]|0)!=(r|0)):0){p[t+32>>2]=i;i=t+44|0;if((p[i>>2]|0)==4)break;o=t+52|0;d[o>>0]=0;l=t+53|0;d[l>>0]=0;e=p[e+8>>2]|0;Di[p[(p[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(d[l>>0]|0){if(!(d[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){p[a>>2]=r;l=t+40|0;p[l>>2]=(p[l>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0){d[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;p[i>>2]=4;break e}}while(0);p[i>>2]=3;break}if((i|0)==1)p[t+32>>2]=1}}while(0);return}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(r|0)?(a=t+28|0,(p[a>>2]|0)!=1):0)p[a>>2]=i}else if((e|0)==(p[t>>2]|0)){if((p[t+16>>2]|0)!=(r|0)?(o=t+20|0,(p[o>>2]|0)!=(r|0)):0){p[t+32>>2]=i;p[o>>2]=r;n=t+40|0;p[n>>2]=(p[n>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0)d[t+54>>0]=1;p[t+44>>2]=4;break}if((i|0)==1)p[t+32>>2]=1}}while(0);return}function er(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Kt(0,t,r,i,n);else{e=p[e+8>>2]|0;Di[p[(p[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function tr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Kt(0,t,r,i,n);return}function rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=b;b=b+16|0;i=n;p[i>>2]=p[r>>2];e=Si[p[(p[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)p[r>>2]=p[i>>2];b=n;return e&1|0}function ir(e){e=e|0;if(!e)e=0;else e=(Zt(e,24,72,0)|0)!=0;return e&1|0}function nr(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=b;b=b+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=kt()|0;if((e|0)!=0?(i=p[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=p[e>>2]|0;e=p[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){p[r>>2]=2406;Nt(2356,r)}if((t|0)==1126902529&(e|0)==1129074247)e=p[i+44>>2]|0;else e=i+80|0;p[n>>2]=e;i=p[i>>2]|0;e=p[i+4>>2]|0;if(Si[p[(p[8>>2]|0)+16>>2]&7](8,i,n)|0){s=p[n>>2]|0;s=xi[p[(p[s>>2]|0)+8>>2]&1](s)|0;p[o>>2]=2406;p[o+4>>2]=e;p[o+8>>2]=s;Nt(2270,o)}else{p[s>>2]=2406;p[s+4>>2]=e;Nt(2315,s)}}Nt(2394,a)}function or(){var e=0;e=b;b=b+16|0;if(!(Le(188,6)|0)){b=e;return}else Nt(2167,e)}function ar(e){e=e|0;var t=0;t=b;b=b+16|0;Vr(e);if(!(Ee(p[47]|0,0)|0)){b=t;return}else Nt(2217,t)}function sr(e){e=e|0;var t=0,r=0;t=0;while(1){if((f[2415+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2503;r=5;break}}if((r|0)==2)if(!t)e=2503;else{e=2503;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(d[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!0)e=248;else{e=(Ae()|0)+60|0;e=p[e>>2]|0}return e|0}function ur(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;p[t>>2]=0-e;e=-1}return e|0}function cr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;_[w>>3]=e;r=p[w>>2]|0;i=p[w+4>>2]|0;n=Qr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0){e=+cr(e*0x10000000000000000,t);r=(p[t>>2]|0)+-64|0}else r=0;p[t>>2]=r;break}case 2047:break;default:{p[t>>2]=n+-1022;p[w>>2]=r;p[w+4>>2]=i&-2146435073|1071644672;e=+_[w>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +cr(e,t)}function hr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){d[e>>0]=t;e=1;break}if(t>>>0<2048){d[e>>0]=t>>>6|192;d[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){d[e>>0]=t>>>12|224;d[e+1>>0]=t>>>6&63|128;d[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){d[e>>0]=t>>>18|240;d[e+1>>0]=t>>>12&63|128;d[e+2>>0]=t>>>6&63|128;d[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;p[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function pr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=hr(e,t,0)|0;return e|0}function fr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((p[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((d[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=p[i>>2]|0,n>>>0<(p[t+16>>2]|0)>>>0):0){p[i>>2]=n+1;d[n>>0]=e;r=e&255}else r=Er(t,e)|0;Tr(t)}else a=3;do{if((a|0)==3){if((d[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=p[o>>2]|0,r>>>0<(p[t+16>>2]|0)>>>0):0){p[o>>2]=r+1;d[r>>0]=e;r=e&255;break}r=Er(t,e)|0}}while(0);return r|0}function mr(e,t){e=e|0;t=t|0;return(vr(e,Mr(e)|0,1,t)|0)+-1|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=p[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=p[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=p[a>>2]|0;if((n-o|0)>>>0<t>>>0){i=Si[p[r+36>>2]&7](r,e,t)|0;break}t:do{if((d[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((d[e+n>>0]|0)==10)break;else i=n}if((Si[p[r+36>>2]&7](r,e,i)|0)>>>0<i>>>0)break e;t=t-i|0;e=e+i|0;n=p[a>>2]|0}else{n=o;i=0}}while(0);Kr(n|0,e|0,t|0)|0;p[a>>2]=(p[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=ce(r,t)|0;if((p[i+76>>2]|0)>-1){o=(Sr(i)|0)==0;e=gr(e,n,i)|0;if(!o)Tr(i)}else e=gr(e,n,i)|0;if((e|0)!=(n|0))r=(e>>>0)/(t>>>0)|0;return r|0}function _r(e){e=e|0;var t=0,r=0,i=0,n=0;i=p[61]|0;if((p[i+76>>2]|0)>-1)n=Sr(i)|0;else n=0;do{if((mr(e,i)|0)<0)t=1;else{if((d[i+75>>0]|0)!=10?(t=i+20|0,r=p[t>>2]|0,r>>>0<(p[i+16>>2]|0)>>>0):0){p[t>>2]=r+1;d[r>>0]=10;t=0;break}t=(Er(i,10)|0)<0}}while(0);if(n)Tr(i);return t<<31>>31|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=b;b=b+16|0;n=i;p[n>>2]=r;r=wr(e,t,n)|0;b=i;return r|0}function br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,f=0,m=0,g=0,v=0;v=b;b=b+224|0;h=v+120|0;g=v+80|0;m=v;f=v+136|0;i=g;n=i+40|0;do{p[i>>2]=0;i=i+4|0}while((i|0)<(n|0));p[h>>2]=p[r>>2];if((Rr(0,t,h,m,g)|0)<0)r=-1;else{if((p[e+76>>2]|0)>-1)u=Sr(e)|0;else u=0;r=p[e>>2]|0;c=r&32;if((d[e+74>>0]|0)<1)p[e>>2]=r&-33;r=e+48|0;if(!(p[r>>2]|0)){n=e+44|0;o=p[n>>2]|0;p[n>>2]=f;a=e+28|0;p[a>>2]=f;s=e+20|0;p[s>>2]=f;p[r>>2]=80;l=e+16|0;p[l>>2]=f+80;i=Rr(e,t,h,m,g)|0;if(o){Si[p[e+36>>2]&7](e,0,0)|0;i=(p[s>>2]|0)==0?-1:i;p[n>>2]=o;p[r>>2]=0;p[l>>2]=0;p[a>>2]=0;p[s>>2]=0}}else i=Rr(e,t,h,m,g)|0;r=p[e>>2]|0;p[e>>2]=r|c;if(u)Tr(e);r=(r&32|0)==0?i:-1}b=v;return r|0}function Cr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0;c=b;b=b+128|0;n=c+112|0;u=c;o=u;a=252;s=o+112|0;do{p[o>>2]=p[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;l=4}else{t=lr()|0;p[t>>2]=75;t=-1}else{n=e;l=4}if((l|0)==4){l=-2-n|0;l=t>>>0>l>>>0?l:t;p[u+48>>2]=l;e=u+20|0;p[e>>2]=n;p[u+44>>2]=n;t=n+l|0;n=u+16|0;p[n>>2]=t;p[u+28>>2]=t;t=br(u,r,i)|0;if(l){r=p[e>>2]|0;d[r+(((r|0)==(p[n>>2]|0))<<31>>31)>>0]=0}}b=c;return t|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;return Cr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Tr(e){e=e|0;return}function Er(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+16|0;s=l;a=t&255;d[s>>0]=a;i=e+16|0;n=p[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=p[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=p[i>>2]|0;if(o>>>0<n>>>0?(r=t&255,(r|0)!=(d[e+75>>0]|0)):0){p[i>>2]=o+1;d[o>>0]=a;break}if((Si[p[e+36>>2]&7](e,s,1)|0)==1)r=f[s>>0]|0;else r=-1}}while(0);b=l;return r|0}function xr(e){e=e|0;var t=0,r=0;t=b;b=b+16|0;r=t;p[r>>2]=p[e+60>>2];e=ur(Oe(6,r|0)|0)|0;b=t;return e|0}function Pr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=b;b=b+32|0;o=n;i=n+20|0;p[o>>2]=p[e+60>>2];p[o+4>>2]=0;p[o+8>>2]=t;p[o+12>>2]=i;p[o+16>>2]=r;if((ur(Be(140,o|0)|0)|0)<0){p[i>>2]=-1;e=-1}else e=p[i>>2]|0;b=n;return e|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;m=b;b=b+48|0;d=m+16|0;c=m;i=m+32|0;h=e+28|0;n=p[h>>2]|0;p[i>>2]=n;f=e+20|0;n=(p[f>>2]|0)-n|0;p[i+4>>2]=n;p[i+8>>2]=t;p[i+12>>2]=r;l=e+60|0;u=e+44|0;t=2;n=n+r|0;while(1){if(!(p[49]|0)){p[d>>2]=p[l>>2];p[d+4>>2]=i;p[d+8>>2]=t;a=ur(Ge(146,d|0)|0)|0}else{Ie(7,e|0);p[c>>2]=p[l>>2];p[c+4>>2]=i;p[c+8>>2]=t;a=ur(Ge(146,c|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=p[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){p[h>>2]=(p[h>>2]|0)+a;s=o;t=2}else s=o;else{s=p[u>>2]|0;p[h>>2]=s;p[f>>2]=s;s=p[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}p[i>>2]=(p[i>>2]|0)+a;p[i+4>>2]=s-a}if((n|0)==6){d=p[u>>2]|0;p[e+16>>2]=d+(p[e+48>>2]|0);e=d;p[h>>2]=e;p[f>>2]=e}else if((n|0)==8){p[e+16>>2]=0;p[h>>2]=0;p[f>>2]=0;p[e>>2]=p[e>>2]|32;if((t|0)==2)r=0;else r=r-(p[i+4>>2]|0)|0}b=m;return r|0}function Dr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=b;b=b+80|0;i=n;p[e+36>>2]=3;if((p[e>>2]&64|0)==0?(p[i>>2]=p[e+60>>2],p[i+4>>2]=21505,p[i+8>>2]=n+12,(Fe(54,i|0)|0)!=0):0)d[e+75>>0]=-1;i=Ar(e,t,r)|0;b=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=d[t>>0]|0;d[t>>0]=r+255|r;t=p[e>>2]|0;if(!(t&8)){p[e+8>>2]=0;p[e+4>>2]=0;t=p[e+44>>2]|0;p[e+28>>2]=t;p[e+20>>2]=t;p[e+16>>2]=t+(p[e+48>>2]|0);t=0}else{p[e>>2]=t|32;t=-1}return t|0}function Or(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((d[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((d[e>>0]|0)!=n<<24>>24){i=ce(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=p[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((d[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Mr(e){e=e|0;var t=0,r=0,i=0;i=e;e:do{if(!(i&3))r=4;else{t=e;e=i;while(1){if(!(d[t>>0]|0))break e;t=t+1|0;e=t;if(!(e&3)){e=t;r=4;break}}}}while(0);if((r|0)==4){while(1){t=p[e>>2]|0;if(!((t&-2139062144^-2139062144)&t+-16843009))e=e+4|0;else break}if((t&255)<<24>>24)do{e=e+1|0}while((d[e>>0]|0)!=0)}return e-i|0}function Rr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,m=0,g=0,v=0,y=0,C=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=b;b=b+624|0;te=ae+24|0;ie=ae+16|0;re=ae+588|0;Z=ae+576|0;ee=ae;Y=ae+536|0;oe=ae+8|0;ne=ae+528|0;F=(e|0)!=0;B=Y+40|0;q=B;Y=Y+39|0;X=oe+4|0;Q=Z+12|0;Z=Z+11|0;K=re;J=Q;$=J-K|0;U=-2-K|0;z=J+2|0;G=te+288|0;H=re+9|0;W=H;j=re+8|0;o=0;C=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;p[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=d[C>>0]|0;if(!(a<<24>>24)){k=245;break}else s=C;t:while(1){switch(a<<24>>24){case 37:{a=s;k=9;break t}case 0:{a=s;break t}default:{}}N=s+1|0;a=d[N>>0]|0;s=N}t:do{if((k|0)==9)while(1){k=0;if((d[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((d[a>>0]|0)==37)k=9;else break}}while(0);T=s-C|0;if(F?(p[e>>2]&32|0)==0:0)gr(C,T,e)|0;if((s|0)!=(C|0)){C=a;a=T;continue}c=a+1|0;s=d[c>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){N=(d[a+2>>0]|0)==36;c=N?a+3|0:c;s=d[c>>0]|0;v=N?l:-1;t=N?1:t}else v=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){l=0;while(1){if(!(1<<a+-32&75913)){m=l;a=c;break t}l=1<<(s<<24>>24)+-32|l;c=c+1|0;s=d[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){m=l;a=c;break}}}else{m=0;a=c}}while(0);do{if(s<<24>>24==42){l=a+1|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+2>>0]|0)==36:0){p[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=p[i+((d[l>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!F){S=m;a=l;t=0;N=0;break}t=(p[r>>2]|0)+(4-1)&~(4-1);s=p[t>>2]|0;p[r>>2]=t+4;t=0;a=l}if((s|0)<0){S=m|8192;N=0-s|0}else{S=m;N=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(d[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break e}else{S=m;N=s}}else{S=m;N=0}}}while(0);t:do{if((d[a>>0]|0)==46){l=a+1|0;s=d[l>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=l;s=0}else{a=l;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(d[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}l=a+2|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+3>>0]|0)==36:0){p[n+(s<<2)>>2]=10;a=a+4|0;c=p[i+((d[l>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(F){a=(p[r>>2]|0)+(4-1)&~(4-1);c=p[a>>2]|0;p[r>>2]=a+4;a=l}else{a=l;c=0}}else c=-1}while(0);g=0;while(1){s=(d[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}l=a+1|0;s=d[5347+(g*58|0)+s>>0]|0;m=s&255;if((m+-1|0)>>>0<8){a=l;g=m}else{L=l;break}}if(!(s<<24>>24)){o=-1;break}l=(v|0)>-1;do{if(s<<24>>24==19)if(l){o=-1;break e}else k=52;else{if(l){p[n+(v<<2)>>2]=m;M=i+(v<<3)|0;R=p[M+4>>2]|0;k=ee;p[k>>2]=p[M>>2];p[k+4>>2]=R;k=52;break}if(!F){o=0;break e}kr(ee,m,r)}}while(0);if((k|0)==52?(k=0,!F):0){C=L;a=T;continue}v=d[a>>0]|0;v=(g|0)!=0&(v&15|0)==3?v&-33:v;l=S&-65537;R=(S&8192|0)==0?S:l;t:do{switch(v|0){case 110:switch(g|0){case 0:{p[p[ee>>2]>>2]=o;C=L;a=T;continue e}case 1:{p[p[ee>>2]>>2]=o;C=L;a=T;continue e}case 2:{C=p[ee>>2]|0;p[C>>2]=o;p[C+4>>2]=((o|0)<0)<<31>>31;C=L;a=T;continue e}case 3:{h[p[ee>>2]>>1]=o;C=L;a=T;continue e}case 4:{d[p[ee>>2]>>0]=o;C=L;a=T;continue e}case 6:{p[p[ee>>2]>>2]=o;C=L;a=T;continue e}case 7:{C=p[ee>>2]|0;p[C>>2]=o;p[C+4>>2]=((o|0)<0)<<31>>31;C=L;a=T;continue e}default:{C=L;a=T;continue e}}case 112:{g=R|8;c=c>>>0>8?c:8;v=120;k=64;break}case 88:case 120:{g=R;k=64;break}case 111:{l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=B;else{a=B;do{a=a+-1|0;d[a>>0]=s&7|48;s=Qr(s|0,l|0,3)|0;l=V}while(!((s|0)==0&(l|0)==0))}if(!(R&8)){s=R;g=0;m=5827;k=77}else{g=q-a+1|0;s=R;c=(c|0)<(g|0)?g:c;g=0;m=5827;k=77}break}case 105:case 100:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;if((s|0)<0){a=qr(0,0,a|0,s|0)|0;s=V;l=ee;p[l>>2]=a;p[l+4>>2]=s;l=1;m=5827;k=76;break t}if(!(R&2048)){m=R&1;l=m;m=(m|0)==0?5827:5829;k=76}else{l=1;m=5828;k=76}break}case 117:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;l=0;m=5827;k=76;break}case 99:{d[Y>>0]=p[ee>>2];C=Y;s=1;g=0;v=5827;a=B;break}case 109:{a=lr()|0;a=sr(p[a>>2]|0)|0;k=82;break}case 115:{a=p[ee>>2]|0;a=(a|0)!=0?a:5837;k=82;break}case 67:{p[oe>>2]=p[ee>>2];p[X>>2]=0;p[ee>>2]=oe;c=-1;k=86;break}case 83:{if(!c){Br(e,32,N,0,R);a=0;k=98}else k=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+_[ee>>3];p[ie>>2]=0;_[w>>3]=u;if((p[w+4>>2]|0)>=0)if(!(R&2048)){M=R&1;O=M;M=(M|0)==0?5845:5850}else{O=1;M=5847}else{u=-u;O=1;M=5844}_[w>>3]=u;I=p[w+4>>2]&2146435072;do{if(I>>>0<2146435072|(I|0)==2146435072&0<0){y=+dr(u,ie)*2;s=y!=0;if(s)p[ie>>2]=(p[ie>>2]|0)+-1;A=v|32;if((A|0)==97){C=v&32;T=(C|0)==0?M:M+9|0;S=O|2;a=12-c|0;do{if(!(c>>>0>11|(a|0)==0)){u=8;do{a=a+-1|0;u=u*16}while((a|0)!=0);if((d[T>>0]|0)==45){u=-(u+(-y-u));break}else{u=y+u-u;break}}else u=y}while(0);s=p[ie>>2]|0;a=(s|0)<0?0-s|0:s;a=Fr(a,((a|0)<0)<<31>>31,Q)|0;if((a|0)==(Q|0)){d[Z>>0]=48;a=Z}d[a+-1>>0]=(s>>31&2)+43;g=a+-2|0;d[g>>0]=v+15;m=(c|0)<1;l=(R&8|0)==0;s=re;while(1){M=~~u;a=s+1|0;d[s>>0]=f[5811+M>>0]|C;u=(u-+(M|0))*16;do{if((a-K|0)==1){if(l&(m&u==0))break;d[a>>0]=46;a=s+2|0}}while(0);if(!(u!=0))break;else s=a}c=(c|0)!=0&(U+a|0)<(c|0)?z+c-g|0:$-g+a|0;l=c+S|0;Br(e,32,N,l,R);if(!(p[e>>2]&32))gr(T,S,e)|0;Br(e,48,N,l,R^65536);a=a-K|0;if(!(p[e>>2]&32))gr(re,a,e)|0;s=J-g|0;Br(e,48,c-(a+s)|0,0,0);if(!(p[e>>2]&32))gr(g,s,e)|0;Br(e,32,N,l,R^8192);a=(l|0)<(N|0)?N:l;break}a=(c|0)<0?6:c;if(s){s=(p[ie>>2]|0)+-28|0;p[ie>>2]=s;u=y*268435456}else{u=y;s=p[ie>>2]|0}I=(s|0)<0?te:G;D=I;s=I;do{P=~~u>>>0;p[s>>2]=P;s=s+4|0;u=(u-+(P>>>0))*1e9}while(u!=0);l=s;s=p[ie>>2]|0;if((s|0)>0){m=I;while(1){g=(s|0)>29?29:s;c=l+-4|0;do{if(c>>>0<m>>>0)c=m;else{s=0;do{P=Zr(p[c>>2]|0,0,g|0)|0;P=Yr(P|0,V|0,s|0,0)|0;s=V;x=oi(P|0,s|0,1e9,0)|0;p[c>>2]=x;s=ni(P|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=m>>>0);if(!s){c=m;break}c=m+-4|0;p[c>>2]=s}}while(0);while(1){if(l>>>0<=c>>>0)break;s=l+-4|0;if(!(p[s>>2]|0))l=s;else break}s=(p[ie>>2]|0)-g|0;p[ie>>2]=s;if((s|0)>0)m=c;else break} }else c=I;if((s|0)<0){T=((a+25|0)/9|0)+1|0;E=(A|0)==102;C=c;while(1){S=0-s|0;S=(S|0)>9?9:S;do{if(C>>>0<l>>>0){s=(1<<S)+-1|0;m=1e9>>>S;c=0;g=C;do{P=p[g>>2]|0;p[g>>2]=(P>>>S)+c;c=ce(P&s,m)|0;g=g+4|0}while(g>>>0<l>>>0);s=(p[C>>2]|0)==0?C+4|0:C;if(!c){c=s;break}p[l>>2]=c;c=s;l=l+4|0}else c=(p[C>>2]|0)==0?C+4|0:C}while(0);s=E?I:c;l=(l-s>>2|0)>(T|0)?s+(T<<2)|0:l;s=(p[ie>>2]|0)+S|0;p[ie>>2]=s;if((s|0)>=0){C=c;break}else C=c}}else C=c;do{if(C>>>0<l>>>0){s=(D-C>>2)*9|0;m=p[C>>2]|0;if(m>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(m>>>0>=c>>>0)}else s=0}while(0);x=(A|0)==103;P=(a|0)!=0;c=a-((A|0)!=102?s:0)+((P&x)<<31>>31)|0;if((c|0)<(((l-D>>2)*9|0)+-9|0)){g=c+9216|0;E=(g|0)/9|0;c=I+(E+-1023<<2)|0;g=((g|0)%9|0)+1|0;if((g|0)<9){m=10;do{m=m*10|0;g=g+1|0}while((g|0)!=9)}else m=10;S=p[c>>2]|0;T=(S>>>0)%(m>>>0)|0;if((T|0)==0?(I+(E+-1022<<2)|0)==(l|0):0)m=C;else k=163;do{if((k|0)==163){k=0;y=(((S>>>0)/(m>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;g=(m|0)/2|0;do{if(T>>>0<g>>>0)u=.5;else{if((T|0)==(g|0)?(I+(E+-1022<<2)|0)==(l|0):0){u=1;break}u=1.5}}while(0);do{if(O){if((d[M>>0]|0)!=45)break;y=-y;u=-u}}while(0);g=S-T|0;p[c>>2]=g;if(!(y+u!=y)){m=C;break}A=g+m|0;p[c>>2]=A;if(A>>>0>999999999){s=C;while(1){m=c+-4|0;p[c>>2]=0;if(m>>>0<s>>>0){s=s+-4|0;p[s>>2]=0}A=(p[m>>2]|0)+1|0;p[m>>2]=A;if(A>>>0>999999999)c=m;else{C=s;c=m;break}}}s=(D-C>>2)*9|0;g=p[C>>2]|0;if(g>>>0<10){m=C;break}else m=10;do{m=m*10|0;s=s+1|0}while(g>>>0>=m>>>0);m=C}}while(0);A=c+4|0;C=m;l=l>>>0>A>>>0?A:l}T=0-s|0;while(1){if(l>>>0<=C>>>0){E=0;A=l;break}c=l+-4|0;if(!(p[c>>2]|0))l=c;else{E=1;A=l;break}}do{if(x){a=(P&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){v=v+-1|0;a=a+-1-s|0}else{v=v+-2|0;a=a+-1|0}l=R&8;if(l)break;do{if(E){l=p[A+-4>>2]|0;if(!l){c=9;break}if(!((l>>>0)%10|0)){m=10;c=0}else{c=0;break}do{m=m*10|0;c=c+1|0}while(((l>>>0)%(m>>>0)|0|0)==0)}else c=9}while(0);l=((A-D>>2)*9|0)+-9|0;if((v|32|0)==102){l=l-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=R&8}while(0);S=a|l;m=(S|0)!=0&1;g=(v|32|0)==102;if(g){s=(s|0)>0?s:0;v=0}else{c=(s|0)<0?T:s;c=Fr(c,((c|0)<0)<<31>>31,Q)|0;if((J-c|0)<2)do{c=c+-1|0;d[c>>0]=48}while((J-c|0)<2);d[c+-1>>0]=(s>>31&2)+43;D=c+-2|0;d[D>>0]=v;s=J-D|0;v=D}T=O+1+a+m+s|0;Br(e,32,N,T,R);if(!(p[e>>2]&32))gr(M,O,e)|0;Br(e,48,N,T,R^65536);do{if(g){c=C>>>0>I>>>0?I:C;s=c;do{l=Fr(p[s>>2]|0,0,H)|0;do{if((s|0)==(c|0)){if((l|0)!=(H|0))break;d[j>>0]=48;l=j}else{if(l>>>0<=re>>>0)break;do{l=l+-1|0;d[l>>0]=48}while(l>>>0>re>>>0)}}while(0);if(!(p[e>>2]&32))gr(l,W-l|0,e)|0;s=s+4|0}while(s>>>0<=I>>>0);do{if(S){if(p[e>>2]&32)break;gr(5879,1,e)|0}}while(0);if((a|0)>0&s>>>0<A>>>0){l=s;while(1){s=Fr(p[l>>2]|0,0,H)|0;if(s>>>0>re>>>0)do{s=s+-1|0;d[s>>0]=48}while(s>>>0>re>>>0);if(!(p[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0<A>>>0)){a=s;break}else a=s}}Br(e,48,a+9|0,9,0)}else{g=E?A:C+4|0;if((a|0)>-1){m=(l|0)==0;c=C;do{s=Fr(p[c>>2]|0,0,H)|0;if((s|0)==(H|0)){d[j>>0]=48;s=j}do{if((c|0)==(C|0)){l=s+1|0;if(!(p[e>>2]&32))gr(s,1,e)|0;if(m&(a|0)<1){s=l;break}if(p[e>>2]&32){s=l;break}gr(5879,1,e)|0;s=l}else{if(s>>>0<=re>>>0)break;do{s=s+-1|0;d[s>>0]=48}while(s>>>0>re>>>0)}}while(0);l=W-s|0;if(!(p[e>>2]&32))gr(s,(a|0)>(l|0)?l:a,e)|0;a=a-l|0;c=c+4|0}while(c>>>0<g>>>0&(a|0)>-1)}Br(e,48,a+18|0,18,0);if(p[e>>2]&32)break;gr(v,J-v|0,e)|0}}while(0);Br(e,32,N,T,R^8192);a=(T|0)<(N|0)?N:T}else{g=(v&32|0)!=0;m=u!=u|0!=0;s=m?0:O;c=s+3|0;Br(e,32,N,c,l);a=p[e>>2]|0;if(!(a&32)){gr(M,s,e)|0;a=p[e>>2]|0}if(!(a&32))gr(m?g?5871:5875:g?5863:5867,3,e)|0;Br(e,32,N,c,R^8192);a=(c|0)<(N|0)?N:c}}while(0);C=L;continue e}default:{l=R;s=c;g=0;v=5827;a=B}}}while(0);t:do{if((k|0)==64){l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;m=v&32;if(!((s|0)==0&(l|0)==0)){a=B;do{a=a+-1|0;d[a>>0]=f[5811+(s&15)>>0]|m;s=Qr(s|0,l|0,4)|0;l=V}while(!((s|0)==0&(l|0)==0));k=ee;if((g&8|0)==0|(p[k>>2]|0)==0&(p[k+4>>2]|0)==0){s=g;g=0;m=5827;k=77}else{s=g;g=2;m=5827+(v>>4)|0;k=77}}else{a=B;s=g;g=0;m=5827;k=77}}else if((k|0)==76){a=Fr(a,s,B)|0;s=R;g=l;k=77}else if((k|0)==82){k=0;R=Or(a,0,c)|0;M=(R|0)==0;C=a;s=M?c:R-a|0;g=0;v=5827;a=M?a+c|0:R}else if((k|0)==86){k=0;s=0;a=0;m=p[ee>>2]|0;while(1){l=p[m>>2]|0;if(!l)break;a=pr(ne,l)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)m=m+4|0;else break}if((a|0)<0){o=-1;break e}Br(e,32,N,s,R);if(!s){a=0;k=98}else{l=0;c=p[ee>>2]|0;while(1){a=p[c>>2]|0;if(!a){a=s;k=98;break t}a=pr(ne,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;k=98;break t}if(!(p[e>>2]&32))gr(ne,a,e)|0;if(l>>>0>=s>>>0){a=s;k=98;break}else c=c+4|0}}}}while(0);if((k|0)==98){k=0;Br(e,32,N,a,R^8192);C=L;a=(N|0)>(a|0)?N:a;continue}if((k|0)==77){k=0;l=(c|0)>-1?s&-65537:s;s=ee;s=(p[s>>2]|0)!=0|(p[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(q-a)|0;C=a;s=(c|0)>(s|0)?c:s;v=m;a=B}else{C=B;s=0;v=m;a=B}}m=a-C|0;s=(s|0)<(m|0)?m:s;c=g+s|0;a=(N|0)<(c|0)?c:N;Br(e,32,a,c,l);if(!(p[e>>2]&32))gr(v,g,e)|0;Br(e,48,a,c,l^65536);Br(e,48,s,m,0);if(!(p[e>>2]&32))gr(C,m,e)|0;Br(e,32,a,c,l^8192);C=L}e:do{if((k|0)==245)if(!e)if(t){o=1;while(1){t=p[n+(o<<2)>>2]|0;if(!t)break;kr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(p[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);b=ae;return o|0}function Lr(e){e=e|0;if(!(p[e+68>>2]|0))Tr(e);return}function Nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=p[i>>2]|0;e=(p[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Kr(n|0,t|0,e|0)|0;p[i>>2]=(p[i>>2]|0)+e;return r|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;p[e>>2]=t;break e}case 10:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;i=e;p[i>>2]=t;p[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;i=e;p[i>>2]=t;p[i+4>>2]=0;break e}case 12:{i=(p[r>>2]|0)+(8-1)&~(8-1);t=i;n=p[t>>2]|0;t=p[t+4>>2]|0;p[r>>2]=i+8;i=e;p[i>>2]=n;p[i+4>>2]=t;break e}case 13:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;p[n>>2]=i;p[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;n=e;p[n>>2]=i&65535;p[n+4>>2]=0;break e}case 15:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;i=(i&255)<<24>>24;n=e;p[n>>2]=i;p[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;n=e;p[n>>2]=i&255;p[n+4>>2]=0;break e}case 17:{n=(p[r>>2]|0)+(8-1)&~(8-1);o=+_[n>>3];p[r>>2]=n+8;_[e>>3]=o;break e}case 18:{n=(p[r>>2]|0)+(8-1)&~(8-1);o=+_[n>>3];p[r>>2]=n+8;_[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=oi(e|0,t|0,10,0)|0;r=r+-1|0;d[r>>0]=i|48;i=ni(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=V}else{e=i;break}}if(e)while(1){r=r+-1|0;d[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Br(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=b;b=b+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Xr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=p[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=p[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}}while(0);b=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0,b=0,C=0,w=0,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0;do{if(e>>>0<245){f=e>>>0<11?16:e+11&-8;e=f>>>3;s=p[147]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=628+(i<<2)|0;i=628+(i+2<<2)|0;n=p[i>>2]|0;o=n+8|0;a=p[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(p[151]|0)>>>0)De();t=a+12|0;if((p[t>>2]|0)==(n|0)){p[t>>2]=r;p[i>>2]=a;break}else De()}else p[147]=s&~(1<<e)}while(0);B=e<<3;p[n+4>>2]=B|3;B=n+(B|4)|0;p[B>>2]=p[B>>2]|1;B=o;return B|0}a=p[149]|0;if(f>>>0>a>>>0){if(r){i=2<<e;i=r<<e&(i|0-i);i=(i&0-i)+-1|0;l=i>>>12&16;i=i>>>l;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|l|o|r|e)+(i>>>e)|0;i=e<<1;r=628+(i<<2)|0;i=628+(i+2<<2)|0;o=p[i>>2]|0;l=o+8|0;n=p[l>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(p[151]|0)>>>0)De();t=n+12|0;if((p[t>>2]|0)==(o|0)){p[t>>2]=r;p[i>>2]=n;u=p[149]|0;break}else De()}else{p[147]=s&~(1<<e);u=a}}while(0);B=e<<3;a=B-f|0;p[o+4>>2]=f|3;s=o+f|0;p[o+(f|4)>>2]=a|1;p[o+B>>2]=a;if(u){n=p[152]|0;r=u>>>3;t=r<<1;i=628+(t<<2)|0;e=p[147]|0;r=1<<r;if(e&r){e=628+(t+2<<2)|0;t=p[e>>2]|0;if(t>>>0<(p[151]|0)>>>0)De();else{c=e;d=t}}else{p[147]=e|r;c=628+(t+2<<2)|0;d=i}p[c>>2]=n;p[d+12>>2]=n;p[n+8>>2]=d;p[n+12>>2]=i}p[149]=a;p[152]=s;B=l;return B|0}e=p[148]|0;if(e){r=(e&0-e)+-1|0;F=r>>>12&16;r=r>>>F;k=r>>>5&8;r=r>>>k;B=r>>>2&4;r=r>>>B;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=p[892+((k|F|B|e|i)+(r>>>i)<<2)>>2]|0;r=(p[i+4>>2]&-8)-f|0;e=i;while(1){t=p[e+16>>2]|0;if(!t){t=p[e+20>>2]|0;if(!t){l=r;break}}e=(p[t+4>>2]&-8)-f|0;B=e>>>0<r>>>0;r=B?e:r;e=t;i=B?t:i}o=p[151]|0;if(i>>>0<o>>>0)De();s=i+f|0;if(i>>>0>=s>>>0)De();a=p[i+24>>2]|0;r=p[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=p[e>>2]|0;if(!t){e=i+16|0;t=p[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0<o>>>0)De();else{p[e>>2]=0;h=t;break}}else{n=p[i+8>>2]|0;if(n>>>0<o>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(i|0))De();e=r+8|0;if((p[e>>2]|0)==(i|0)){p[t>>2]=r;p[e>>2]=n;h=r;break}else De()}}while(0);do{if(a){t=p[i+28>>2]|0;e=892+(t<<2)|0;if((i|0)==(p[e>>2]|0)){p[e>>2]=h;if(!h){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(i|0))p[t>>2]=h;else p[a+20>>2]=h;if(!h)break}e=p[151]|0;if(h>>>0<e>>>0)De();p[h+24>>2]=a;t=p[i+16>>2]|0;do{if(t)if(t>>>0<e>>>0)De();else{p[h+16>>2]=t;p[t+24>>2]=h;break}}while(0);t=p[i+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[h+20>>2]=t;p[t+24>>2]=h;break}}}while(0);if(l>>>0<16){B=l+f|0;p[i+4>>2]=B|3;B=i+(B+4)|0;p[B>>2]=p[B>>2]|1}else{p[i+4>>2]=f|3;p[i+(f|4)>>2]=l|1;p[i+(l+f)>>2]=l;t=p[149]|0;if(t){o=p[152]|0;r=t>>>3;t=r<<1;n=628+(t<<2)|0;e=p[147]|0;r=1<<r;if(e&r){t=628+(t+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{m=t;g=e}}else{p[147]=e|r;m=628+(t+2<<2)|0;g=n}p[m>>2]=o;p[g+12>>2]=o;p[o+8>>2]=g;p[o+12>>2]=n}p[149]=l;p[152]=s}B=i+8|0;return B|0}else g=f}else g=f}else if(e>>>0<=4294967231){e=e+11|0;d=e&-8;c=p[148]|0;if(c){r=0-d|0;e=e>>>8;if(e)if(d>>>0>16777215)u=31;else{g=(e+1048320|0)>>>16&8;C=e<<g;m=(C+520192|0)>>>16&4;C=C<<m;u=(C+245760|0)>>>16&2;u=14-(m|g|u)+(C<<u>>>15)|0;u=d>>>(u+7|0)&1|u<<1}else u=0;e=p[892+(u<<2)>>2]|0;e:do{if(!e){n=0;e=0;C=86}else{a=r;n=0;s=d<<((u|0)==31?0:25-(u>>>1)|0);l=e;e=0;while(1){o=p[l+4>>2]&-8;r=o-d|0;if(r>>>0<a>>>0)if((o|0)==(d|0)){o=l;e=l;C=90;break e}else e=l;else r=a;C=p[l+20>>2]|0;l=p[l+16+(s>>>31<<2)>>2]|0;n=(C|0)==0|(C|0)==(l|0)?n:C;if(!l){C=86;break}else{a=r;s=s<<1}}}}while(0);if((C|0)==86){if((n|0)==0&(e|0)==0){e=2<<u;e=c&(e|0-e);if(!e){g=d;break}e=(e&0-e)+-1|0;h=e>>>12&16;e=e>>>h;c=e>>>5&8;e=e>>>c;m=e>>>2&4;e=e>>>m;g=e>>>1&2;e=e>>>g;n=e>>>1&1;n=p[892+((c|h|m|g|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;l=e}else{o=n;C=90}}if((C|0)==90)while(1){C=0;g=(p[o+4>>2]&-8)-d|0;n=g>>>0<r>>>0;r=n?g:r;e=n?o:e;n=p[o+16>>2]|0;if(n){o=n;C=90;continue}o=p[o+20>>2]|0;if(!o){s=r;l=e;break}else C=90}if((l|0)!=0?s>>>0<((p[149]|0)-d|0)>>>0:0){n=p[151]|0;if(l>>>0<n>>>0)De();a=l+d|0;if(l>>>0>=a>>>0)De();o=p[l+24>>2]|0;r=p[l+12>>2]|0;do{if((r|0)==(l|0)){e=l+20|0;t=p[e>>2]|0;if(!t){e=l+16|0;t=p[e>>2]|0;if(!t){f=0;break}}while(1){r=t+20|0;i=p[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=p[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0<n>>>0)De();else{p[e>>2]=0;f=t;break}}else{i=p[l+8>>2]|0;if(i>>>0<n>>>0)De();t=i+12|0;if((p[t>>2]|0)!=(l|0))De();e=r+8|0;if((p[e>>2]|0)==(l|0)){p[t>>2]=r;p[e>>2]=i;f=r;break}else De()}}while(0);do{if(o){t=p[l+28>>2]|0;e=892+(t<<2)|0;if((l|0)==(p[e>>2]|0)){p[e>>2]=f;if(!f){p[148]=p[148]&~(1<<t);break}}else{if(o>>>0<(p[151]|0)>>>0)De();t=o+16|0;if((p[t>>2]|0)==(l|0))p[t>>2]=f;else p[o+20>>2]=f;if(!f)break}e=p[151]|0;if(f>>>0<e>>>0)De();p[f+24>>2]=o;t=p[l+16>>2]|0;do{if(t)if(t>>>0<e>>>0)De();else{p[f+16>>2]=t;p[t+24>>2]=f;break}}while(0);t=p[l+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[f+20>>2]=t;p[t+24>>2]=f;break}}}while(0);e:do{if(s>>>0>=16){p[l+4>>2]=d|3;p[l+(d|4)>>2]=s|1;p[l+(s+d)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{_=t;y=e}}else{p[147]=r|t;_=628+(e+2<<2)|0;y=i}p[_>>2]=a;p[y+12>>2]=a;p[l+(d+8)>>2]=y;p[l+(d+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;B=t<<F;k=(B+520192|0)>>>16&4;B=B<<k;i=(B+245760|0)>>>16&2;i=14-(k|F|i)+(B<<i>>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=892+(i<<2)|0;p[l+(d+28)>>2]=i;p[l+(d+20)>>2]=0;p[l+(d+16)>>2]=0;e=p[148]|0;r=1<<i;if(!(e&r)){p[148]=e|r;p[t>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break}t=p[t>>2]|0;t:do{if((p[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=p[t>>2]|0;B=p[151]|0;if(e>>>0>=B>>>0&T>>>0>=B>>>0){p[e+12>>2]=a;p[t>>2]=a;p[l+(d+8)>>2]=e;p[l+(d+12)>>2]=T;p[l+(d+24)>>2]=0;break}else De()}else{B=s+d|0;p[l+4>>2]=B|3;B=l+(B+4)|0;p[B>>2]=p[B>>2]|1}}while(0);B=l+8|0;return B|0}else g=d}else g=d}else g=-1}while(0);r=p[149]|0;if(r>>>0>=g>>>0){t=r-g|0;e=p[152]|0;if(t>>>0>15){p[152]=e+g;p[149]=t;p[e+(g+4)>>2]=t|1;p[e+r>>2]=t;p[e+4>>2]=g|3}else{p[149]=0;p[152]=0;p[e+4>>2]=r|3;B=e+(r+4)|0;p[B>>2]=p[B>>2]|1}B=e+8|0;return B|0}e=p[150]|0;if(e>>>0>g>>>0){F=e-g|0;p[150]=F;B=p[153]|0;p[153]=B+g;p[B+(g+4)>>2]=F|1;p[B+4>>2]=g|3;B=B+8|0;return B|0}do{if(!(p[265]|0)){e=ze(30)|0;if(!(e+-1&e)){p[267]=e;p[266]=e;p[268]=-1;p[269]=-1;p[270]=0;p[258]=0;T=(Re(0)|0)&-16^1431655768;p[265]=T;break}else De()}}while(0);l=g+48|0;s=p[267]|0;u=g+47|0;a=s+u|0;s=0-s|0;c=a&s;if(c>>>0<=g>>>0){B=0;return B|0}e=p[257]|0;if((e|0)!=0?(y=p[255]|0,T=y+c|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){B=0;return B|0}e:do{if(!(p[258]&4)){e=p[153]|0;t:do{if(e){n=1036;while(1){r=p[n>>2]|0;if(r>>>0<=e>>>0?(v=n+4|0,(r+(p[v>>2]|0)|0)>>>0>e>>>0):0){o=n;e=v;break}n=p[n+8>>2]|0;if(!n){C=174;break t}}r=a-(p[150]|0)&s;if(r>>>0<2147483647){n=Me(r|0)|0;T=(n|0)==((p[o>>2]|0)+(p[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;m=e;C=194;break e}}else C=184}else e=0}else C=174}while(0);do{if((C|0)==174){o=Me(0)|0;if((o|0)!=(-1|0)){e=o;r=p[266]|0;n=r+-1|0;if(!(n&e))r=c;else r=c-e+(n+e&0-r)|0;e=p[255]|0;n=e+r|0;if(r>>>0>g>>>0&r>>>0<2147483647){T=p[257]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Me(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;m=e;C=194;break e}else C=184}else e=0}else e=0}}while(0);t:do{if((C|0)==184){o=0-r|0;do{if(l>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(b=p[267]|0,b=u-r+b&0-b,b>>>0<2147483647):0)if((Me(b|0)|0)==(-1|0)){Me(o|0)|0;break t}else{r=b+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;m=r;C=194;break e}}}while(0);p[258]=p[258]|4;C=191}else{e=0;C=191}}while(0);if((((C|0)==191?c>>>0<2147483647:0)?(w=Me(c|0)|0,S=Me(0)|0,w>>>0<S>>>0&((w|0)!=(-1|0)&(S|0)!=(-1|0))):0)?(E=S-w|0,x=E>>>0>(g+40|0)>>>0,x):0){m=x?E:e;C=194}if((C|0)==194){e=(p[255]|0)+m|0;p[255]=e;if(e>>>0>(p[256]|0)>>>0)p[256]=e;a=p[153]|0;e:do{if(a){o=1036;do{e=p[o>>2]|0;r=o+4|0;n=p[r>>2]|0;if((w|0)==(e+n|0)){P=e;A=r;D=n;I=o;C=204;break}o=p[o+8>>2]|0}while((o|0)!=0);if(((C|0)==204?(p[I+12>>2]&8|0)==0:0)?a>>>0<w>>>0&a>>>0>=P>>>0:0){p[A>>2]=D+m;B=(p[150]|0)+m|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;k=B-F|0;p[153]=a+F;p[150]=k;p[a+(F+4)>>2]=k|1;p[a+(B+4)>>2]=40;p[154]=p[269];break}e=p[151]|0;if(w>>>0<e>>>0){p[151]=w;e=w}r=w+m|0;o=1036;while(1){if((p[o>>2]|0)==(r|0)){n=o;r=o;C=212;break}o=p[o+8>>2]|0;if(!o){r=1036;break}}if((C|0)==212)if(!(p[r+12>>2]&8)){p[n>>2]=w;h=r+4|0;p[h>>2]=(p[h>>2]|0)+m;h=w+8|0;h=(h&7|0)==0?0:0-h&7;u=w+(m+8)|0;u=(u&7|0)==0?0:0-u&7;t=w+(u+m)|0;d=h+g|0;f=w+d|0;c=t-(w+h)-g|0;p[w+(h+4)>>2]=g|3;t:do{if((t|0)!=(a|0)){if((t|0)==(p[152]|0)){B=(p[149]|0)+c|0;p[149]=B;p[152]=f;p[w+(d+4)>>2]=B|1;p[w+(B+d)>>2]=B;break}s=m+4|0;r=p[w+(s+u)>>2]|0;if((r&3|0)==1){l=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=p[w+((u|24)+m)>>2]|0;i=p[w+(m+12+u)>>2]|0;do{if((i|0)==(t|0)){n=u|16;i=w+(s+n)|0;r=p[i>>2]|0;if(!r){i=w+(n+m)|0;r=p[i>>2]|0;if(!r){N=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<e>>>0)De();else{p[i>>2]=0;N=r;break}}else{n=p[w+((u|8)+m)>>2]|0;if(n>>>0<e>>>0)De();e=n+12|0;if((p[e>>2]|0)!=(t|0))De();r=i+8|0;if((p[r>>2]|0)==(t|0)){p[e>>2]=i;p[r>>2]=n;N=i;break}else De()}}while(0);if(!a)break;e=p[w+(m+28+u)>>2]|0;r=892+(e<<2)|0;do{if((t|0)!=(p[r>>2]|0)){if(a>>>0<(p[151]|0)>>>0)De();e=a+16|0;if((p[e>>2]|0)==(t|0))p[e>>2]=N;else p[a+20>>2]=N;if(!N)break r}else{p[r>>2]=N;if(N)break;p[148]=p[148]&~(1<<e);break r}}while(0);r=p[151]|0;if(N>>>0<r>>>0)De();p[N+24>>2]=a;t=u|16;e=p[w+(t+m)>>2]|0;do{if(e)if(e>>>0<r>>>0)De();else{p[N+16>>2]=e;p[e+24>>2]=N;break}}while(0);t=p[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(p[151]|0)>>>0)De();else{p[N+20>>2]=t;p[t+24>>2]=N;break}}else{i=p[w+((u|8)+m)>>2]|0;n=p[w+(m+12+u)>>2]|0;r=628+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0<e>>>0)De();if((p[i+12>>2]|0)==(t|0))break;De()}}while(0);if((n|0)==(i|0)){p[147]=p[147]&~(1<<o);break}do{if((n|0)==(r|0))O=n+8|0;else{if(n>>>0<e>>>0)De();e=n+8|0;if((p[e>>2]|0)==(t|0)){O=e;break}De()}}while(0);p[i+12>>2]=n;p[O>>2]=i}}while(0);t=w+((l|u)+m)|0;n=l+c|0}else n=c;t=t+4|0;p[t>>2]=p[t>>2]&-2;p[w+(d+4)>>2]=n|1;p[w+(n+d)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;do{if(!(r&t)){p[147]=r|t;k=628+(e+2<<2)|0;F=i}else{t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0>=(p[151]|0)>>>0){k=t;F=e;break}De()}}while(0);p[k>>2]=f;p[F+12>>2]=f;p[w+(d+8)>>2]=F;p[w+(d+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}k=(t+1048320|0)>>>16&8;F=t<<k;N=(F+520192|0)>>>16&4;F=F<<N;i=(F+245760|0)>>>16&2;i=14-(N|k|i)+(F<<i>>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=892+(i<<2)|0;p[w+(d+28)>>2]=i;p[w+(d+20)>>2]=0;p[w+(d+16)>>2]=0;e=p[148]|0;r=1<<i;if(!(e&r)){p[148]=e|r;p[t>>2]=f;p[w+(d+24)>>2]=t;p[w+(d+12)>>2]=f;p[w+(d+8)>>2]=f;break}t=p[t>>2]|0;r:do{if((p[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(n|0)){B=r;break r}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=f;p[w+(d+24)>>2]=t;p[w+(d+12)>>2]=f;p[w+(d+8)>>2]=f;break t}}else B=t}while(0);t=B+8|0;e=p[t>>2]|0;F=p[151]|0;if(e>>>0>=F>>>0&B>>>0>=F>>>0){p[e+12>>2]=f;p[t>>2]=f;p[w+(d+8)>>2]=e;p[w+(d+12)>>2]=B;p[w+(d+24)>>2]=0;break}else De()}else{B=(p[150]|0)+c|0;p[150]=B;p[153]=f;p[w+(d+4)>>2]=B|1}}while(0);B=w+(h|8)|0;return B|0}else r=1036;while(1){e=p[r>>2]|0;if(e>>>0<=a>>>0?(t=p[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=p[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;B=m+-40-r|0;p[153]=w+r;p[150]=B;p[w+(r+4)>>2]=B|1;p[w+(m+-36)>>2]=40;p[154]=p[269];r=e+4|0;p[r>>2]=27;p[t>>2]=p[259];p[t+4>>2]=p[260];p[t+8>>2]=p[261];p[t+12>>2]=p[262];p[259]=w;p[260]=m;p[262]=0;p[261]=t;t=e+28|0;p[t>>2]=7;if((e+32|0)>>>0<i>>>0)do{B=t;t=t+4|0;p[t>>2]=7}while((B+8|0)>>>0<i>>>0);if((e|0)!=(a|0)){o=e-a|0;p[r>>2]=p[r>>2]&-2;p[a+4>>2]=o|1;p[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{M=t;R=e}}else{p[147]=r|t;M=628+(e+2<<2)|0;R=i}p[M>>2]=a;p[R+12>>2]=a;p[a+8>>2]=R;p[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;B=t<<F;k=(B+520192|0)>>>16&4;B=B<<k;i=(B+245760|0)>>>16&2;i=14-(k|F|i)+(B<<i>>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=892+(i<<2)|0;p[a+28>>2]=i;p[a+20>>2]=0;p[n>>2]=0;t=p[148]|0;e=1<<i;if(!(t&e)){p[148]=t|e;p[r>>2]=a;p[a+24>>2]=r;p[a+12>>2]=a;p[a+8>>2]=a;break}t=p[r>>2]|0;t:do{if((p[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(o|0)){L=r;break t}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[a+24>>2]=t;p[a+12>>2]=a;p[a+8>>2]=a;break e}}else L=t}while(0);t=L+8|0;e=p[t>>2]|0;B=p[151]|0;if(e>>>0>=B>>>0&L>>>0>=B>>>0){p[e+12>>2]=a;p[t>>2]=a;p[a+8>>2]=e;p[a+12>>2]=L;p[a+24>>2]=0;break}else De()}}else{B=p[151]|0;if((B|0)==0|w>>>0<B>>>0)p[151]=w;p[259]=w;p[260]=m;p[262]=0;p[156]=p[265];p[155]=-1;t=0;do{B=t<<1;F=628+(B<<2)|0;p[628+(B+3<<2)>>2]=F;p[628+(B+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);B=w+8|0;B=(B&7|0)==0?0:0-B&7;F=m+-40-B|0;p[153]=w+B;p[150]=F;p[w+(B+4)>>2]=F|1;p[w+(m+-36)>>2]=40;p[154]=p[269]}}while(0);t=p[150]|0;if(t>>>0>g>>>0){F=t-g|0;p[150]=F;B=p[153]|0;p[153]=B+g;p[B+(g+4)>>2]=F|1;p[B+4>>2]=g|3;B=B+8|0;return B|0}}B=lr()|0;p[B>>2]=12;B=0;return B|0}function Vr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0,b=0;if(!e)return;t=e+-8|0;s=p[151]|0;if(t>>>0<s>>>0)De();r=p[e+-4>>2]|0;i=r&3;if((i|0)==1)De();f=r&-8;g=e+(f+-8)|0;do{if(!(r&1)){t=p[t>>2]|0;if(!i)return;l=-8-t|0;c=e+l|0;d=t+f|0;if(c>>>0<s>>>0)De();if((c|0)==(p[152]|0)){t=e+(f+-4)|0;r=p[t>>2]|0;if((r&3|0)!=3){b=c;o=d;break}p[149]=d;p[t>>2]=r&-2;p[e+(l+4)>>2]=d|1;p[g>>2]=d;return}n=t>>>3;if(t>>>0<256){i=p[e+(l+8)>>2]|0;r=p[e+(l+12)>>2]|0;t=628+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<s>>>0)De();if((p[i+12>>2]|0)!=(c|0))De()}if((r|0)==(i|0)){p[147]=p[147]&~(1<<n);b=c;o=d;break}if((r|0)!=(t|0)){if(r>>>0<s>>>0)De();t=r+8|0;if((p[t>>2]|0)==(c|0))a=t;else De()}else a=r+8|0;p[i+12>>2]=r;p[a>>2]=i;b=c;o=d;break}a=p[e+(l+24)>>2]|0;i=p[e+(l+12)>>2]|0;do{if((i|0)==(c|0)){r=e+(l+20)|0;t=p[r>>2]|0;if(!t){r=e+(l+16)|0;t=p[r>>2]|0;if(!t){u=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<s>>>0)De();else{p[r>>2]=0;u=t;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(c|0))De();r=i+8|0;if((p[r>>2]|0)==(c|0)){p[t>>2]=i;p[r>>2]=n;u=i;break}else De()}}while(0);if(a){t=p[e+(l+28)>>2]|0;r=892+(t<<2)|0;if((c|0)==(p[r>>2]|0)){p[r>>2]=u;if(!u){p[148]=p[148]&~(1<<t);b=c;o=d;break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(c|0))p[t>>2]=u;else p[a+20>>2]=u;if(!u){b=c;o=d;break}}r=p[151]|0;if(u>>>0<r>>>0)De();p[u+24>>2]=a;t=p[e+(l+16)>>2]|0;do{if(t)if(t>>>0<r>>>0)De();else{p[u+16>>2]=t;p[t+24>>2]=u;break}}while(0);t=p[e+(l+20)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=t;p[t+24>>2]=u;b=c;o=d;break}else{b=c;o=d}}else{b=c;o=d}}else{b=t;o=f}}while(0);if(b>>>0>=g>>>0)De();t=e+(f+-4)|0;r=p[t>>2]|0;if(!(r&1))De();if(!(r&2)){if((g|0)==(p[153]|0)){y=(p[150]|0)+o|0;p[150]=y;p[153]=b;p[b+4>>2]=y|1;if((b|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((g|0)==(p[152]|0)){y=(p[149]|0)+o|0;p[149]=y;p[152]=b;p[b+4>>2]=y|1;p[b+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=p[e+(f+16)>>2]|0;t=p[e+(f|4)>>2]|0;do{if((t|0)==(g|0)){r=e+(f+12)|0;t=p[r>>2]|0;if(!t){r=e+(f+8)|0;t=p[r>>2]|0;if(!t){m=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(p[151]|0)>>>0)De();else{p[r>>2]=0;m=t;break}}else{r=p[e+f>>2]|0;if(r>>>0<(p[151]|0)>>>0)De();i=r+12|0;if((p[i>>2]|0)!=(g|0))De();n=t+8|0;if((p[n>>2]|0)==(g|0)){p[i>>2]=t;p[n>>2]=r;m=t;break}else De()}}while(0);if(a){t=p[e+(f+20)>>2]|0;r=892+(t<<2)|0;if((g|0)==(p[r>>2]|0)){p[r>>2]=m;if(!m){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(g|0))p[t>>2]=m;else p[a+20>>2]=m;if(!m)break}r=p[151]|0;if(m>>>0<r>>>0)De();p[m+24>>2]=a;t=p[e+(f+8)>>2]|0;do{if(t)if(t>>>0<r>>>0)De();else{p[m+16>>2]=t;p[t+24>>2]=m;break}}while(0);t=p[e+(f+12)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=t;p[t+24>>2]=m;break}}}else{i=p[e+f>>2]|0;r=p[e+(f|4)>>2]|0;t=628+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(p[151]|0)>>>0)De();if((p[i+12>>2]|0)!=(g|0))De()}if((r|0)==(i|0)){p[147]=p[147]&~(1<<n);break}if((r|0)!=(t|0)){if(r>>>0<(p[151]|0)>>>0)De();t=r+8|0;if((p[t>>2]|0)==(g|0))h=t;else De()}else h=r+8|0;p[i+12>>2]=r;p[h>>2]=i}}while(0);p[b+4>>2]=o|1;p[b+o>>2]=o;if((b|0)==(p[152]|0)){p[149]=o;return}}else{p[t>>2]=r&-2;p[b+4>>2]=o|1;p[b+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=628+(r<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(r+2<<2)|0;r=p[t>>2]|0;if(r>>>0<(p[151]|0)>>>0)De();else{v=t;_=r}}else{p[147]=i|t;v=628+(r+2<<2)|0;_=n}p[v>>2]=b;p[_+12>>2]=b;p[b+8>>2]=_;p[b+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{v=(t+1048320|0)>>>16&8;_=t<<v;g=(_+520192|0)>>>16&4;_=_<<g;n=(_+245760|0)>>>16&2;n=14-(g|v|n)+(_<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=892+(n<<2)|0;p[b+28>>2]=n;p[b+20>>2]=0;p[b+16>>2]=0;r=p[148]|0;i=1<<n;e:do{if(r&i){t=p[t>>2]|0;t:do{if((p[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=p[r>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(p[151]|0)>>>0)De();else{p[r>>2]=b;p[b+24>>2]=t;p[b+12>>2]=b;p[b+8>>2]=b;break e}}else y=t}while(0);t=y+8|0;r=p[t>>2]|0;_=p[151]|0;if(r>>>0>=_>>>0&y>>>0>=_>>>0){p[r+12>>2]=b;p[t>>2]=b;p[b+8>>2]=r;p[b+12>>2]=y;p[b+24>>2]=0;break}else De()}else{p[148]=r|i;p[t>>2]=b;p[b+24>>2]=t;p[b+12>>2]=b;p[b+8>>2]=b}}while(0);b=(p[155]|0)+-1|0;p[155]=b;if(!b)t=1044;else return;while(1){t=p[t>>2]|0;if(!t)break;else t=t+8|0}p[155]=-1;return}function zr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;p[e>>2]=12;e=0;return e|0}r=Hr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=p[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Kr(r|0,e|0,(i>>>0<t>>>0?i:t)|0)|0;Vr(e);e=r;return e|0}function Gr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=p[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;f=e+4|0;m=p[f>>2]|0;l=m&-8;c=e+l|0;s=p[151]|0;r=m&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))De();i=e+(l|4)|0;n=p[i>>2]|0;if(!(n&1))De();if(!r){if(t>>>0<256){e=0;return e|0}if(l>>>0>=(t+4|0)>>>0?(l-t|0)>>>0<=p[267]<<1>>>0:0)return e|0;e=0;return e|0}if(l>>>0>=t>>>0){r=l-t|0;if(r>>>0<=15)return e|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=r|3;p[i>>2]=p[i>>2]|1;Wr(e+t|0,r);return e|0}if((c|0)==(p[153]|0)){r=(p[150]|0)+l|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|1;p[153]=e+t;p[150]=h;return e|0}if((c|0)==(p[152]|0)){i=(p[149]|0)+l|0;if(i>>>0<t>>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=r|1;p[e+i>>2]=r;i=e+(i+4)|0;p[i>>2]=p[i>>2]&-2;i=e+t|0}else{p[f>>2]=m&1|i|2;i=e+(i+4)|0;p[i>>2]=p[i>>2]|1;i=0;r=0}p[149]=r;p[152]=i;return e|0}if(n&2){e=0;return e|0}d=(n&-8)+l|0;if(d>>>0<t>>>0){e=0;return e|0}h=d-t|0;o=n>>>3;do{if(n>>>0>=256){a=p[e+(l+24)>>2]|0;o=p[e+(l+12)>>2]|0;do{if((o|0)==(c|0)){i=e+(l+20)|0;r=p[i>>2]|0;if(!r){i=e+(l+16)|0;r=p[i>>2]|0;if(!r){u=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<s>>>0)De();else{p[i>>2]=0;u=r;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();r=n+12|0;if((p[r>>2]|0)!=(c|0))De();i=o+8|0;if((p[i>>2]|0)==(c|0)){p[r>>2]=o;p[i>>2]=n;u=o;break}else De()}}while(0);if(a){r=p[e+(l+28)>>2]|0;i=892+(r<<2)|0;if((c|0)==(p[i>>2]|0)){p[i>>2]=u;if(!u){p[148]=p[148]&~(1<<r);break}}else{if(a>>>0<(p[151]|0)>>>0)De();r=a+16|0;if((p[r>>2]|0)==(c|0))p[r>>2]=u;else p[a+20>>2]=u;if(!u)break}i=p[151]|0;if(u>>>0<i>>>0)De();p[u+24>>2]=a;r=p[e+(l+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)De();else{p[u+16>>2]=r;p[r+24>>2]=u;break}}while(0);r=p[e+(l+20)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=r;p[r+24>>2]=u;break}}}else{n=p[e+(l+8)>>2]|0;i=p[e+(l+12)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<s>>>0)De();if((p[n+12>>2]|0)!=(c|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<s>>>0)De();r=i+8|0;if((p[r>>2]|0)==(c|0))a=r;else De()}else a=i+8|0;p[n+12>>2]=i;p[a>>2]=n}}while(0);if(h>>>0<16){p[f>>2]=d|m&1|2;t=e+(d|4)|0;p[t>>2]=p[t>>2]|1;return e|0}else{p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|3;m=e+(d|4)|0;p[m>>2]=p[m>>2]|1;Wr(e+t|0,h);return e|0}return 0}function Wr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0;g=e+t|0;r=p[e+4>>2]|0;do{if(!(r&1)){u=p[e>>2]|0;if(!(r&3))return;h=e+(0-u)|0;d=u+t|0;l=p[151]|0;if(h>>>0<l>>>0)De();if((h|0)==(p[152]|0)){i=e+(t+4)|0;r=p[i>>2]|0;if((r&3|0)!=3){y=h;a=d;break}p[149]=d;p[i>>2]=r&-2;p[e+(4-u)>>2]=d|1;p[g>>2]=d;return}o=u>>>3;if(u>>>0<256){n=p[e+(8-u)>>2]|0;i=p[e+(12-u)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(h|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);y=h;a=d;break}if((i|0)!=(r|0)){if(i>>>0<l>>>0)De();r=i+8|0;if((p[r>>2]|0)==(h|0))s=r;else De()}else s=i+8|0;p[n+12>>2]=i;p[s>>2]=n;y=h;a=d;break}s=p[e+(24-u)>>2]|0;n=p[e+(12-u)>>2]|0;do{if((n|0)==(h|0)){n=16-u|0;i=e+(n+4)|0;r=p[i>>2]|0;if(!r){i=e+n|0;r=p[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<l>>>0)De();else{p[i>>2]=0;c=r;break}}else{o=p[e+(8-u)>>2]|0;if(o>>>0<l>>>0)De();r=o+12|0;if((p[r>>2]|0)!=(h|0))De();i=n+8|0;if((p[i>>2]|0)==(h|0)){p[r>>2]=n;p[i>>2]=o;c=n;break}else De()}}while(0);if(s){r=p[e+(28-u)>>2]|0;i=892+(r<<2)|0;if((h|0)==(p[i>>2]|0)){p[i>>2]=c;if(!c){p[148]=p[148]&~(1<<r);y=h;a=d;break}}else{if(s>>>0<(p[151]|0)>>>0)De();r=s+16|0;if((p[r>>2]|0)==(h|0))p[r>>2]=c;else p[s+20>>2]=c;if(!c){y=h;a=d;break}}n=p[151]|0;if(c>>>0<n>>>0)De();p[c+24>>2]=s;r=16-u|0;i=p[e+r>>2]|0;do{if(i)if(i>>>0<n>>>0)De();else{p[c+16>>2]=i;p[i+24>>2]=c;break}}while(0);r=p[e+(r+4)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[c+20>>2]=r;p[r+24>>2]=c;y=h;a=d;break}else{y=h;a=d}}else{y=h;a=d}}else{y=e;a=t}}while(0);l=p[151]|0;if(g>>>0<l>>>0)De();r=e+(t+4)|0;i=p[r>>2]|0;if(!(i&2)){if((g|0)==(p[153]|0)){_=(p[150]|0)+a|0;p[150]=_;p[153]=y;p[y+4>>2]=_|1;if((y|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((g|0)==(p[152]|0)){_=(p[149]|0)+a|0;p[149]=_;p[152]=y;p[y+4>>2]=_|1;p[y+_>>2]=_;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=p[e+(t+24)>>2]|0;n=p[e+(t+12)>>2]|0;do{if((n|0)==(g|0)){i=e+(t+20)|0;r=p[i>>2]|0;if(!r){i=e+(t+16)|0;r=p[i>>2]|0;if(!r){m=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<l>>>0)De();else{p[i>>2]=0;m=r;break}}else{o=p[e+(t+8)>>2]|0;if(o>>>0<l>>>0)De();r=o+12|0;if((p[r>>2]|0)!=(g|0))De();i=n+8|0;if((p[i>>2]|0)==(g|0)){p[r>>2]=n;p[i>>2]=o;m=n;break}else De()}}while(0);if(s){r=p[e+(t+28)>>2]|0;i=892+(r<<2)|0;if((g|0)==(p[i>>2]|0)){p[i>>2]=m;if(!m){p[148]=p[148]&~(1<<r);break}}else{if(s>>>0<(p[151]|0)>>>0)De();r=s+16|0;if((p[r>>2]|0)==(g|0))p[r>>2]=m;else p[s+20>>2]=m;if(!m)break}i=p[151]|0;if(m>>>0<i>>>0)De();p[m+24>>2]=s;r=p[e+(t+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)De();else{p[m+16>>2]=r;p[r+24>>2]=m;break}}while(0);r=p[e+(t+20)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=r;p[r+24>>2]=m;break}}}else{n=p[e+(t+8)>>2]|0;i=p[e+(t+12)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(g|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<l>>>0)De();r=i+8|0;if((p[r>>2]|0)==(g|0))f=r;else De()}else f=i+8|0;p[n+12>>2]=i;p[f>>2]=n}}while(0);p[y+4>>2]=a|1;p[y+a>>2]=a;if((y|0)==(p[152]|0)){p[149]=a;return}}else{p[r>>2]=i&-2;p[y+4>>2]=a|1;p[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=628+(i<<2)|0;n=p[147]|0;r=1<<r;if(n&r){r=628+(i+2<<2)|0;i=p[r>>2]|0;if(i>>>0<(p[151]|0)>>>0)De();else{v=r;_=i}}else{p[147]=n|r;v=628+(i+2<<2)|0;_=o}p[v>>2]=y;p[_+12>>2]=y;p[y+8>>2]=_;p[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{v=(r+1048320|0)>>>16&8;_=r<<v;g=(_+520192|0)>>>16&4;_=_<<g;o=(_+245760|0)>>>16&2;o=14-(g|v|o)+(_<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=892+(o<<2)|0;p[y+28>>2]=o;p[y+20>>2]=0;p[y+16>>2]=0;i=p[148]|0;n=1<<o;if(!(i&n)){p[148]=i|n;p[r>>2]=y;p[y+24>>2]=r;p[y+12>>2]=y;p[y+8>>2]=y;return}r=p[r>>2]|0;e:do{if((p[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=p[i>>2]|0;if(!n)break;if((p[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(p[151]|0)>>>0)De();p[i>>2]=y;p[y+24>>2]=r;p[y+12>>2]=y;p[y+8>>2]=y;return}}while(0);i=r+8|0 ;n=p[i>>2]|0;_=p[151]|0;if(!(n>>>0>=_>>>0&r>>>0>=_>>>0))De();p[n+12>>2]=y;p[i>>2]=y;p[y+8>>2]=n;p[y+12>>2]=r;p[y+24>>2]=0;return}function jr(){}function qr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(V=i,e-r>>>0|0)|0}function Yr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;r=e+r>>>0;return(V=t+i+(r>>>0<e>>>0|0)>>>0,r|0)|0}function Xr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){d[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){p[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){d[e>>0]=t;e=e+1|0}return e-r|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t>>>r;return e>>>r|(t&(1<<r)-1)<<32-r}V=0;return t>>>r-32|0}function Zr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t<<r|(e&(1<<r)-1<<32-r)>>>32-r;return e<<r}V=e<<r-32;return 0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return ke(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){p[e>>2]=p[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t>>r;return e>>>r|(t&(1<<r)-1)<<32-r}V=(t|0)<0?-1:0;return t>>r-32|0}function $r(e){e=e|0;var t=0;t=d[T+(e&255)>>0]|0;if((t|0)<8)return t|0;t=d[T+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=d[T+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(d[T+(e>>>24)>>0]|0)+24|0}function ei(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ce(n,o)|0;i=e>>>16;e=(r>>>16)+(ce(n,i)|0)|0;n=t>>>16;t=ce(n,o)|0;return(V=(e>>>16)+(ce(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ti(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=t>>31|((t|0)<0?-1:0)<<1;l=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=qr(u^e,l^t,u,l)|0;a=V;e=o^u;t=n^l;return qr((ai(s,a,qr(o^r,n^i,o,n)|0,V,0)|0)^e,V^t,e,t)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=b;b=b+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=i>>31|((i|0)<0?-1:0)<<1;l=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=qr(a^e,o^t,a,o)|0;t=V;ai(e,t,qr(u^r,l^i,u,l)|0,V,s)|0;i=qr(p[s>>2]^a,p[s+4>>2]^o,a,o)|0;r=V;b=n;return(V=r,i)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ei(n,o)|0;e=V;return(V=(ce(t,o)|0)+(ce(i,n)|0)+e|e&0,r|0|0)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return ai(e,t,r,i,0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=b;b=b+16|0;n=o|0;ai(e,t,r,i,n)|0;b=o;return(V=p[n+4>>2]|0,p[n>>2]|0)|0}function ai(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;c=e;l=t;u=l;a=r;h=i;s=h;if(!u){o=(n|0)!=0;if(!s){if(o){p[n>>2]=(c>>>0)%(a>>>0);p[n+4>>2]=0}h=0;n=(c>>>0)/(a>>>0)>>>0;return(V=h,n)|0}else{if(!o){h=0;n=0;return(V=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=t&0;h=0;n=0;return(V=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=31){d=o+1|0;s=31-o|0;t=o-31>>31;a=d;e=c>>>(d>>>0)&t|u<<s;t=u>>>(d>>>0)&t;o=0;s=c<<s;break}if(!n){h=0;n=0;return(V=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;h=0;n=0;return(V=h,n)|0}o=a-1|0;if(o&a){s=(he(a|0)|0)+33-(he(u|0)|0)|0;m=64-s|0;d=32-s|0;l=d>>31;f=s-32|0;t=f>>31;a=s;e=d-1>>31&u>>>(f>>>0)|(u<<d|c>>>(s>>>0))&t;t=t&u>>>(s>>>0);o=c<<m&l;s=(u<<m|c>>>(f>>>0))&l|c<<d&s-33>>31;break}if(n){p[n>>2]=o&c;p[n+4>>2]=0}if((a|0)==1){f=l|t&0;m=e|0|0;return(V=f,m)|0}else{m=$r(a|0)|0;f=u>>>(m>>>0)|0;m=u<<32-m|c>>>(m>>>0)|0;return(V=f,m)|0}}else{if(o){if(n){p[n>>2]=(u>>>0)%(a>>>0);p[n+4>>2]=0}f=0;m=(u>>>0)/(a>>>0)>>>0;return(V=f,m)|0}if(!c){if(n){p[n>>2]=0;p[n+4>>2]=(u>>>0)%(s>>>0)}f=0;m=(u>>>0)/(s>>>0)>>>0;return(V=f,m)|0}o=s-1|0;if(!(o&s)){if(n){p[n>>2]=e|0;p[n+4>>2]=o&u|t&0}f=0;m=u>>>(($r(s|0)|0)>>>0);return(V=f,m)|0}o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=u<<s|c>>>(t>>>0);t=u>>>(t>>>0);o=0;s=c<<s;break}if(!n){f=0;m=0;return(V=f,m)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;f=0;m=0;return(V=f,m)|0}}while(0);if(!a){u=s;l=0;s=0}else{d=r|0|0;c=h|i&0;u=Yr(d|0,c|0,-1,-1)|0;r=V;l=s;s=0;do{i=l;l=o>>>31|l<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;qr(u,r,i,h)|0;m=V;f=m>>31|((m|0)<0?-1:0)<<1;s=f&1;e=qr(i,h,f&d,(((m|0)<0?-1:0)>>31|((m|0)<0?-1:0)<<1)&c)|0;t=V;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){p[n>>2]=e;p[n+4>>2]=t}f=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;m=(o<<1|0>>>31)&-2|s;return(V=f,m)|0}function si(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Si[e&7](t|0,r|0,i|0)|0}function li(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ti[e&3](t|0,r|0,i|0,n|0,o|0)}function ui(e,t){e=e|0;t=t|0;Ei[e&7](t|0)}function ci(e,t){e=e|0;t=t|0;return xi[e&1](t|0)|0}function di(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Pi[e&0](t|0,r|0,i|0)}function hi(e){e=e|0;Ai[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Di[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function fi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Ii[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;pe(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;pe(1)}function vi(e){e=e|0;pe(2)}function _i(e){e=e|0;pe(3);return 0}function yi(e,t,r){e=e|0;t=t|0;r=r|0;pe(4)}function bi(){pe(5)}function Ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;pe(6)}function wi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;pe(7)}var Si=[mi,qt,Nr,Ar,Pr,Dr,mi,mi];var Ti=[gi,$t,Jt,gi];var Ei=[vi,zt,Wt,Gt,Ht,jt,ar,Lr];var xi=[_i,xr];var Pi=[yi];var Ai=[bi,nr,or,bi];var Di=[Ci,tr,er,Ci];var Ii=[wi,Xt,Qt,wi];return{___cxa_can_catch:rr,_crn_get_levels:bt,_crn_get_uncompressed_size:St,_crn_decompress:Tt,_i64Add:Yr,_crn_get_width:_t,___cxa_is_pointer_type:ir,_crn_get_bytes_per_block:wt,_memset:Xr,_malloc:Ur,_memcpy:Kr,_i64Subtract:qr,_bitshift64Lshr:Qr,_free:Vr,_bitshift64Shl:Zr,_crn_get_height:yt,_crn_get_dxt_format:Ct,runPostSets:jr,_emscripten_replace_memory:je,stackAlloc:qe,stackSave:Ye,stackRestore:Xe,establishStackSpace:Qe,setThrew:Ze,setTempRet0:$e,getTempRet0:et,dynCall_iiii:si,dynCall_viiiii:li,dynCall_vi:ui,dynCall_ii:ci,dynCall_viii:di,dynCall_v:hi,dynCall_viiiiii:pi,dynCall_viiii:fi}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function t(){for(var e=0;e<3;e++)i.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var r=e.length+1,i=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var n=0;n<r-1;n+=1)i.push(allocate(intArrayFromString(e[n]),"i8",ALLOC_NORMAL)),t();i.push(0),i=allocate(i,"i32",ALLOC_NORMAL);try{exit(Module._main(r,i,0),!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),define("ThirdParty/GltfPipeline/findAccessorMinMax",["./getAccessorByteStride","./numberOfComponentsForType","../../Core/arrayFill","../../Core/ComponentDatatype","../../Core/defined"],function(e,t,r,i,n){"use strict";function o(o,a){var s=o.bufferViews,l=o.buffers,u=a.bufferView,c=t(a.type),d=r(new Array(c),Number.POSITIVE_INFINITY),h=r(new Array(c),Number.NEGATIVE_INFINITY);if(n(u)&&n(s)&&s.hasOwnProperty(u)){var p=s[u],f=p.buffer;if(n(f)&&n(l)&&l.hasOwnProperty(f))for(var m=l[f],g=m.extras._pipeline.source,v=a.count,_=e(o,a),y=a.byteOffset+p.byteOffset,b=a.componentType,C=0;C<v;C++){for(var w=i.createArrayBufferView(b,g.buffer,y+g.byteOffset,c),S=0;S<c;S++){var T=w[S];d[S]=Math.min(d[S],T),h[S]=Math.max(h[S],T)}y+=_}}return{min:d,max:h}}return o}),define("ThirdParty/GltfPipeline/getJointCountForMaterials",["./ForEach","../../Core/defined"],function(e,t){"use strict";function r(r){var i=r.meshes,n={},o={};return e.node(r,function(e){t(e.skin)&&(t(o[e.skin])||(o[e.skin]=[]),o[e.skin].push(e))}),e.skin(r,function(r,a){for(var s=r.joints.length,l=function(e){n[e.material]=s},u=o[a],c=u.length,d=0;d<c;d++){var h=u[d],p=h.mesh;if(t(p)){var f=i[p];e.meshPrimitive(f,l)}}}),n}return r}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,i=t.navigator,n=t.jQuery,o=t.JSON;!function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.4.2",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in g)&&e===t}function u(t,r){var i;return function(){i||(i=m.a.setTimeout(function(){i=e,t()},r))}}function c(e,t){var r;return function(){clearTimeout(r),r=m.a.setTimeout(e,t)}}function d(e,t){t&&t!==v?"beforeChange"===t?this.Ob(e):this.Ja(e,t):this.Pb(e)}function h(e,t){null!==t&&t.k&&t.k()}function p(e,t){var r=this.Mc,i=r[w];i.T||(this.ob&&this.Oa[t]?(r.Sb(t,e,this.Oa[t]),this.Oa[t]=null,--this.ob):i.s[t]||r.Sb(t,e,i.t?{$:e}:r.yc(e)),e.Ha&&e.Hc())}function f(e,t,r,i){m.d[e]={init:function(e,n,o,a,s){var l,u;return m.m(function(){var o=n(),a=m.a.c(o),a=!r!=!a,c=!u;(c||t||a!==l)&&(c&&m.xa.Ca()&&(u=m.a.wa(m.f.childNodes(e),!0)),a?(c||m.f.fa(e,m.a.wa(u)),m.hb(i?i(s,o):s,e)):m.f.za(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},m.h.va[e]=!1,m.f.aa[e]=!0}var m=void 0!==a?a:{};m.b=function(e,t){for(var r=e.split("."),i=m,n=0;n<r.length-1;n++)i=i[r[n]];i[r[r.length-1]]=t},m.H=function(e,t,r){e[t]=r},m.version="3.4.2",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1},m.a=function(){function a(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])}function s(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,r,i){var n=e[t].match(v)||[];m.a.r(r.match(v),function(e){m.a.ra(n,e,i)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,h={},p={};h[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(h,function(e,t){if(t.length)for(var r=0,i=t.length;r<i;r++)p[t[r]]=e});var f={propertychange:!0},g=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:e}(),v=/\S+/g;return{gc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(e,t){for(var r=0,i=e.length;r<i;r++)t(e[r],r)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},Vb:function(e,t,r){for(var i=0,n=e.length;i<n;i++)if(t.call(r,e[i],i))return e[i];return null},Na:function(e,t){var r=m.a.o(e,t);0<r?e.splice(r,1):0===r&&e.shift()},Wb:function(e){e=e||[];for(var t=[],r=0,i=e.length;r<i;r++)0>m.a.o(t,e[r])&&t.push(e[r]);return t},ib:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)r.push(t(e[i],i));return r},Ma:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)t(e[i],i)&&r.push(e[i]);return r},ta:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;r<i;r++)e.push(t[r]);return e},ra:function(e,t,r){var i=m.a.o(m.a.Bb(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},la:c,extend:s,$a:l,ab:c?l:s,D:a,Ea:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},rb:function(e){for(;e.firstChild;)m.removeNode(e.firstChild)},nc:function(e){e=m.a.W(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(m.ba(e[i]));return t},wa:function(e,t){for(var r=0,i=e.length,n=[];r<i;r++){var o=e[r].cloneNode(!0);n.push(t?m.ba(o):o)}return n},fa:function(e,t){if(m.a.rb(e),t)for(var r=0,i=t.length;r<i;r++)e.appendChild(t[r])},uc:function(e,t){var r=e.nodeType?[e]:e;if(0<r.length){for(var i=r[0],n=i.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;o<a;o++)m.removeNode(r[o])}},Ba:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var r=e[0],i=e[e.length-1];for(e.length=0;r!==i;)e.push(r),r=r.nextSibling;e.push(i)}}return e},wc:function(e,t){7>g?e.setAttribute("selected",t):e.selected=t},cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},sd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Rc: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},qb:function(e){return m.a.Rc(e,e.ownerDocument.documentElement)},Tb:function(e){return!!m.a.Vb(e,m.a.qb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Zb:function(e){return m.onError?function(){try{return e.apply(this,arguments)}catch(e){throw m.onError&&m.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(m.a.Zb(e),t)},dc:function(e){setTimeout(function(){throw m.onError&&m.onError(e),e},0)},q:function(e,t,r){var i=m.a.Zb(r);if(r=g&&f[t],m.options.useOnlyNativeEvents||r||!n)if(r||"function"!=typeof e.addEventListener){if(void 0===e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},a="on"+t;e.attachEvent(a,o),m.a.G.qa(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,i,!1);else n(e).bind(t,i)},Fa:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===m.a.A(e)&&e.type&&"click"==i.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,m.options.useOnlyNativeEvents||!n||o)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=r.createEvent(p[i]||"HTMLEvents"),o.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else n(e).trigger(i)},c:function(e){return m.I(e)?e():e},Bb:function(e){return m.I(e)?e.p():e},fb:function(e,t,r){var i;t&&("object"==typeof e.classList?(i=e.classList[r?"add":"remove"],m.a.r(t.match(v),function(t){i.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,r):u(e,"className",t,r))},bb:function(t,r){var i=m.a.c(r);null!==i&&i!==e||(i="");var n=m.f.firstChild(t);!n||3!=n.nodeType||m.f.nextSibling(n)?m.f.fa(t,[t.ownerDocument.createTextNode(i)]):n.data=i,m.a.Wc(t)},vc:function(e,t){if(e.name=t,7>=g)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Wc:function(e){9<=g&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Sc:function(e){if(g){var t=e.style.width;e.style.width=0,e.style.width=t}},nd:function(e,t){e=m.a.c(e),t=m.a.c(t);for(var r=[],i=e;i<=t;i++)r.push(i);return r},W:function(e){for(var t=[],r=0,i=e.length;r<i;r++)t.push(e[r]);return t},bc:function(e){return d?Symbol(e):e},xd:6===g,yd:7===g,C:g,ic:function(e,t){for(var r=m.a.W(e.getElementsByTagName("input")).concat(m.a.W(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;0<=o;o--)i(r[o])&&n.push(r[o]);return n},kd:function(e){return"string"==typeof e&&(e=m.a.cb(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},Gb:function(e,t,r){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(m.a.c(e),t,r)},ld:function(e,t,i){i=i||{};var n=i.params||{},o=i.includeFields||this.gc,s=e;if("object"==typeof e&&"form"===m.a.A(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=m.a.ic(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=m.a.c(t);var d=r.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=r.createElement("input"),e.type="hidden",e.name=h,e.value=m.a.Gb(m.a.c(t[h])),d.appendChild(e);a(n,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,d.appendChild(i)}),r.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.r),m.b("utils.arrayFirst",m.a.Vb),m.b("utils.arrayFilter",m.a.Ma),m.b("utils.arrayGetDistinctValues",m.a.Wb),m.b("utils.arrayIndexOf",m.a.o),m.b("utils.arrayMap",m.a.ib),m.b("utils.arrayPushAll",m.a.ta),m.b("utils.arrayRemoveItem",m.a.Na),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.gc),m.b("utils.getFormFields",m.a.ic),m.b("utils.peekObservable",m.a.Bb),m.b("utils.postJson",m.a.ld),m.b("utils.parseJson",m.a.kd),m.b("utils.registerEventHandler",m.a.q),m.b("utils.stringifyJson",m.a.Gb),m.b("utils.range",m.a.nd),m.b("utils.toggleDomNodeCssClass",m.a.fb),m.b("utils.triggerEvent",m.a.Fa),m.b("utils.unwrapObservable",m.a.c),m.b("utils.objectForEach",m.a.D),m.b("utils.addOrRemoveItem",m.a.ra),m.b("utils.setTextContent",m.a.bb),m.b("unwrap",m.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var i=r.slice(0);return i.push.apply(i,arguments),t.apply(e,i)}}),m.a.e=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){n===e&&t(r,!1)===e||(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return!!t&&(delete n[t],e[i]=null,!0)},J:function(){return r+++i}}},m.b("utils.domData",m.a.e),m.b("utils.domData.clear",m.a.e.clear),m.a.G=new function(){function t(t,r){var n=m.a.e.get(t,i);return n===e&&r&&(n=[],m.a.e.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;n<i.length;n++)i[n](e);if(m.a.e.clear(e),m.a.G.cleanExternalData(e),a[e.nodeType])for(i=e.firstChild;e=i;)i=e.nextSibling,8===e.nodeType&&r(e)}var i=m.a.e.J(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{qa:function(e,r){if("function"!=typeof r)throw Error("Callback must be a function");t(e,!0).push(r)},tc:function(r,n){var o=t(r,!1);o&&(m.a.Na(o,n),0==o.length&&m.a.e.set(r,i,e))},ba:function(e){if(o[e.nodeType]&&(r(e),a[e.nodeType])){var t=[];m.a.ta(t,e.getElementsByTagName("*"));for(var i=0,n=t.length;i<n;i++)r(t[i])}return e},removeNode:function(e){m.ba(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},m.ba=m.a.G.ba,m.removeNode=m.a.G.removeNode,m.b("cleanNode",m.ba),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.G),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.G.qa),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.G.tc),function(){var i=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=m.a.C;m.a.na=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=r);var c,s=a.parentWindow||a.defaultView||t,d=m.a.cb(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^<([a-z]+)[ >]/))&&l[d[1]]||i,d=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(c)):(u&&a.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=m.a.W(h.lastChild.childNodes)}return a},m.a.Eb=function(t,r){if(m.a.rb(t),null!==(r=m.a.c(r))&&r!==e)if("string"!=typeof r&&(r=r.toString()),n)n(t).html(r);else for(var i=m.a.na(r,t.ownerDocument),o=0;o<i.length;o++)t.appendChild(i[o])}}(),m.b("utils.parseHtmlFragment",m.a.na),m.b("utils.setHtml",m.a.Eb),m.N=function(){function t(e,r){if(e)if(8==e.nodeType){var i=m.N.pc(e.nodeValue);null!=i&&r.push({Qc:e,hd:i})}else if(1==e.nodeType)for(var i=0,n=e.childNodes,o=n.length;i<o;i++)t(n[i],r)}var r={};return{yb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return r[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},Bc:function(t,i){var n=r[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,i||[]),!0}finally{delete r[t]}},Cc:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;n<o;n++){var a=i[n].Qc,s=[a];r&&m.a.ta(s,r),m.N.Bc(i[n].hd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},pc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),m.b("memoization",m.N),m.b("memoization.memoize",m.N.yb),m.b("memoization.unmemoize",m.N.Bc),m.b("memoization.parseMemoText",m.N.pc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.N.Cc),m.Z=function(){function e(){if(o)for(var e,t=o,r=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++r){s=o,m.a.dc(Error("'Too much recursion' after processing "+r+" task groups."));break}t=o}try{e()}catch(e){m.a.dc(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)},Za:function(e){return o||m.Z.scheduler(i),n[o++]=e,a++},cancel:function(e){(e-=a-o)>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},rd:e}}(),m.b("tasks",m.Z),m.b("tasks.schedule",m.Z.Za),m.b("tasks.runEarly",m.Z.rd),m.Aa={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return m.B({read:e,write:function(i){clearTimeout(r),r=m.a.setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var r,i,n;"number"==typeof t?r=t:(r=t.timeout,i=t.method),e.gb=!1,n="notifyWhenChangesStop"==i?c:u,e.Wa(function(e){return n(e,r)})},deferred:function(t,r){if(!0!==r)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.gb||(t.gb=!0,t.Wa(function(r){var i,n=!1;return function(){if(!n){m.Z.cancel(i),i=m.Z.Za(r);try{n=!0,t.notifySubscribers(e,"dirty")}finally{n=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var g={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Aa),m.zc=function(e,t,r){this.$=e,this.jb=t,this.Pc=r,this.T=!1,m.H(this,"dispose",this.k)},m.zc.prototype.k=function(){this.T=!0,this.Pc()},m.K=function(){m.a.ab(this,_),_.ub(this)};var v="change",_={ub:function(e){e.F={change:[]},e.Qb=1},Y:function(e,t,r){var i=this;r=r||v;var n=new m.zc(i,t?e.bind(t):e,function(){m.a.Na(i.F[r],n),i.Ka&&i.Ka(r)});return i.ua&&i.ua(r),i.F[r]||(i.F[r]=[]),i.F[r].push(n),n},notifySubscribers:function(e,t){if(t=t||v,t===v&&this.Kb(),this.Ra(t)){var r=t===v&&this.Fc||this.F[t].slice(0);try{m.l.Xb();for(var i,n=0;i=r[n];++n)i.T||i.jb(e)}finally{m.l.end()}}},Pa:function(){return this.Qb},Zc:function(e){return this.Pa()!==e},Kb:function(){++this.Qb},Wa:function(e){var t,r,i,n,o=this,a=m.I(o);o.Ja||(o.Ja=o.notifySubscribers,o.notifySubscribers=d);var s=e(function(){o.Ha=!1,a&&n===o&&(n=o.Mb?o.Mb():o());var e=r||o.Ua(i,n);r=t=!1,e&&o.Ja(i=n)});o.Pb=function(e){o.Fc=o.F[v].slice(0),o.Ha=t=!0,n=e,s()},o.Ob=function(e){t||(i=e,o.Ja(e,"beforeChange"))},o.Hc=function(){o.Ua(i,o.p(!0))&&(r=!0)}},Ra:function(e){return this.F[e]&&this.F[e].length},Xc:function(e){if(e)return this.F[e]&&this.F[e].length||0;var t=0;return m.a.D(this.F,function(e,r){"dirty"!==e&&(t+=r.length)}),t},Ua:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&m.a.D(e,function(e,r){var i=m.Aa[e];"function"==typeof i&&(t=i(t,r)||t)}),t}};m.H(_,"subscribe",_.Y),m.H(_,"extend",_.extend),m.H(_,"getSubscriptionsCount",_.Xc),m.a.la&&m.a.$a(_,Function.prototype),m.K.fn=_,m.lc=function(e){return null!=e&&"function"==typeof e.Y&&"function"==typeof e.notifySubscribers},m.b("subscribable",m.K),m.b("isSubscribable",m.lc),m.xa=m.l=function(){function e(e){i.push(r),r=e}function t(){r=i.pop()}var r,i=[],n=0;return{Xb:e,end:t,sc:function(e){if(r){if(!m.lc(e))throw Error("Only subscribable things can act as dependencies");r.jb.call(r.Lc,e,e.Gc||(e.Gc=++n))}},w:function(r,i,n){try{return e(),r.apply(i,n||[])}finally{t()}},Ca:function(){if(r)return r.m.Ca()},Va:function(){if(r)return r.Va}}}(),m.b("computedContext",m.xa),m.b("computedContext.getDependenciesCount",m.xa.Ca),m.b("computedContext.isInitial",m.xa.Va),m.b("ignoreDependencies",m.wd=m.l.w);var y=m.a.bc("_latestValue");m.O=function(e){function t(){return 0<arguments.length?(t.Ua(t[y],arguments[0])&&(t.ia(),t[y]=arguments[0],t.ha()),this):(m.l.sc(t),t[y])}return t[y]=e,m.a.la||m.a.extend(t,m.K.fn),m.K.fn.ub(t),m.a.ab(t,b),m.options.deferUpdates&&m.Aa.deferred(t,!0),t};var b={equalityComparer:l,p:function(){return this[y]},ha:function(){this.notifySubscribers(this[y])},ia:function(){this.notifySubscribers(this[y],"beforeChange")}};m.a.la&&m.a.$a(b,m.K.fn);var C=m.O.md="__ko_proto__";b[C]=m.O,m.Qa=function(t,r){return null!==t&&t!==e&&t[C]!==e&&(t[C]===r||m.Qa(t[C],r))},m.I=function(e){return m.Qa(e,m.O)},m.Da=function(e){return!!("function"==typeof e&&e[C]===m.O||"function"==typeof e&&e[C]===m.B&&e.$c)},m.b("observable",m.O),m.b("isObservable",m.I),m.b("isWriteableObservable",m.Da),m.b("isWritableObservable",m.Da),m.b("observable.fn",b),m.H(b,"peek",b.p),m.H(b,"valueHasMutated",b.ha),m.H(b,"valueWillMutate",b.ia),m.ma=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=m.O(e),m.a.ab(e,m.ma.fn),e.extend({trackArrayChanges:!0})},m.ma.fn={remove:function(e){for(var t=this.p(),r=[],i="function"!=typeof e||m.I(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];i(o)&&(0===r.length&&this.ia(),r.push(o),t.splice(n,1),n--)}return r.length&&this.ha(),r},removeAll:function(t){if(t===e){var r=this.p(),i=r.slice(0);return this.ia(),r.splice(0,r.length),this.ha(),i}return t?this.remove(function(e){return 0<=m.a.o(t,e)}):[]},destroy:function(e){var t=this.p(),r="function"!=typeof e||m.I(e)?function(t){return t===e}:e;this.ia();for(var i=t.length-1;0<=i;i--)r(t[i])&&(t[i]._destroy=!0);this.ha()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=m.a.o(t,e)}):[]},indexOf:function(e){var t=this();return m.a.o(t,e)},replace:function(e,t){var r=this.indexOf(e);0<=r&&(this.ia(),this.p()[r]=t,this.ha())}},m.a.la&&m.a.$a(m.ma.fn,m.O.fn),m.a.r("pop push reverse shift sort splice unshift".split(" "),function(e){m.ma.fn[e]=function(){var t=this.p();this.ia(),this.Yb(t,e,arguments);var r=t[e].apply(t,arguments);return this.ha(),r===t?this:r}}),m.a.r(["slice"],function(e){m.ma.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),m.b("observableArray",m.ma),m.Aa.trackArrayChanges=function(t,r){function i(){if(!a){a=!0,o=t.notifySubscribers,t.notifySubscribers=function(e,t){return t&&t!==v||++l,o.apply(this,arguments)};var e=[].concat(t.p()||[]);s=null,n=t.Y(function(r){if(r=[].concat(r||[]),t.Ra("arrayChange")){var i;(!s||1<l)&&(s=m.a.lb(e,r,t.kb)),i=s}e=r,s=null,l=0,i&&i.length&&t.notifySubscribers(i,"arrayChange")})}}if(t.kb={},r&&"object"==typeof r&&m.a.extend(t.kb,r),t.kb.sparse=!0,!t.Yb){var n,o,a=!1,s=null,l=0,u=t.ua,c=t.Ka;t.ua=function(e){u&&u.call(t,e),"arrayChange"===e&&i()},t.Ka=function(r){c&&c.call(t,r),"arrayChange"!==r||t.Ra("arrayChange")||(o&&(t.notifySubscribers=o,o=e),n.k(),a=!1)},t.Yb=function(e,t,r){function i(e,t,r){return n[n.length]={status:e,value:t,index:r}}if(a&&!l){var n=[],o=e.length,u=r.length,c=0;switch(t){case"push":c=o;case"unshift":for(t=0;t<u;t++)i("added",r[t],c+t);break;case"pop":c=o-1;case"shift":o&&i("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>r[0]?o+r[0]:r[0]),o);for(var o=1===u?o:Math.min(t+(r[1]||0),o),u=t+u-2,c=Math.max(o,u),d=[],h=[],p=2;t<c;++t,++p)t<o&&h.push(i("deleted",e[t],t)),t<u&&d.push(i("added",r[p],t));m.a.hc(h,d);break;default:return}s=n}}}};var w=m.a.bc("_state");m.m=m.B=function(t,r,i){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.sb,arguments),this}return m.l.sc(n),(a.V||a.t&&n.Sa())&&n.U(),a.M}if("object"==typeof t?i=t:(i=i||{},t&&(i.read=t)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var o=i.write,a={M:e,da:!0,V:!0,Ta:!1,Hb:!1,T:!1,Ya:!1,t:!1,od:i.read,sb:r||i.owner,i:i.disposeWhenNodeIsRemoved||i.i||null,ya:i.disposeWhen||i.ya,pb:null,s:{},L:0,fc:null};return n[w]=a,n.$c="function"==typeof o,m.a.la||m.a.extend(n,m.K.fn),m.K.fn.ub(n),m.a.ab(n,S), i.pure?(a.Ya=!0,a.t=!0,m.a.extend(n,T)):i.deferEvaluation&&m.a.extend(n,E),m.options.deferUpdates&&m.Aa.deferred(n,!0),a.i&&(a.Hb=!0,a.i.nodeType||(a.i=null)),a.t||i.deferEvaluation||n.U(),a.i&&n.ca()&&m.a.G.qa(a.i,a.pb=function(){n.k()}),n};var S={equalityComparer:l,Ca:function(){return this[w].L},Sb:function(e,t,r){if(this[w].Ya&&t===this)throw Error("A 'pure' computed must not be called recursively");this[w].s[e]=r,r.Ia=this[w].L++,r.pa=t.Pa()},Sa:function(){var e,t,r=this[w].s;for(e in r)if(r.hasOwnProperty(e)&&(t=r[e],this.oa&&t.$.Ha||t.$.Zc(t.pa)))return!0},gd:function(){this.oa&&!this[w].Ta&&this.oa(!1)},ca:function(){var e=this[w];return e.V||0<e.L},qd:function(){this.Ha?this[w].V&&(this[w].da=!0):this.ec()},yc:function(e){if(e.gb&&!this[w].i){var t=e.Y(this.gd,this,"dirty"),r=e.Y(this.qd,this);return{$:e,k:function(){t.k(),r.k()}}}return e.Y(this.ec,this)},ec:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[w].fc),this[w].fc=m.a.setTimeout(function(){e.U(!0)},t)):e.oa?e.oa(!0):e.U(!0)},U:function(e){var t=this[w],r=t.ya,i=!1;if(!t.Ta&&!t.T){if(t.i&&!m.a.qb(t.i)||r&&r()){if(!t.Hb)return void this.k()}else t.Hb=!1;t.Ta=!0;try{i=this.Vc(e)}finally{t.Ta=!1}return t.L||this.k(),i}},Vc:function(t){var r=this[w],i=!1,n=r.Ya?e:!r.L,o={Mc:this,Oa:r.s,ob:r.L};return m.l.Xb({Lc:o,jb:p,m:this,Va:n}),r.s={},r.L=0,o=this.Uc(r,o),this.Ua(r.M,o)&&(r.t||this.notifySubscribers(r.M,"beforeChange"),r.M=o,r.t?this.Kb():t&&this.notifySubscribers(r.M),i=!0),n&&this.notifySubscribers(r.M,"awake"),i},Uc:function(e,t){try{var r=e.od;return e.sb?r.call(e.sb):r()}finally{m.l.end(),t.ob&&!e.t&&m.a.D(t.Oa,h),e.da=e.V=!1}},p:function(e){var t=this[w];return(t.V&&(e||!t.L)||t.t&&this.Sa())&&this.U(),t.M},Wa:function(e){m.K.fn.Wa.call(this,e),this.Mb=function(){return this[w].da?this.U():this[w].V=!1,this[w].M},this.oa=function(e){this.Ob(this[w].M),this[w].V=!0,e&&(this[w].da=!0),this.Pb(this)}},k:function(){var e=this[w];!e.t&&e.s&&m.a.D(e.s,function(e,t){t.k&&t.k()}),e.i&&e.pb&&m.a.G.tc(e.i,e.pb),e.s=null,e.L=0,e.T=!0,e.da=!1,e.V=!1,e.t=!1,e.i=null}},T={ua:function(e){var t=this,r=t[w];if(!r.T&&r.t&&"change"==e){if(r.t=!1,r.da||t.Sa())r.s=null,r.L=0,t.U()&&t.Kb();else{var i=[];m.a.D(r.s,function(e,t){i[t.Ia]=e}),m.a.r(i,function(e,i){var n=r.s[e],o=t.yc(n.$);o.Ia=i,o.pa=n.pa,r.s[e]=o})}r.T||t.notifySubscribers(r.M,"awake")}},Ka:function(t){var r=this[w];r.T||"change"!=t||this.Ra("change")||(m.a.D(r.s,function(e,t){t.k&&(r.s[e]={$:t.$,Ia:t.Ia,pa:t.pa},t.k())}),r.t=!0,this.notifySubscribers(e,"asleep"))},Pa:function(){var e=this[w];return e.t&&(e.da||this.Sa())&&this.U(),m.K.fn.Pa.call(this)}},E={ua:function(e){"change"!=e&&"beforeChange"!=e||this.p()}};m.a.la&&m.a.$a(S,m.K.fn);var x=m.O.md;m.m[x]=m.O,S[x]=m.m,m.bd=function(e){return m.Qa(e,m.m)},m.cd=function(e){return m.Qa(e,m.m)&&e[w]&&e[w].Ya},m.b("computed",m.m),m.b("dependentObservable",m.m),m.b("isComputed",m.bd),m.b("isPureComputed",m.cd),m.b("computed.fn",S),m.H(S,"peek",S.p),m.H(S,"dispose",S.k),m.H(S,"isActive",S.ca),m.H(S,"getDependenciesCount",S.Ca),m.rc=function(e,t){return"function"==typeof e?m.m(e,t,{pure:!0}):(e=m.a.extend({},e),e.pure=!0,m.m(e,t))},m.b("pureComputed",m.rc),function(){function t(n,o,a){if(a=a||new i,"object"!=typeof(n=o(n))||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),r(n,function(r){var i=o(n[r]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[r]=i;break;case"object":case"undefined":var l=a.get(i);s[r]=l!==e?l:t(i,o,a)}}),s}function r(e,t){if(e instanceof Array){for(var r=0;r<e.length;r++)t(r);"function"==typeof e.toJSON&&t("toJSON")}else for(r in e)t(r)}function i(){this.keys=[],this.Lb=[]}m.Ac=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;m.I(e)&&10>t;t++)e=e();return e})},m.toJSON=function(e,t,r){return e=m.Ac(e),m.a.Gb(e,t,r)},i.prototype={save:function(e,t){var r=m.a.o(this.keys,e);0<=r?this.Lb[r]=t:(this.keys.push(e),this.Lb.push(t))},get:function(t){return t=m.a.o(this.keys,t),0<=t?this.Lb[t]:e}}}(),m.b("toJS",m.Ac),m.b("toJSON",m.toJSON),function(){m.j={u:function(t){switch(m.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?m.a.e.get(t,m.d.options.zb):7>=m.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ja:function(t,r,i){switch(m.a.A(t)){case"option":switch(typeof r){case"string":m.a.e.set(t,m.d.options.zb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:m.a.e.set(t,m.d.options.zb,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":""!==r&&null!==r||(r=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if((n=m.j.u(t.options[a]))==r||""==n&&r===e){o=a;break}(i||0<=o||r===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==r&&r!==e||(r=""),t.value=r}}}}(),m.b("selectExtensions",m.j),m.b("selectExtensions.readValue",m.j.u),m.b("selectExtensions.writeValue",m.j.ja),m.h=function(){function e(e){e=m.a.cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,r=[],a=e.match(i),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var d=u.charCodeAt(0);if(44===d){if(0>=l){r.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===d&&c&&1<u.length?(d=a[c-1].match(n))&&!o[d[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(i),a.push(","),c=-1,u="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(u=u.slice(1,-1));s.push(u)}}return r}var t=["true","false","null","undefined"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,i=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{va:[],ga:a,Ab:e,Xa:function(i,n){function o(e,i){var n;if(!c){var d=m.getBindingHandler(e);if(d&&d.preprocess&&!(i=d.preprocess(i,e,o)))return;(d=a[e])&&(n=i,0<=m.a.o(t,n)?n=!1:(d=n.match(r),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(i="function(){return "+i+" }"),s.push("'"+e+"':"+i)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,d="string"==typeof i?e(i):i;return m.a.r(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},fd:function(e,t){for(var r=0;r<e.length;r++)if(e[r].key==t)return!0;return!1},Ga:function(e,t,r,i,n){e&&m.I(e)?!m.Da(e)||n&&e.p()===i||e(i):(e=t.get("_ko_property_writers"))&&e[r]&&e[r](i)}}}(),m.b("expressionRewriting",m.h),m.b("expressionRewriting.bindingRewriteValidators",m.h.va),m.b("expressionRewriting.parseObjectLiteral",m.h.Ab),m.b("expressionRewriting.preProcessBindings",m.h.Xa),m.b("expressionRewriting._twoWayBindings",m.h.ga),m.b("jsonExpressionRewriting",m.h),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.h.Xa),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(r,i){for(var n=r,o=1,a=[];n=n.nextSibling;){if(t(n)&&0===--o)return a;a.push(n),e(n)&&o++}if(!i)throw Error("Cannot find closing comment tag to match: "+r.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"\x3c!--test--\x3e"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};m.f={aa:{},childNodes:function(t){return e(t)?i(t):t.childNodes},za:function(t){if(e(t)){t=m.f.childNodes(t);for(var r=0,i=t.length;r<i;r++)m.removeNode(t[r])}else m.a.rb(t)},fa:function(t,r){if(e(t)){m.f.za(t);for(var i=t.nextSibling,n=0,o=r.length;n<o;n++)i.parentNode.insertBefore(r[n],i)}else m.a.fa(t,r)},qc:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},kc:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):m.f.qc(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=n(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},Yc:e,vd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},oc:function(r){if(l[m.a.A(r)]){var i=r.firstChild;if(i)do{if(1===i.nodeType){var o;o=i.firstChild;var a=null;if(o)do{if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o])}while(o=o.nextSibling);if(o=a)for(a=i.nextSibling,s=0;s<o.length;s++)a?r.insertBefore(o[s],a):r.appendChild(o[s])}}while(i=i.nextSibling)}}}}(),m.b("virtualElements",m.f),m.b("virtualElements.allowedBindings",m.f.aa),m.b("virtualElements.emptyNode",m.f.za),m.b("virtualElements.insertAfter",m.f.kc),m.b("virtualElements.prepend",m.f.qc),m.b("virtualElements.setDomNodeChildren",m.f.fa),function(){m.S=function(){this.Kc={}},m.a.extend(m.S.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||m.g.getComponentNameForNode(e);case 8:return m.f.Yc(e);default:return!1}},getBindings:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e):null;return m.g.Rb(r,e,t,!1)},getBindingAccessors:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e,{valueAccessors:!0}):null;return m.g.Rb(r,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return m.f.vd(e);default:return null}},parseBindingsString:function(e,t,r,i){try{var n,o=this.Kc,a=e+(i&&i.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+m.h.Xa(e,i)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,r)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),m.S.instance=new m.S}(),m.b("bindingProvider",m.S),function(){function r(e){return function(){return e}}function i(e){return e()}function o(e){return m.a.Ea(m.l.w(e),function(t,r){return function(){return e()[r]}})}function a(e,t,i){return"function"==typeof e?o(e.bind(null,t,i)):m.a.Ea(e,r)}function s(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t,r){var i,n=m.f.firstChild(t),o=m.S.instance,a=o.preprocessNode;if(a){for(;i=n;)n=m.f.nextSibling(i),a.call(o,i);n=m.f.firstChild(t)}for(;i=n;)n=m.f.nextSibling(i),u(e,i,r)}function u(e,t,r){var i=!0,n=1===t.nodeType;n&&m.f.oc(t),(n&&r||m.S.instance.nodeHasBindings(t))&&(i=d(t,null,e,r).shouldBindDescendants),i&&!p[m.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],r={},i=[];return m.a.D(e,function n(o){if(!r[o]){var a=m.getBindingHandler(o);a&&(a.after&&(i.push(o),m.a.r(a.after,function(t){if(e[t]){if(-1!==m.a.o(i,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+i.join(", "));n(t)}}),i.length--),t.push({key:o,jc:a})),r[o]=!0}}),t}function d(t,r,n,o){var a=m.a.e.get(t,f);if(!r){if(a)throw Error("You cannot apply bindings multiple times to the same element.");m.a.e.set(t,f,!0)}!a&&o&&m.xc(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var u=m.S.instance,d=u.getBindingAccessors||s,h=m.B(function(){return(l=r?r(n,t):d.call(u,t,n))&&n.Q&&n.Q(),l},null,{i:t});l&&h.ca()||(h=null)}var p;if(l){var g=h?function(e){return function(){return i(h()[e])}}:function(e){return l[e]},v=function(){return m.a.Ea(h?h():l,i)};v.get=function(e){return l[e]&&i(g(e))},v.has=function(e){return e in l},o=c(l),m.a.r(o,function(r){var i=r.jc.init,o=r.jc.update,a=r.key;if(8===t.nodeType&&!m.f.aa[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof i&&m.l.w(function(){var r=i(t,g(a),v,n.$data,n);if(r&&r.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&m.B(function(){o(t,g(a),v,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function h(e){return e&&e instanceof m.R?e:new m.R(e)}m.d={};var p={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(e){return m.d[e]},m.R=function(t,r,i,n,o){function a(){var e=d?t():t,o=m.a.c(e);return r?(r.Q&&r.Q(),m.a.extend(c,r),c.Q=u):(c.$parents=[],c.$root=o,c.ko=m),c.$rawData=e,c.$data=o,i&&(c[i]=o),n&&n(c,r,o),c.$data}function s(){return l&&!m.a.Tb(l)}var l,u,c=this,d="function"==typeof t&&!m.I(t);o&&o.exportDependencies?a():(u=m.B(a,null,{ya:s,i:!0}),u.ca()&&(c.Q=u,u.equalityComparer=null,l=[],u.Dc=function(t){l.push(t),m.a.G.qa(t,function(t){m.a.Na(l,t),l.length||(u.k(),c.Q=u=e)})}))},m.R.prototype.createChildContext=function(e,t,r,i){return new m.R(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),r&&r(e)},i)},m.R.prototype.extend=function(e){return new m.R(this.Q||this.$data,this,null,function(t,r){t.$rawData=r.$rawData,m.a.extend(t,"function"==typeof e?e():e)})},m.R.prototype.ac=function(e,t){return this.createChildContext(e,t,null,{exportDependencies:!0})};var f=m.a.e.J(),g=m.a.e.J();m.xc=function(e,t){if(2!=arguments.length)return m.a.e.get(e,g);m.a.e.set(e,g,t),t.Q&&t.Q.Dc(e)},m.La=function(e,t,r){return 1===e.nodeType&&m.f.oc(e),d(e,t,h(r),!0)},m.Ic=function(e,t,r){return r=h(r),m.La(e,a(t,r,e),r)},m.hb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(h(e),t,!0)},m.Ub=function(e,r){if(!n&&t.jQuery&&(n=t.jQuery),r&&1!==r.nodeType&&8!==r.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");r=r||t.document.body,u(h(e),r,!0)},m.nb=function(t){switch(t.nodeType){case 1:case 8:var r=m.xc(t);if(r)return r;if(t.parentNode)return m.nb(t.parentNode)}return e},m.Oc=function(t){return(t=m.nb(t))?t.$data:e},m.b("bindingHandlers",m.d),m.b("applyBindings",m.Ub),m.b("applyBindingsToDescendants",m.hb),m.b("applyBindingAccessorsToNode",m.La),m.b("applyBindingsToNode",m.Ic),m.b("contextFor",m.nb),m.b("dataFor",m.Oc)}(),function(e){function t(t,i){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.Y(i):(s=n[t]=new m.K,s.Y(i),r(t,function(e,r){var i=!(!r||!r.synchronous);o[t]={definition:e,dd:i},delete n[t],a||i?s.notifySubscribers(e):m.Z.Za(function(){s.notifySubscribers(e)})}),a=!0)}function r(e,t){i("getConfig",[e],function(r){r?i("loadComponent",[e,r],function(e){t(e,r)}):t(null,null)})}function i(t,r,n,o){o||(o=m.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,r.concat(function(e){l?n(null):null!==e?n(e):i(t,r,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else i(t,r,n,o)}else n(null)}var n={},o={};m.g={get:function(r,i){var n=o.hasOwnProperty(r)?o[r]:e;n?n.dd?m.l.w(function(){i(n.definition)}):m.Z.Za(function(){i(n.definition)}):t(r,i)},$b:function(e){delete o[e]},Nb:i},m.g.loaders=[],m.b("components",m.g),m.b("components.get",m.g.get),m.b("components.clearCachedDefinition",m.g.$b)}(),function(){function e(e,t,r,i){function n(){0==--s&&i(o)}var o={},s=2,l=r.template;r=r.viewModel,l?a(t,l,function(t){m.g.Nb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),r?a(t,r,function(t){m.g.Nb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(m.a.A(e)){case"script":return m.a.na(e.text);case"textarea":return m.a.na(e.value);case"template":if(o(e.content))return m.a.wa(e.content.childNodes)}return m.a.wa(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,r,i){"string"==typeof r.require?s||t.require?(s||t.require)([r.require],i):e("Uses require, but no AMD loader is present"):i(r)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};m.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(m.g.wb(e))throw Error("Component "+e+" is already registered");u[e]=t},m.g.wb=function(e){return u.hasOwnProperty(e)},m.g.ud=function(e){delete u[e],m.g.$b(e)},m.g.cc={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,r,i){var n=l(t);a(n,r,function(r){e(t,n,r,i)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(m.a.na(i));else if(i instanceof Array)a(i);else if(o(i))a(m.a.W(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";m.b("components.register",m.g.register),m.b("components.isRegistered",m.g.wb),m.b("components.unregister",m.g.ud),m.b("components.defaultLoader",m.g.cc),m.g.loaders.push(m.g.cc),m.g.Ec=u}(),function(){function e(e,r){var i=e.getAttribute("params");if(i){var i=t.parseBindingsString(i,r,e,{valueAccessors:!0,bindingParams:!0}),i=m.a.Ea(i,function(t){return m.m(t,null,{i:e})}),n=m.a.Ea(i,function(t){var r=t.p();return t.ca()?m.m({read:function(){return m.a.c(t())},write:m.Da(r)&&function(e){t()(e)},i:e}):r});return n.hasOwnProperty("$raw")||(n.$raw=i),n}return{$raw:{}}}m.g.getComponentNameForNode=function(e){var t=m.a.A(e);if(m.g.wb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=m.a.C&&e.tagName===t))return t},m.g.Rb=function(t,r,i,n){if(1===r.nodeType){var o=m.g.getComponentNameForNode(r);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(r,i)};t.component=n?function(){return a}:a}}return t};var t=new m.S;9>m.a.C&&(m.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(m.g.register),r.createDocumentFragment=function(e){return function(){var t,r=e(),i=m.g.Ec;for(t in i)i.hasOwnProperty(t)&&r.createElement(t);return r}}(r.createDocumentFragment))}(),function(e){function t(e,t,r){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=m.a.wa(t),m.f.fa(r,e)}function r(e,t,r,i){var n=e.createViewModel;return n?n.call(e,i,{element:t,templateNodes:r}):i}var i=0;m.d.component={init:function(e,n,o,a,s){function l(){var e=u&&u.dispose;"function"==typeof e&&e.call(u),c=u=null}var u,c,d=m.a.W(m.f.childNodes(e));return m.a.G.qa(e,l),m.m(function(){var o,a,h=m.a.c(n());if("string"==typeof h?o=h:(o=m.a.c(h.name),a=m.a.c(h.params)),!o)throw Error("No component name specified");var p=c=++i;m.g.get(o,function(i){if(c===p){if(l(),!i)throw Error("Unknown component '"+o+"'");t(o,i,e);var n=r(i,e,d,a);i=s.createChildContext(n,void 0,function(e){e.$component=n,e.$componentTemplateNodes=d}),u=n,m.hb(i,e)}})},null,{i:e}),{controlsDescendantBindings:!0}}},m.f.aa.component=!0}();var P={class:"className",for:"htmlFor"};m.d.attr={update:function(t,r){var i=m.a.c(r())||{};m.a.D(i,function(r,i){i=m.a.c(i);var n=!1===i||null===i||i===e;n&&t.removeAttribute(r),8>=m.a.C&&r in P?(r=P[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&m.a.vc(t,n?"":i.toString())})}},function(){m.d.checked={after:["value","attr"],init:function(t,r,i){function n(){var e=t.checked,n=p?a():e;if(!m.xa.Va()&&(!l||e)){var o=m.l.w(r);if(c){var s=d?o.p():o;h!==n?(e&&(m.a.ra(s,n,!0),m.a.ra(s,h,!1)),h=n):m.a.ra(s,n,e),d&&m.Da(o)&&o(s)}else m.h.Ga(o,i,"checked",n,!0)}}function o(){var e=m.a.c(r());t.checked=c?0<=m.a.o(e,a()):s?e:a()===e}var a=m.rc(function(){return i.has("checkedValue")?m.a.c(i.get("checkedValue")):i.has("value")?m.a.c(i.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=r(),c=s&&m.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=c?a():e,p=l||c;l&&!t.name&&m.d.uniqueName.init(t,function(){return!0}),m.m(n,null,{i:t}),m.a.q(t,"click",n),m.m(o,null,{i:t}),u=e}}},m.h.ga.checked=!0,m.d.checkedValue={update:function(e,t){e.value=m.a.c(t())}}}(),m.d.css={update:function(e,t){var r=m.a.c(t());null!==r&&"object"==typeof r?m.a.D(r,function(t,r){r=m.a.c(r),m.a.fb(e,t,r)}):(r=m.a.cb(String(r||"")),m.a.fb(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,m.a.fb(e,r,!0))}},m.d.enable={update:function(e,t){var r=m.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},m.d.disable={update:function(e,t){m.d.enable.update(e,function(){return!m.a.c(t())})}},m.d.event={init:function(e,t,r,i,n){var o=t()||{};m.a.D(o,function(o){"string"==typeof o&&m.a.q(e,o,function(e){var a,s=t()[o];if(s){try{var l=m.a.W(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},m.d.foreach={mc:function(e){return function(){var t=e(),r=m.a.Bb(t);return r&&"number"!=typeof r.length?(m.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:m.X.vb}):{foreach:t,templateEngine:m.X.vb}}},init:function(e,t){return m.d.template.init(e,m.d.foreach.mc(t))},update:function(e,t,r,i,n){return m.d.template.update(e,m.d.foreach.mc(t),r,i,n)}},m.h.va.foreach=!1,m.f.aa.foreach=!0,m.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}i=o===e}n=t(),m.h.Ga(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);m.a.q(e,"focus",n),m.a.q(e,"focusin",n),m.a.q(e,"blur",o),m.a.q(e,"focusout",o)},update:function(e,t){var r=!!m.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),!r&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),m.l.w(m.a.Fa,null,[e,r?"focusin":"focusout"]))}},m.h.ga.hasfocus=!0,m.d.hasFocus=m.d.hasfocus,m.h.ga.hasFocus=!0,m.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Eb(e,t())}},f("if"),f("ifnot",!1,!0),f("with",!0,!1,function(e,t){return e.ac(t)});var A={};m.d.options={init:function(e){if("select"!==m.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,r,i){function n(){return m.a.Ma(t.options,function(e){return e.selected})}function o(e,t,r){var i=typeof t;return"function"==i?t(e):"string"==i?e[t]:r}function a(e,r){if(f&&c)m.j.ja(t,m.a.c(i.get("value")),!0);else if(p.length){var n=0<=m.a.o(p,m.j.u(r[0]));m.a.wc(r[0],n),f&&!n&&m.l.w(m.a.Fa,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=m.a.c(r()),c=i.get("valueAllowUnset")&&i.has("value"),d=i.get("optionsIncludeDestroyed");r={};var h,p=[];c||(s?p=m.a.ib(n(),m.j.u):0<=t.selectedIndex&&p.push(m.j.u(t.options[t.selectedIndex]))),u&&(void 0===u.length&&(u=[u]),h=m.a.Ma(u,function(t){return d||t===e||null===t||!m.a.c(t._destroy)}),i.has("optionsCaption")&&null!==(u=m.a.c(i.get("optionsCaption")))&&u!==e&&h.unshift(A));var f=!1;r.beforeRemove=function(e){t.removeChild(e)},u=a,i.has("optionsAfterRender")&&"function"==typeof i.get("optionsAfterRender")&&(u=function(t,r){a(0,r),m.l.w(i.get("optionsAfterRender"),null,[r[0],t!==A?t:e])}),m.a.Db(t,h,function(r,n,a){return a.length&&(p=!c&&a[0].selected?[m.j.u(a[0])]:[],f=!0),n=t.ownerDocument.createElement("option"),r===A?(m.a.bb(n,i.get("optionsCaption")),m.j.ja(n,e)):(a=o(r,i.get("optionsValue"),r),m.j.ja(n,m.a.c(a)),r=o(r,i.get("optionsText"),a),m.a.bb(n,r)),[n]},r,u),m.l.w(function(){c?m.j.ja(t,m.a.c(i.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&m.a.Fa(t,"change")}),m.a.Sc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},m.d.options.zb=m.a.e.J(),m.d.selectedOptions={after:["options","foreach"],init:function(e,t,r){m.a.q(e,"change",function(){var i=t(),n=[];m.a.r(e.getElementsByTagName("option"),function(e){e.selected&&n.push(m.j.u(e))}),m.h.Ga(i,r,"selectedOptions",n)})},update:function(e,t){if("select"!=m.a.A(e))throw Error("values binding applies only to SELECT elements");var r=m.a.c(t()),i=e.scrollTop;r&&"number"==typeof r.length&&m.a.r(e.getElementsByTagName("option"),function(e){var t=0<=m.a.o(r,m.j.u(e));e.selected!=t&&m.a.wc(e,t)}),e.scrollTop=i}},m.h.ga.selectedOptions=!0,m.d.style={update:function(t,r){var i=m.a.c(r()||{});m.a.D(i,function(r,i){i=m.a.c(i),null!==i&&i!==e&&!1!==i||(i=""),t.style[r]=i})}},m.d.submit={init:function(e,t,r,i,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");m.a.q(e,"submit",function(r){var i,o=t();try{i=o.call(n.$data,e)}finally{!0!==i&&(r.preventDefault?r.preventDefault():r.returnValue=!1)}})}},m.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.bb(e,t())}},m.f.aa.text=!0,function(){if(t&&t.navigator)var r=function(e){if(e)return parseFloat(e[1])},i=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=r(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=r(n.match(/Firefox\/([^ ]*)/));if(10>m.a.C)var s=m.a.e.J(),l=m.a.e.J(),u=function(e){var t=this.activeElement;(t=t&&m.a.e.get(t,l))&&t(e)},c=function(e,t){var r=e.ownerDocument;m.a.e.get(r,s)||(m.a.e.set(r,s,!0),m.a.q(r,"selectionchange",u)),m.a.e.set(e,l,t)};m.d.textInput={init:function(t,r,n){function s(e,r){m.a.q(t,e,r)}function l(){var i=m.a.c(r());null!==i&&i!==e||(i=""),p!==e&&i===p?m.a.setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){h||(p=t.value,h=m.a.setTimeout(d,4))}function d(){clearTimeout(h),p=h=e;var i=t.value;f!==i&&(f=i,m.h.Ga(r(),n,"textInput",i))}var h,p,f=t.value,g=9==m.a.C?u:d;10>m.a.C?(s("propertychange",function(e){"value"===e.propertyName&&g(e)}),8==m.a.C&&(s("keyup",d),s("keydown",d)),8<=m.a.C&&(c(t,g),s("dragend",u))):(s("input",d),5>o&&"textarea"===m.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",d),s("dragdrop",d),s("drop",d))),s("change",d),m.m(l,null,{i:t})}},m.h.ga.textInput=!0,m.d.textinput={preprocess:function(e,t,r){r("textInput",e)}}}(),m.d.uniqueName={init:function(e,t){if(t()){var r="ko_unique_"+ ++m.d.uniqueName.Nc;m.a.vc(e,r)}}},m.d.uniqueName.Nc=0,m.d.value={after:["options","foreach"],init:function(e,t,r){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var i=["change"],n=r.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),m.a.ta(i,n),i=m.a.Wb(i));var s=function(){a=null,o=!1;var i=t(),n=m.j.u(e);m.h.Ga(i,r,"value",n)};!m.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=m.a.o(i,"propertychange")||(m.a.q(e,"propertychange",function(){o=!0}),m.a.q(e,"focus",function(){o=!1}),m.a.q(e,"blur",function(){o&&s()})),m.a.r(i,function(t){var r=s;m.a.sd(t,"after")&&(r=function(){a=m.j.u(e),m.a.setTimeout(s,0)},t=t.substring(5)),m.a.q(e,t,r)});var l=function(){var i=m.a.c(t()),n=m.j.u(e);if(null!==a&&i===a)m.a.setTimeout(l,0);else if(i!==n)if("select"===m.a.A(e)){var o=r.get("valueAllowUnset"),n=function(){m.j.ja(e,i,o)};n(),o||i===m.j.u(e)?m.a.setTimeout(n,0):m.l.w(m.a.Fa,null,[e,"change"])}else m.j.ja(e,i)};m.m(l,null,{i:e})}else m.La(e,{checkedValue:t})},update:function(){}},m.h.ga.value=!0,m.d.visible={update:function(e,t){var r=m.a.c(t()),i="none"!=e.style.display;r&&!i?e.style.display="":!r&&i&&(e.style.display="none")}},function(e){m.d[e]={init:function(t,r,i,n,o){return m.d.event.init.call(this,t,function(){var t={};return t[e]=r(),t},i,n,o)}}}("click"),m.P=function(){},m.P.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.P.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.P.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new m.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new m.v.sa(e);throw Error("Unknown template type: "+e)},m.P.prototype.renderTemplate=function(e,t,r,i){return e=this.makeTemplateSource(e,i),this.renderTemplateSource(e,t,r,i)},m.P.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},m.P.prototype.rewriteTemplate=function(e,t,r){e=this.makeTemplateSource(e,r),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},m.b("templateEngine",m.P),m.Ib=function(){function e(e,t,r,i){e=m.h.Ab(e);for(var n=m.h.va,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return r="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.h.Xa(e,{valueAccessors:!0})+" } })()},'"+r.toLowerCase()+"')",i.createJavaScriptEvaluatorBlock(r)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,r=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Tc:function(e,t,r){t.isTemplateRewritten(e,r)||t.rewriteTemplate(e,function(e){return m.Ib.jd(e,t)},r)},jd:function(i,n){return i.replace(t,function(t,r,i,o,a){return e(a,r,i,n)}).replace(r,function(t,r){return e(r,"\x3c!-- ko --\x3e","#comment",n)})},Jc:function(e,t){return m.N.yb(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&m.La(n,e,i)})}}}(),m.b("__tr_ambtns",m.Ib.Jc),function(){m.v={},m.v.n=function(e){if(this.n=e){var t=m.a.A(e);this.eb="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},m.v.n.prototype.text=function(){var e=1===this.eb?"text":2===this.eb?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?m.a.Eb(this.n,t):this.n[e]=t};var t=m.a.e.J()+"_";m.v.n.prototype.data=function(e){if(1===arguments.length)return m.a.e.get(this.n,t+e);m.a.e.set(this.n,t+e,arguments[1])};var r=m.a.e.J();m.v.n.prototype.nodes=function(){var t=this.n;if(0==arguments.length)return(m.a.e.get(t,r)||{}).mb||(3===this.eb?t.content:4===this.eb?t:e);m.a.e.set(t,r,{mb:arguments[0]})},m.v.sa=function(e){this.n=e},m.v.sa.prototype=new m.v.n,m.v.sa.prototype.text=function(){if(0==arguments.length){var t=m.a.e.get(this.n,r)||{};return t.Jb===e&&t.mb&&(t.Jb=t.mb.innerHTML),t.Jb}m.a.e.set(this.n,r,{Jb:arguments[0]})},m.b("templateSources",m.v),m.b("templateSources.domElement",m.v.n),m.b("templateSources.anonymousTemplate",m.v.sa)}(),function(){function t(e,t,r){var i;for(t=m.f.nextSibling(t);e&&(i=e)!==t;)e=m.f.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=m.S.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),m.a.Ba(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.Ub(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.N.Cc(e,[r]) }),m.a.Ba(e,o)}}function i(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&i(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(m.Ib.Tc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":m.f.fa(e,n),l=!0;break;case"replaceNode":m.a.uc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(r(n,o),s.afterRender&&m.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,r){return m.I(e)?e():"function"==typeof e?e(t,r):e}var a;m.Fb=function(t){if(t!=e&&!(t instanceof m.P))throw Error("templateEngine must inherit from ko.templateEngine");a=t},m.Cb=function(t,r,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=i(l);return m.B(function(){var e=r&&r instanceof m.R?r:new m.R(r,null,null,null,{exportDependencies:!0}),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=i(l))},null,{ya:function(){return!c||!m.a.qb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return m.N.yb(function(e){m.Cb(t,r,s,e,"replaceNode")})},m.pd=function(t,i,a,s,l){function u(e,t){r(t,d),a.afterRender&&a.afterRender(t,e),d=null}function c(e,r){return d=l.createChildContext(e,a.as,function(e){e.$index=r}),n(null,"ignoreTargetNode",o(t,e,d),d,a)}var d;return m.B(function(){var t=m.a.c(i)||[];void 0===t.length&&(t=[t]),t=m.a.Ma(t,function(t){return a.includeDestroyed||t===e||null===t||!m.a.c(t._destroy)}),m.l.w(m.a.Db,null,[s,t,c,a,u])},null,{i:s})};var s=m.a.e.J();m.d.template={init:function(e,t){var r=m.a.c(t());if("string"==typeof r||r.name)m.f.za(e);else{if("nodes"in r){if(r=r.nodes||[],m.I(r))throw Error('The "nodes" option must be a plain, non-observable array.')}else r=m.f.childNodes(e);r=m.a.nc(r),new m.v.sa(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(t,r,i,n,o){var a=r();r=m.a.c(a),i=!0,n=null,"string"==typeof r?r={}:(a=r.name,"if"in r&&(i=m.a.c(r.if)),i&&"ifnot"in r&&(i=!m.a.c(r.ifnot))),"foreach"in r?n=m.pd(a||t,i&&r.foreach||[],r,t,o):i?(o="data"in r?o.ac(r.data,r.as):o,n=m.Cb(a||t,o,r,t)):m.f.za(t),o=n,(r=m.a.e.get(t,s))&&"function"==typeof r.k&&r.k(),m.a.e.set(t,s,o&&o.ca()?o:e)}},m.h.va.template=function(e){return e=m.h.Ab(e),1==e.length&&e[0].unknown||m.h.fd(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.f.aa.template=!0}(),m.b("setTemplateEngine",m.Fb),m.b("renderTemplate",m.Cb),m.a.hc=function(e,t,r){if(e.length&&t.length){var i,n,o,a,s;for(i=n=0;(!r||i<r)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),i=o=0;break}i+=o}}},m.a.lb=function(){function e(e,t,r,i,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,g=f-p||1,v=p+f+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(f,o+g),a=d(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||v,s[a-1]||v)+1:a+1:o+1;for(c=[],d=[],g=[],o=p,a=f;o||a;)f=h[o][a]-1,a&&f===h[o][a-1]?d.push(c[c.length]={status:r,value:t[--a],index:a}):o&&f===h[o-1][a]?g.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return m.a.hc(g,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),m.b("utils.compareArrays",m.a.lb),function(){function t(t,r,i,n,o){var a=[],s=m.B(function(){var e=r(i,o,m.a.Ba(a,t))||[];0<a.length&&(m.a.uc(a,e),n&&m.l.w(n,null,[i,e,o])),a.length=0,m.a.ta(a,e)},null,{i:t,ya:function(){return!m.a.Tb(a)}});return{ea:a,B:s.ca()?s:e}}var r=m.a.e.J(),i=m.a.e.J();m.a.Db=function(n,o,a,s,l){function u(e,t){C=h[t],_!==t&&(T[e]=C),C.tb(_++),m.a.Ba(C.ea,n),g.push(C),b.push(C)}function c(e,t){if(e)for(var r=0,i=t.length;r<i;r++)t[r]&&m.a.r(t[r].ea,function(i){e(i,r,t[r].ka)})}o=o||[],s=s||{};var d=m.a.e.get(n,r)===e,h=m.a.e.get(n,r)||[],p=m.a.ib(h,function(e){return e.ka}),f=m.a.lb(p,o,s.dontLimitMoves),g=[],v=0,_=0,y=[],b=[];o=[];for(var C,w,S,T=[],p=[],E=0;w=f[E];E++)switch(S=w.moved,w.status){case"deleted":S===e&&(C=h[v],C.B&&(C.B.k(),C.B=e),m.a.Ba(C.ea,n).length&&(s.beforeRemove&&(g.push(C),b.push(C),C.ka===i?C=null:o[E]=C),C&&y.push.apply(y,C.ea))),v++;break;case"retained":u(E,v++);break;case"added":S!==e?u(E,S):(C={ka:w.value,tb:m.O(_++)},g.push(C),b.push(C),d||(p[E]=C))}m.a.e.set(n,r,g),c(s.beforeMove,T),m.a.r(y,s.beforeRemove?m.ba:m.removeNode);for(var x,E=0,d=m.f.firstChild(n);C=b[E];E++){for(C.ea||m.a.extend(C,t(n,a,C.ka,l,C.tb)),v=0;f=C.ea[v];d=f.nextSibling,x=f,v++)f!==d&&m.f.kc(n,f,x);!C.ad&&l&&(l(C.ka,C.ea,C.tb),C.ad=!0)}for(c(s.beforeRemove,o),E=0;E<o.length;++E)o[E]&&(o[E].ka=i);c(s.afterMove,T),c(s.afterAdd,p)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.Db),m.X=function(){this.allowTemplateRewriting=!1},m.X.prototype=new m.P,m.X.prototype.renderTemplateSource=function(e,t,r,i){return(t=(9>m.a.C?0:e.nodes)?e.nodes():null)?m.a.W(t.cloneNode(!0).childNodes):(e=e.text(),m.a.na(e,i))},m.X.vb=new m.X,m.Fb(m.X.vb),m.b("nativeTemplateEngine",m.X),function(){m.xb=function(){var e=this.ed=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,o,a){if(a=a||r,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=n.extend({koBindingContext:i},o.templateOptions),i=n.tmpl(s,t,i),i.appendTo(a.createElement("div")),n.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")},0<e&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.xb.prototype=new m.P;var e=new m.xb;0<e.ed&&m.Fb(e),m.b("jqueryTmplTemplateEngine",m.xb)}()})}()}(),define("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,r){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return r=r||Object.getOwnPropertyNames(e),r.forEach(function(t){if(t!==d&&t!==h&&!(t in o)){var r=e[t],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&i(n,s)}}),e}function t(e,t){var r=e[d];return!r&&t&&(r={},Object.defineProperty(e,d,{value:r})),r}function r(t,r,i){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof i)o.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=i.get,o.write=i.set}return t[r]=n.computed(o),e.call(n,t,[r]),t}function i(e,t){var r=null;e.computed(function(){r&&(r.dispose(),r=null);var i=t();i instanceof Array&&(r=n(e,t,i))})}function n(e,t,r){return o(e,r).subscribe(t)}function o(e,t){var r=t[h];if(!r){r=new e.subscribable,Object.defineProperty(t,h,{value:r});var i={};a(t,r,i),s(e,t,r,i)}return r}function a(e,t,r){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return!0!==r.pause&&t.notifySubscribers(this),e}})}function s(e,t,r,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return r.notifySubscribers(t),o}})})}function l(e,r){if(!e)return null;var i=t(e,!1);return i&&i[r]||null}function u(e,t){var r=l(e,t);r&&r.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=r}var d="__knockoutObservables",h="__knockoutSubscribable";return{attachToKo:c}}),define("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg";return{register:function(t){t.bindingHandlers.cesiumSvgPath={init:function(r,i){var n=document.createElementNS(e,"svg:svg");n.setAttribute("class","cesium-svgPath-svg");var o=document.createElementNS(e,"path");return n.appendChild(o),t.virtualElements.setDomNodeChildren(r,[n]),t.computed({read:function(){var e=t.unwrap(i());o.setAttribute("d",t.unwrap(e.path));var r=t.unwrap(e.width),a=t.unwrap(e.height);n.setAttribute("width",r),n.setAttribute("height",a),n.setAttribute("viewBox","0 0 "+r+" "+a),e.css&&n.setAttribute("class","cesium-svgPath-svg "+t.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},t.virtualElements.allowedBindings.cesiumSvgPath=!0}}}),define("ThirdParty/knockout",["./knockout-3.4.2","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,r){"use strict";return t.attachToKo(e),r.register(e),e}),define("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,r){var i=document.createElement("source");i.src=r,i.type="video/"+t,e.appendChild(i)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},r={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},i=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",r.WebM),e(this.noSleepVideo,"mp4",r.MP4)),this};return i.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},i.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},i}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("ThirdParty/pako_inflate",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,r,i){function n(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return n(r||e)},c,c.exports,e,t,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(e,t,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+i),n);for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},o={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(i)},{}],2:[function(e,t,r){"use strict";function i(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&o))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}var n=e("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new n.Buf8(256),l=0;l<256;l++)s[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)r=e.charCodeAt(o),55296==(64512&r)&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),a=0,o=0;a<l;o++)r=e.charCodeAt(o),55296==(64512&r)&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return i(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,o,a,l=t||e.length,u=new Array(2*l);for(n=0,r=0;r<l;)if((o=e[r++])<128)u[n++]=o;else if((a=s[o])>4)u[n++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r<l;)o=o<<6|63&e[r++],a--;a>1?u[n++]=65533:o<65536?u[n++]=o:(o-=65536,u[n++]=55296|o>>10&1023,u[n++]=56320|1023&o)}return i(u,n)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";function i(e,t,r,i){for(var n=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do{n=n+t[i++]|0,o=o+n|0}while(--a);n%=65521,o%=65521}return n|o<<16|0}t.exports=i},{}],4:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,r){"use strict";function i(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=i},{}],6:[function(e,t,r){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=i},{}],7:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x;r=e.state,i=e.next_in,E=e.input,n=i+(e.avail_in-5),o=e.next_out,x=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,d=r.wnext,h=r.window,p=r.hold,f=r.bits,m=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,_=(1<<r.distbits)-1;e:do{f<15&&(p+=E[i++]<<f,f+=8,p+=E[i++]<<f,f+=8),y=m[p&v];t:for(;;){if(b=y>>>24,p>>>=b,f-=b,0===(b=y>>>16&255))x[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}C=65535&y,b&=15,b&&(f<b&&(p+=E[i++]<<f,f+=8),C+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=E[i++]<<f,f+=8,p+=E[i++]<<f,f+=8),y=g[p&_];r:for(;;){if(b=y>>>24,p>>>=b,f-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(w=65535&y,b&=15,f<b&&(p+=E[i++]<<f,(f+=8)<b&&(p+=E[i++]<<f,f+=8)),(w+=p&(1<<b)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=b,f-=b,b=o-a,w>b){if((b=w-b)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,T=h,0===d){if(S+=u-b,b<C){C-=b;do{x[o++]=h[S++]}while(--b);S=o-w,T=x}}else if(d<b){if(S+=u+d-b,(b-=d)<C){C-=b;do{x[o++]=h[S++]}while(--b);if(S=0,d<C){b=d,C-=b;do{x[o++]=h[S++]}while(--b);S=o-w,T=x}}}else if(S+=d-b,b<C){C-=b;do{x[o++]=h[S++]}while(--b);S=o-w,T=x}for(;C>2;)x[o++]=T[S++],x[o++]=T[S++],x[o++]=T[S++],C-=3;C&&(x[o++]=T[S++],C>1&&(x[o++]=T[S++]))}else{S=o-w;do{x[o++]=x[S++],x[o++]=x[S++],x[o++]=x[S++],C-=3}while(C>2);C&&(x[o++]=x[S++],C>1&&(x[o++]=x[S++]))}break}}break}}while(i<n&&o<s);C=f>>3,i-=C,f-=C<<3,p&=(1<<f)-1,e.next_in=i,e.next_out=o,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=p,r.bits=f}},{}],8:[function(e,t,r){"use strict";function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new _.Buf16(320),this.work=new _.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new _.Buf32(me),t.distcode=t.distdyn=new _.Buf32(ge),t.sane=1,t.back=-1,D):M}function a(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,o(e)):M}function s(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?M:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,a(e))):M}function l(e,t){var r,i;return e?(i=new n,e.state=i,i.window=null,r=s(e,t),r!==D&&(e.state=null),r):M}function u(e){return l(e,ve)}function c(e){if(_e){var t;for(g=new _.Buf32(512),v=new _.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(w(T,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;w(E,e.lens,0,32,v,0,e.work,{bits:5}),_e=!1}e.lencode=g,e.lenbits=9,e.distcode=v,e.distbits=5}function d(e,t,r,i){var n,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _.Buf8(o.wsize)),i>=o.wsize?(_.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),_.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(_.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function h(e,t){var r,n,o,a,s,l,u,h,p,f,m,g,v,me,ge,ve,_e,ye,be,Ce,we,Se,Te,Ee,xe=0,Pe=new _.Buf8(4),Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return M;r=e.state,r.mode===X&&(r.mode=Q),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,f=l,m=u,Se=D;e:for(;;)switch(r.mode){case F:if(0===r.wrap){r.mode=Q;break}for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(2&r.wrap&&35615===h){r.check=0,Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0),h=0,p=0,r.mode=B;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((15&h)!==k){e.msg="unknown compression method",r.mode=he;break}if(h>>>=4,p-=4,we=8+(15&h),0===r.wbits)r.wbits=we;else if(we>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<<we,e.adler=r.check=1,r.mode=512&h?q:X,h=0,p=0;break;case B:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.flags=h,(255&r.flags)!==k){e.msg="unknown compression method",r.mode=he;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=he;break}r.head&&(r.head.text=h>>8&1),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0,r.mode=U;case U:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.time=h),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,Pe[2]=h>>>16&255,Pe[3]=h>>>24&255,r.check=b(r.check,Pe,4,0)),h=0,p=0,r.mode=V;case V:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.xflags=255&h,r.head.os=h>>8),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0,r.mode=z;case z:if(1024&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length=h,r.head&&(r.head.extra_len=h),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0}else r.head&&(r.head.extra=null);r.mode=G;case G:if(1024&r.flags&&(g=r.length,g>l&&(g=l),g&&(r.head&&(we=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_.arraySet(r.head.extra,n,a,g,we)),512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,r.length-=g),r.length))break e;r.length=0,r.mode=H;case H:if(2048&r.flags){if(0===l)break e;g=0;do{we=n[a+g++],r.head&&we&&r.length<65536&&(r.head.name+=String.fromCharCode(we))}while(we&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,we)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=W;case W:if(4096&r.flags){if(0===l)break e;g=0;do{we=n[a+g++],r.head&&we&&r.length<65536&&(r.head.comment+=String.fromCharCode(we))}while(we&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,we)break e}else r.head&&(r.head.comment=null);r.mode=j;case j:if(512&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(65535&r.check)){e.msg="header crc mismatch",r.mode=he;break}h=0,p=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=X;break;case q:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}e.adler=r.check=i(h),h=0,p=0,r.mode=Y;case Y:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,O;e.adler=r.check=1,r.mode=X;case X:if(t===P||t===A)break e;case Q:if(r.last){h>>>=7&p,p-=7&p,r.mode=ue;break}for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}switch(r.last=1&h,h>>>=1,p-=1,3&h){case 0:r.mode=Z;break;case 1:if(c(r),r.mode=re,t===A){h>>>=2,p-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=he}h>>>=2,p-=2;break;case Z:for(h>>>=7&p,p-=7&p;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=65535&h,h=0,p=0,r.mode=K,t===A)break e;case K:r.mode=J;case J:if(g=r.length){if(g>l&&(g=l),g>u&&(g=u),0===g)break e;_.arraySet(o,n,a,g,s),l-=g,a+=g,u-=g,s+=g,r.length-=g;break}r.mode=X;break;case $:for(;p<14;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.nlen=257+(31&h),h>>>=5,p-=5,r.ndist=1+(31&h),h>>>=5,p-=5,r.ncode=4+(15&h),h>>>=4,p-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.lens[Ae[r.have++]]=7&h,h>>>=3,p-=3}for(;r.have<19;)r.lens[Ae[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Te={bits:r.lenbits},Se=w(S,r.lens,0,19,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Se){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;xe=r.lencode[h&(1<<r.lenbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(_e<16)h>>>=ge,p-=ge,r.lens[r.have++]=_e;else{if(16===_e){for(Ee=ge+2;p<Ee;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h>>>=ge,p-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=he;break}we=r.lens[r.have-1],g=3+(3&h),h>>>=2,p-=2}else if(17===_e){for(Ee=ge+3;p<Ee;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,we=0,g=3+(7&h),h>>>=3,p-=3}else{for(Ee=ge+7;p<Ee;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,we=0,g=11+(127&h),h>>>=7,p-=7}if(r.have+g>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;g--;)r.lens[r.have++]=we}}if(r.mode===he)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,Te={bits:r.lenbits},Se=w(T,r.lens,0,r.nlen,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Se){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,Te={bits:r.distbits},Se=w(E,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Te),r.distbits=Te.bits,Se){e.msg="invalid distances set",r.mode=he;break}if(r.mode=re,t===A)break e;case re:r.mode=ie;case ie:if(l>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,C(e,m),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,r.mode===X&&(r.back=-1);break}for(r.back=0;xe=r.lencode[h&(1<<r.lenbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(ve&&0==(240&ve)){for(ye=ge,be=ve,Ce=_e;xe=r.lencode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,r.length=_e,0===ve){r.mode=le;break}if(32&ve){r.back=-1,r.mode=X;break}if(64&ve){e.msg="invalid literal/length code",r.mode=he;break}r.extra=15&ve,r.mode=ne;case ne:if(r.extra){for(Ee=r.extra;p<Ee;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=oe;case oe:for(;xe=r.distcode[h&(1<<r.distbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(0==(240&ve)){for(ye=ge,be=ve,Ce=_e;xe=r.distcode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,64&ve){e.msg="invalid distance code",r.mode=he;break}r.offset=_e,r.extra=15&ve,r.mode=ae;case ae:if(r.extra){for(Ee=r.extra;p<Ee;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=he;break}r.mode=se;case se:if(0===u)break e;if(g=m-u,r.offset>g){if((g=r.offset-g)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}g>r.wnext?(g-=r.wnext,v=r.wsize-g):v=r.wnext-g,g>r.length&&(g=r.length),me=r.window}else me=o,v=s-r.offset,g=r.length;g>u&&(g=u),u-=g,r.length-=g;do{o[s++]=me[v++]}while(--g);0===r.length&&(r.mode=ie);break;case le:if(0===u)break e;o[s++]=r.length,u--,r.mode=ie;break;case ue:if(r.wrap){for(;p<32;){if(0===l)break e;l--,h|=n[a++]<<p,p+=8}if(m-=u,e.total_out+=m,r.total+=m,m&&(e.adler=r.check=r.flags?b(r.check,o,m,s-m):y(r.check,o,m,s-m)),m=u,(r.flags?h:i(h))!==r.check){e.msg="incorrect data check",r.mode=he;break}h=0,p=0}r.mode=ce;case ce:if(r.wrap&&r.flags){for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=he;break}h=0,p=0}r.mode=de;case de:Se=I;break e;case he:Se=R;break e;case pe:return L;case fe:default:return M}return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,(r.wsize||m!==e.avail_out&&r.mode<he&&(r.mode<ue||t!==x))&&d(e,e.output,e.next_out,m-e.avail_out)?(r.mode=pe,L):(f-=e.avail_in,m-=e.avail_out,e.total_in+=f,e.total_out+=m,r.total+=m,r.wrap&&m&&(e.adler=r.check=r.flags?b(r.check,o,m,e.next_out-m):y(r.check,o,m,e.next_out-m)),e.data_type=r.bits+(r.last?64:0)+(r.mode===X?128:0)+(r.mode===re||r.mode===K?256:0),(0===f&&0===m||t===x)&&Se===D&&(Se=N),Se)}function p(e){if(!e||!e.state)return M;var t=e.state;return t.window&&(t.window=null),e.state=null,D}function f(e,t){var r;return e&&e.state?(r=e.state,0==(2&r.wrap)?M:(r.head=t,t.done=!1,D)):M}function m(e,t){var r,i,n=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==Y?M:r.mode===Y&&(i=1,(i=y(i,t,n,0))!==r.check)?R:d(e,t,n,n)?(r.mode=pe,L):(r.havedict=1,D)):M}var g,v,_=e("../utils/common"),y=e("./adler32"),b=e("./crc32"),C=e("./inffast"),w=e("./inftrees"),S=0,T=1,E=2,x=4,P=5,A=6,D=0,I=1,O=2,M=-2,R=-3,L=-4,N=-5,k=8,F=1,B=2,U=3,V=4,z=5,G=6,H=7,W=8,j=9,q=10,Y=11,X=12,Q=13,Z=14,K=15,J=16,$=17,ee=18,te=19,re=20,ie=21,ne=22,oe=23,ae=24,se=25,le=26,ue=27,ce=28,de=29,he=30,pe=31,fe=32,me=852,ge=592,ve=15,_e=!0;r.inflateReset=a,r.inflateReset2=s,r.inflateResetKeep=o,r.inflateInit=u,r.inflateInit2=l,r.inflate=h,r.inflateEnd=p,r.inflateGetHeader=f,r.inflateSetDictionary=m,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var i=e("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,u,c,d,h){var p,f,m,g,v,_,y,b,C,w=h.bits,S=0,T=0,E=0,x=0,P=0,A=0,D=0,I=0,O=0,M=0,R=null,L=0,N=new i.Buf16(16),k=new i.Buf16(16),F=null,B=0;for(S=0;S<=15;S++)N[S]=0;for(T=0;T<l;T++)N[t[r+T]]++;for(P=w,x=15;x>=1&&0===N[x];x--);if(P>x&&(P=x),0===x)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(E=1;E<x&&0===N[E];E++);for(P<E&&(P=E),I=1,S=1;S<=15;S++)if(I<<=1,(I-=N[S])<0)return-1;if(I>0&&(0===e||1!==x))return-1;for(k[1]=0,S=1;S<15;S++)k[S+1]=k[S]+N[S];for(T=0;T<l;T++)0!==t[r+T]&&(d[k[t[r+T]]++]=T);if(0===e?(R=F=d,_=19):1===e?(R=n,L-=257,F=o,B-=257,_=256):(R=a,F=s,_=-1),M=0,T=0,S=E,v=c,A=P,D=0,m=-1,O=1<<P,g=O-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){y=S-D,d[T]<_?(b=0,C=d[T]):d[T]>_?(b=F[B+d[T]],C=R[L+d[T]]):(b=96,C=0),p=1<<S-D,f=1<<A,E=f;do{f-=p,u[v+(M>>D)+f]=y<<24|b<<16|C|0}while(0!==f);for(p=1<<S-1;M&p;)p>>=1;if(0!==p?(M&=p-1,M+=p):M=0,T++,0==--N[S]){if(S===x)break;S=t[r+d[T]]}if(S>P&&(M&g)!==m){for(0===D&&(D=P),v+=E,A=S-D,I=1<<A;A+D<x&&!((I-=N[A+D])<=0);)A++,I<<=1;if(O+=1<<A,1===e&&O>852||2===e&&O>592)return 1;m=M&g,u[m]=P<<24|A<<16|v-c|0}}return 0!==M&&(u[v+M]=S-D<<24|64<<16|0),h.bits=P,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,r){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null, this.data_type=2,this.adler=0}t.exports=i},{}],"/lib/inflate.js":[function(e,t,r){"use strict";function i(e){if(!(this instanceof i))return new i(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(c[r]);this.header=new h,a.inflateGetHeader(this.strm,this.header)}function n(e,t){var r=new i(t);if(r.push(e,!0),r.err)throw r.msg||c[r.err];return r.result}function o(e,t){return t=t||{},t.raw=!0,n(e,t)}var a=e("./zlib/inflate"),s=e("./utils/common"),l=e("./utils/strings"),u=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),h=e("./zlib/gzheader"),p=Object.prototype.toString;i.prototype.push=function(e,t){var r,i,n,o,c,d,h=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;i=t===~~t?t:!0===t?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?h.input=l.binstring2buf(e):"[object ArrayBuffer]"===p.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new s.Buf8(f),h.next_out=0,h.avail_out=f),r=a.inflate(h,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&m&&(d="string"==typeof m?l.string2buf(m):"[object ArrayBuffer]"===p.call(m)?new Uint8Array(m):m,r=a.inflateSetDictionary(this.strm,d)),r===u.Z_BUF_ERROR&&!0===g&&(r=u.Z_OK,g=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==u.Z_STREAM_END&&(0!==h.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(h.output,h.next_out),o=h.next_out-n,c=l.buf2string(h.output,n),h.next_out=o,h.avail_out=f-o,o&&s.arraySet(h.output,h.output,n,o,0),this.onData(c)):this.onData(s.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),h.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=i,r.inflate=n,r.inflateRaw=o,r.ungzip=n},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,r,i,n,o){return i.call(n,t[r]),e.getObservable(t,r).subscribe(i,n,o)}return t}),define("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(_,e.tagName);for(var r in e)if(e.hasOwnProperty(r)&&"tagName"!==r)if("children"===r){var i,n=e.children.length;for(i=0;i<n;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(y,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(_,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(_,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function d(e,t){var r=t.alpha,i=1-r;return A.red=e.red*i+t.red*r,A.green=e.green*i+t.green*r,A.blue=e.blue*i+t.blue*r,A.toCssColorString()}function h(e,t,r){return l({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]})}function p(e,t,r){return l({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":r},{tagName:"title",textContent:""}]})}function f(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||v===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!i&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),d=n-a-u.left,h=o-s-u.top,p=180*Math.atan2(h,d)/Math.PI+90;p>180&&(p-=360);var f=r.shuttleRingAngle;i||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(v=e,r.shuttleRingDragging=!0,r.shuttleRingAngle=p):p<f?r.slower():p>f&&r.faster(),t.preventDefault()}else e===v&&(v=void 0),r.shuttleRingDragging=!1}function m(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function g(e,t){function r(e){f(E,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(i,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(_,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var d=document.createElementNS(_,"g");this._topG=d,this._realtimeSVG=new m(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new m(h(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new m(h(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new m(h(84,99,"#animation_pathPause"),t.pauseViewModel);var g=document.createElementNS(_,"g");g.appendChild(this._realtimeSVG.svgElement),g.appendChild(this._playReverseSVG.svgElement),g.appendChild(this._playForwardSVG.svgElement),g.appendChild(this._pauseSVG.svgElement);var v=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=v;var b=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=b,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var C=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var w=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var S=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),T=document.createElementNS(_,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(T),d.appendChild(C),d.appendChild(g),T.appendChild(v),T.appendChild(b),T.appendChild(this._shuttleRingPointer),C.appendChild(this._knobOuter),C.appendChild(w),C.appendChild(this._knobDate),C.appendChild(this._knobTime),C.appendChild(this._knobStatus),C.appendChild(S),s.appendChild(d),e.appendChild(s);var E=this;this._mouseCallback=r,v.addEventListener("mousedown",r,!0),v.addEventListener("touchstart",r,!0),b.addEventListener("mousedown",r,!0),b.addEventListener("touchstart",r,!0),document.addEventListener("mousemove",r,!0),document.addEventListener("touchmove",r,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("touchend",r,!0),document.addEventListener("touchcancel",r,!0),this._shuttleRingPointer.addEventListener("mousedown",r,!0),this._shuttleRingPointer.addEventListener("touchstart",r,!0),this._knobOuter.addEventListener("mousedown",r,!0),this._knobOuter.addEventListener("touchstart",r,!0);var x,P=this._knobTime.childNodes[0],A=this._knobDate.childNodes[0],D=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){x!==e&&(x=e,x?E._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):E._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(E._shuttleRingPointer,E._knobOuter,e)}),a(t,"dateLabel",function(e){A.textContent!==e&&(A.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){D.textContent!==e&&(D.textContent=e)})],this.applyThemeChanges(),this.resize()}var v,_="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",b=e.fromCssColorString("rgba(247,250,255,0.384)"),C=e.fromCssColorString("rgba(143,191,255,0.216)"),w=e.fromCssColorString("rgba(153,197,255,0.098)"),S=e.fromCssColorString("rgba(255,255,255,0.086)"),T=e.fromCssColorString("rgba(255,255,255,0.267)"),E=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),P=e.fromCssColorString("rgba(0,0,0,0.5)"),A=new e;return m.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,r=e.length;t<r;t++)e[t].dispose();i(this)},m.prototype.isDestroyed=function(){return!1},m.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},m.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},m.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},r(g.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){t(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var r=this._subscriptions,n=0,o=r.length;n<o;n++)r[n].dispose();return i(this)},g.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=e,n=t;0===e&&0===t?(i=200,n=132):0===e?(n=t,i=t/132*200):0===t&&(i=e,n=e/200*132);var o=i/200,a=n/132;r.style.cssText="width: "+i+"px; height: "+n+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("viewBox","0 0 "+i+" "+n),this._topG.setAttribute("transform","scale("+o+","+a+")"),this._centerX=Math.max(1,100*o),this._centerY=Math.max(1,100*a),this._lastHeight=e,this._lastWidth=t}},g.prototype.applyThemeChanges=function(){if(!document.body.contains(this._container)){if(t(this._observer))return;var e=this;return e._observer=new MutationObserver(function(){document.body.contains(e._container)&&(e._observer.disconnect(),e._observer=void 0,e.applyThemeChanges())}),void e._observer.observe(document,{childList:!0,subtree:!0})}var r=s(this._themeNormal),i=s(this._themeHover),n=s(this._themeSelect),o=s(this._themeDisabled),a=s(this._themeKnob),u=s(this._themePointer),c=s(this._themeSwoosh),h=s(this._themeSwooshHover),p=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(r,b)},{tagName:"stop",offset:"12%","stop-color":d(r,C)},{tagName:"stop",offset:"46%","stop-color":d(r,w)},{tagName:"stop",offset:"81%","stop-color":d(r,S)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(i,b)},{tagName:"stop",offset:"12%","stop-color":d(i,C)},{tagName:"stop",offset:"46%","stop-color":d(i,w)},{tagName:"stop",offset:"81%","stop-color":d(i,S)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,b)},{tagName:"stop",offset:"12%","stop-color":d(n,C)},{tagName:"stop",offset:"46%","stop-color":d(n,w)},{tagName:"stop",offset:"81%","stop-color":d(n,S)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(o,T)},{tagName:"stop",offset:"75%","stop-color":d(o,E)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":h.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(u,P)},{tagName:"stop",offset:"100%","stop-color":d(u,P)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,b)},{tagName:"stop",offset:"60%","stop-color":d(a,x)},{tagName:"stop",offset:"85%","stop-color":d(a,C)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,x)},{tagName:"stop",offset:"60%","stop-color":d(a,b)},{tagName:"stop",offset:"85%","stop-color":d(a,S)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(p,this._defsElement):this._svgNode.appendChild(p),this._defsElement=p},g}),define("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";function a(t,i){function a(){var e,r={args:arguments,cancel:!1};return s.raiseEvent(r),r.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}i=e(i,!0);var s=new n,l=new n;return a.canExecute=i,o.track(a,["canExecute"]),r(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),define("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";function o(t,r){this._command=t,r=e(r,e.EMPTY_OBJECT),this.toggled=e(r.toggled,!1),this.tooltip=e(r.tooltip,""),n.track(this,["toggled","tooltip"])}return r(o.prototype,{command:{get:function(){return this._command}}}),o}),define("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t){return e-t}function h(t,r){var i=e(r,t,d);return i<0?~i:i}function p(e,t){if(Math.abs(e)<=v)return e/v;var r,i,n=v,o=_;return e>0?(r=Math.log(t[t.length-1]),i=(r-0)/(o-n),Math.exp(0+i*(e-n))):(r=Math.log(-t[0]),i=(r-0)/(o-n),-Math.exp(0+i*(Math.abs(e)-n)))}function f(e,t,i){if(i.clockStep===r.SYSTEM_CLOCK)return v;if(Math.abs(e)<=1)return e*v;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=v,l=_;return e>0?(o=Math.log(n),a=(o-0)/(l-s),(Math.log(e)-0)/a+s):(o=Math.log(-t[0]),a=(o-0)/(l-s),-((Math.log(Math.abs(e))-0)/a+s))}function m(e){var i=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m.defaultDateFormatter,this._timeFormatter=m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return i._timeFormatter(i._clockViewModel.currentTime,i)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return i._dateFormatter(i._clockViewModel.currentTime,i)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=i._clockViewModel;if(e.clockStep===r.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1==0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,i._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,_),-_);var t=i._allShuttleRingTicks,n=i._clockViewModel;if(n.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===_)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(i.snapToTicks)o=t[h(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>v?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=i._clockViewModel,r=e.clockRange;if(i.shuttleRingDragging||r===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(r===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=i._clockViewModel;if(e.clockRange===t.UNBOUNDED)return!0;var r=e.systemTime;return a.greaterThanOrEquals(r,e.startTime)&&a.lessThanOrEquals(r,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return i._clockViewModel.shouldAnimate&&(i._canAnimate||i.shuttleRingDragging)});var n=u(function(){var e=i._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:i._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!i._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=i._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=i._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier>0&&e.clockStep!==r.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=u(function(){i._clockViewModel.clockStep=r.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(d,{toggled:s.computed(function(){return e.clockStep===r.SYSTEM_CLOCK}),tooltip:s.computed(function(){return i._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)+1;n<t.length&&(e.multiplier=t[n])})}var g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],v=15,_=105;return m.defaultDateFormatter=function(e,t){var r=a.toGregorianDate(e);return g[r.month-1]+" "+r.day+" "+r.year},m.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],m.defaultTimeFormatter=function(e,t){var r=a.toGregorianDate(e),i=Math.round(r.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",r.hour,r.minute,r.second,i):l("%02d:%02d:%02d UTC",r.hour,r.minute,r.second)},m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m.prototype.setShuttleRingTicks=function(e){var t,r,i,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,r=e.length;t<r;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(d);var a=[];for(r=o.length,t=r-1;t>=0;--t)0!==(i=o[t])&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(m.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),m._maxShuttleRingAngle=_,m._realtimeShuttleRingAngle=v,m}),define("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=r.globe,l=e(r.imageryProviderViewModels,[]),u=e(r.terrainProviderViewModels,[]);this._globe=i,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,r=this.selectedTerrain,i=t(e)?e.name:void 0,n=t(r)?r.name:void 0;return t(i)&&t(n)?i+"\n"+n:t(i)?i:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var r,i=this._currentImageryProviders,n=i.length,a=this._globe.imageryLayers;for(r=0;r<n;r++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===i[r]){a.remove(u);break}}if(t(e)){var d=e.creationCommand();if(o(d)){var h=d.length;for(r=h-1;r>=0;r--)a.addImageryProvider(d[r],0);this._currentImageryProviders=d.slice(0)}else this._currentImageryProviders=[d],a.addImageryProvider(d,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);var r ;t(e)&&(r=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(r instanceof n),this._globe.terrainProvider=r,d(e),this.dropDownVisible=!1}});var h=this;this._toggleDropDown=s(function(){h.dropDownVisible=!h.dropDownVisible}),this.selectedImagery=e(r.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(r.selectedTerrainProviderViewModel,u[0])}return r(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),define("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),i.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(h);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",u.appendChild(m);var g=document.createElement("div");g.className="cesium-baseLayerPicker-choices",g.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(g);var v=document.createElement("div");v.className="cesium-baseLayerPicker-item",v.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),g.appendChild(v);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),v.appendChild(_);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),v.appendChild(y),o.applyBindings(r,i),o.applyBindings(r,u),this._viewModel=r,this._container=e,this._element=i,this._dropPanel=u,this._closeDropDown=function(e){i.contains(e.target)||u.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),r(this)},l}),define("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(t){var r=t.creationFunction;e(r.canExecute)||(r=n(r)),this._creationCommand=r,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,i.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i){"use strict";function n(){var n=[];return n.push(new i({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new r}})),n.push(new i({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel",["../../Core/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/Cesium3DTileColorBlendMode","../../Scene/Cesium3DTileFeature","../../Scene/Cesium3DTileset","../../Scene/Cesium3DTileStyle","../../Scene/PerformanceDisplay","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){return function(t){var i=e._scene.pick(t.position);r(i)&&i.primitive instanceof u&&(e.tileset=i.primitive),e.pickActive=!1}}function f(e,t){t?e._eventHandler.setInputAction(function(t){var i=e._scene.pick(t.endPosition);r(i)&&i.primitive instanceof u&&(e.tileset=i.primitive)},a.MOUSE_MOVE):(e._eventHandler.removeInputAction(a.MOUSE_MOVE),e.picking=e.picking)}function m(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,y):Math.round(t).toLocaleString()}function g(e,t){if(!r(e))return"";var i=e.statistics,n='<ul class="cesium-cesiumInspector-statistics">';return n+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+e._selectedTiles.length.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",n+="</ul>",t||(n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Geometry Memory (MB): </strong>"+m(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+m(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+m(i.batchTableByteLength)+"</li>",n+="</ul>"),n}function v(e,t){var i=this,n=e.canvas;this._eventHandler=new o(n),this._scene=e,this._performanceContainer=t,this._canvas=n,this._performanceDisplay=new d({container:t}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,h.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=h.observable({}),this.properties=[],h.defineProperty(this,"properties",function(){var e=[],t=i._properties();for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e});var u=h.observable();h.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return u()},set:function(e){u(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var c=h.observable();h.defineProperty(this,"colorBlendMode",{get:function(){return c()},set:function(e){c(e),r(i._tileset)&&(i._tileset.colorBlendMode=e)}}),this.colorBlendMode=s.HIGHLIGHT;var m=h.observable();h.defineProperty(this,"picking",{get:function(){return m()},set:function(t){m(t),t?i._eventHandler.setInputAction(function(t){var n=e.pick(t.endPosition);if(n instanceof l?(i.feature=n,i.tile=n.content.tile):r(n)&&r(n.content)?(i.feature=void 0,i.tile=n.content.tile):(i.feature=void 0,i.tile=void 0),r(i._tileset))if(w&&r(n)&&r(n.content)){var o;e.pickPositionSupported&&(o=e.pickPosition(t.endPosition),r(o)&&(i._tileset.debugPickPosition=o)),i._tileset.debugPickedTile=n.content.tile}else i._tileset.debugPickedTile=void 0},a.MOUSE_MOVE):(i.feature=void 0,i.tile=void 0,i._eventHandler.removeInputAction(a.MOUSE_MOVE))}}),this.picking=!0;var g=h.observable();h.defineProperty(this,"colorize",{get:function(){return g()},set:function(e){g(e),r(i._tileset)&&(i._tileset.debugColorizeTiles=e)}}),this.colorize=!1;var v=h.observable();h.defineProperty(this,"wireframe",{get:function(){return v()},set:function(e){v(e),r(i._tileset)&&(i._tileset.debugWireframe=e)}}),this.wireframe=!1;var _=h.observable();h.defineProperty(this,"showBoundingVolumes",{get:function(){return _()},set:function(e){_(e),r(i._tileset)&&(i._tileset.debugShowBoundingVolume=e)}}),this.showBoundingVolumes=!1;var y=h.observable();h.defineProperty(this,"showContentBoundingVolumes",{get:function(){return y()},set:function(e){y(e),r(i._tileset)&&(i._tileset.debugShowContentBoundingVolume=e)}}),this.showContentBoundingVolumes=!1;var b=h.observable();h.defineProperty(this,"showRequestVolumes",{get:function(){return b()},set:function(e){b(e),r(i._tileset)&&(i._tileset.debugShowViewerRequestVolume=e)}}),this.showRequestVolumes=!1;var C=h.observable();h.defineProperty(this,"freezeFrame",{get:function(){return C()},set:function(e){C(e),r(i._tileset)&&(i._tileset.debugFreezeFrame=e,i._scene.debugShowFrustumPlanes=e)}}),this.freezeFrame=!1;var w=h.observable();h.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return w()},set:function(e){w(e),r(i._tileset)&&(i._tileset.debugPickedTileLabelOnly=e)}}),this.showOnlyPickedTileDebugLabel=!1;var S=h.observable();h.defineProperty(this,"showGeometricError",{get:function(){return S()},set:function(e){S(e),r(i._tileset)&&(i._tileset.debugShowGeometricError=e)}}),this.showGeometricError=!1;var T=h.observable();h.defineProperty(this,"showRenderingStatistics",{get:function(){return T()},set:function(e){T(e),r(i._tileset)&&(i._tileset.debugShowRenderingStatistics=e)}}),this.showRenderingStatistics=!1;var E=h.observable();h.defineProperty(this,"showMemoryUsage",{get:function(){return E()},set:function(e){E(e),r(i._tileset)&&(i._tileset.debugShowMemoryUsage=e)}}),this.showMemoryUsage=!1;var x=h.observable();h.defineProperty(this,"showUrl",{get:function(){return x()},set:function(e){x(e),r(i._tileset)&&(i._tileset.debugShowUrl=e)}}),this.showUrl=!1;var P=h.observable();h.defineProperty(this,"maximumScreenSpaceError",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),r(i._tileset)&&(i._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var A=h.observable();h.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(e){e=Number(e),isNaN(e)||(A(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,h.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(e){A(Math.pow(e,6))}});var D=h.observable();h.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var I=p(this),O=h.observable();h.defineProperty(this,"pickActive",{get:function(){return O()},set:function(e){O(e),e?i._eventHandler.setInputAction(I,a.LEFT_CLICK):i._eventHandler.removeInputAction(a.LEFT_CLICK)}}),this.pickActive=!1;var M=h.observable();h.defineProperty(this,"skipLevelOfDetail",{get:function(){return M()},set:function(e){M(e),r(i._tileset)&&(i._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var R=h.observable();h.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),r(i._tileset)&&(i._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var L=h.observable();h.defineProperty(this,"baseScreenSpaceError",{get:function(){return L()},set:function(e){e=Number(e),isNaN(e)||(L(e),r(i._tileset)&&(i._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var N=h.observable();h.defineProperty(this,"skipLevels",{get:function(){return N()},set:function(e){e=Number(e),isNaN(e)||(N(e),r(i._tileset)&&(i._tileset.skipLevels=e))}}),this.skipLevels=1;var k=h.observable();h.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(e){k(e),r(i._tileset)&&(i._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var F=h.observable();h.defineProperty(this,"loadSiblings",{get:function(){F()},set:function(e){F(e),r(i._tileset)&&(i._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],this._removePostRenderEvent=e.postRender.addEventListener(function(){i._update()}),r(this._tileset)||f(this,!0)}function _(e){if(e.featuresLength>0)return!0;var t=e.innerContents;if(r(t)){for(var i=t.length,n=0;n<i;++n)if(!_(t[n]))return!1;return!0}return!1}var y={maximumFractionDigits:3},b=[{text:"Highlight",value:s.HIGHLIGHT},{text:"Replace",value:s.REPLACE},{text:"Mix",value:s.MIX}],C=new t(1,1,0,.4),w=new t,S=new t;return i(v.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},colorBlendModes:{get:function(){return b}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,r(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=i.length,o=0;o<n;++o){var a=i[o];this[a]=this[a]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings}else this._properties({});this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0),f(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature!==e){var i=this._feature;if(r(i)&&!i.content.isDestroyed()){var n=this._scene.frameState;!this.colorize&&r(this._style)?i.color=r(this._style.color)?this._style.color.evaluateColor(n,i,w):t.WHITE:i.color=S}r(e)&&(t.clone(e.color,S),e.color=C),this._feature=e}}},tile:{get:function(){return this._tile},set:function(e){if(this._tile!==e){var i=this._tile;!r(i)||i.isDestroyed()||_(i.content)||(i.color=S),r(e)&&!_(e.content)&&(t.clone(e.color,S),e.color=C),this._tile=e}}}}),v.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},v.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},v.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},v.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},v.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},v.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},v.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},v.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},v.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},v.prototype.trimTilesCache=function(){r(this._tileset)&&this._tileset.trimLoadedTiles()},v.prototype.compileStyle=function(){var e=this._tileset;if(r(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new c(JSON.parse(this.styleString)),this._shouldStyle=!0}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},v.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var r,i=t.target,n=i.selectionStart,o=i.selectionEnd,a=o,s=i.value.slice(n,o),l=s.split("\n"),u=l.length;if(t.shiftKey)for(r=0;r<u;++r)" "===l[r][0]&&(" "===l[r][1]?(l[r]=l[r].substr(2),a-=2):(l[r]=l[r].substr(1),a-=1));else for(r=0;r<u;++r)l[r]=" "+l[r],a+=2;var c=l.join("\n");i.value=i.value.slice(0,n)+c+i.value.slice(o),i.selectionStart=n!==o?n:a,i.selectionEnd=a}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},v.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),r(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0))},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var e=this;return this._definedProperties.forEach(function(t){h.getObservable(e,t).dispose()}),n(this)},v.getStatistics=g,v}),define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector",["../../Core/Check","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","./Cesium3DTilesInspectorViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){e.defined("container",t),e.typeOf.object("scene",r),t=a(t);var i=document.createElement("div"),n=document.createElement("div");n.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : performance, "cesium-cesiumInspector-hide" : !performance}');var l=new s(r,n);this._viewModel=l,this._container=t,this._element=i;var p=document.createElement("div");p.textContent="3D Tiles Inspector",p.className="cesium-cesiumInspector-button",p.setAttribute("data-bind","click: toggleInspector"),i.appendChild(p),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),t.appendChild(i);var f=document.createElement("div"),m=document.createElement("div"),g=document.createElement("div"),v=document.createElement("div"),_=document.createElement("div"),y=document.createElement("div"),b=document.createElement("div"),C=document.createElement("div");C.className="field-group";var w=document.createElement("label");w.className="field-label",w.appendChild(document.createTextNode("Properties: "));var S=document.createElement("div");S.setAttribute("data-bind","text: properties"),C.appendChild(w),C.appendChild(S),f.appendChild(C),f.appendChild(h("togglePickTileset","Pick Tileset","pickActive")),f.appendChild(h("trimTilesCache","Trim Tiles Cache")),f.appendChild(c("picking","Enable Picking")),m.appendChild(c("colorize","Colorize")),m.appendChild(c("wireframe","Wireframe")),m.appendChild(c("showBoundingVolumes","Bounding Volumes")),m.appendChild(c("showContentBoundingVolumes","Content Volumes")),m.appendChild(c("showRequestVolumes","Request Volumes")),g.appendChild(c("freezeFrame","Freeze Frame")),g.appendChild(c("dynamicScreenSpaceError","Dynamic Screen Space Error"));var T=document.createElement("div");T.appendChild(d("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),g.appendChild(T);var E=document.createElement("div");E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : dynamicScreenSpaceError, "cesium-cesiumInspector-hide" : !dynamicScreenSpaceError}'),E.appendChild(d("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),E.appendChild(d("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),g.appendChild(E),v.appendChild(c("performance","Performance")),v.appendChild(n),v.appendChild(c("showStatistics","Statistics"));var x=document.createElement("div");x.className="cesium-3dTilesInspector-statistics",x.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),v.appendChild(x),v.appendChild(c("showPickStatistics","Pick Statistics"));var P=document.createElement("div");P.className="cesium-3dTilesInspector-statistics",P.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),v.appendChild(P),y.appendChild(document.createTextNode("Color Blend Mode: "));var A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),y.appendChild(A);var D=document.createElement("textarea");D.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),y.className="cesium-cesiumInspector-styleEditor",y.appendChild(D);var I=h("compileStyle","Compile (Ctrl+Enter)");y.appendChild(I);var O=document.createElement("div");O.className="cesium-cesiumInspector-error",O.setAttribute("data-bind","text: editorError"),y.appendChild(O),_.appendChild(c("showOnlyPickedTileDebugLabel","Show Picked Only")),_.appendChild(c("showGeometricError","Geometric Error")),_.appendChild(c("showRenderingStatistics","Rendering Statistics")),_.appendChild(c("showMemoryUsage","Memory Usage (MB)")),_.appendChild(c("showUrl","Url")),b.appendChild(c("skipLevelOfDetail","Skip Tile LODs"));var M=document.createElement("div");M.appendChild(d("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),b.appendChild(M);var R=document.createElement("div");R.appendChild(d("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),b.appendChild(R);var L=document.createElement("div") ;L.appendChild(d("skipLevels",0,10,1,"Min. levels to skip")),b.appendChild(L),b.appendChild(c("immediatelyLoadDesiredLevelOfDetail","Load only tiles that meet the max. SSE.")),b.appendChild(c("loadSiblings","Load siblings of visible tiles."));var N=u("Tileset","tilesetVisible","toggleTileset",f),k=u("Display","displayVisible","toggleDisplay",m),F=u("Update","updateVisible","toggleUpdate",g),B=u("Logging","loggingVisible","toggleLogging",v),U=u("Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels",_),V=u("Style","styleVisible","toggleStyle",y),z=u("Optimization","optimizationVisible","toggleOptimization",b);i.appendChild(N),i.appendChild(k),i.appendChild(F),i.appendChild(B),i.appendChild(U),i.appendChild(V),i.appendChild(z),o.applyBindings(l,i)}function u(e,t,r,i){var n=document.createElement("span");n.className="cesium-cesiumInspector-toggleSwitch",n.setAttribute("data-bind","text: "+t+' ? "-" : "+", click: '+r);var o=document.createElement("div");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(n),o.appendChild(document.createTextNode(e));var a=document.createElement("div");a.className="cesium-cesiumInspector-section",a.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : '+t+', "cesium-cesiumInspector-hide" : !'+t+"}"),a.appendChild(i);var s=document.createElement("div");return s.className="cesium-cesiumInspector-dropDown",s.appendChild(o),s.appendChild(a),s}function c(e,t){var r=document.createElement("input");r.type="checkbox",r.setAttribute("data-bind","checked: "+e);var i=document.createElement("div");return i.appendChild(r),i.appendChild(document.createTextNode(t)),i}function d(e,r,i,n,o,a){a=t(a,e);var s=document.createElement("input");s.setAttribute("data-bind","value: "+a),s.type="number";var l=document.createElement("input");l.type="range",l.min=r,l.max=i,l.step=n,l.setAttribute("data-bind",'valueUpdate: "input", value: '+e);var u=document.createElement("div");u.appendChild(l);var c=document.createElement("div");return c.className="cesium-cesiumInspector-slider",c.appendChild(document.createTextNode(o)),c.appendChild(s),c.appendChild(u),c}function h(e,t,i){var n=document.createElement("button");n.type="button",n.textContent=t,n.className="cesium-cesiumInspector-pickButton";var o="click: "+e;return r(i)&&(o+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),n.setAttribute("data-bind",o),n}return i(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 o.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),n(this)},l}),define("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){var r;if(e(t)){r="Command Statistics";var i=t.commandsInFrustums;for(var n in i)if(i.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}r+="<br>    "+i[n]+" in frustum "+o}r+="<br>Total: "+t.totalCommands}return r}function p(e,t,r){var i=Math.min(r,t);return i=Math.max(i,e)}function f(t,r){function i(t){var r=f._scene.pick({x:t.position.x,y:t.position.y});e(r)&&(f.primitive=e(r.collection)?r.collection:r.primitive),f.pickPrimitiveActive=!1}function h(t){var r,i=v.ellipsoid,o=f._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},i);if(e(o))for(var a=i.cartesianToCartographic(o),s=v._surface.tileProvider._tilesToRenderByTextureCount,l=0;!r&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!r&&c<u.length;++c){var d=u[c];n.contains(d.rectangle,a)&&(r=d)}}f.tile=r,f.pickTileActive=!1}var f=this,m=t.canvas,g=new o(m);this._eventHandler=g,this._scene=t,this._canvas=m,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=r;var v=this._scene.globe;v.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",this.generalSwitchText=c.pureComputed(function(){return f.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return f.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return f.terrainVisible?"-":"+"}),c.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=d(function(){f.dropDownVisible=!f.dropDownVisible}),this._toggleGeneral=d(function(){f.generalVisible=!f.generalVisible}),this._togglePrimitives=d(function(){f.primitivesVisible=!f.primitivesVisible}),this._toggleTerrain=d(function(){f.terrainVisible=!f.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){f._scene.debugShowFrustums=e}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?f._performanceDisplay=new l({container:f._performanceContainer}):f._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=d(function(){return f._primitive.debugShowBoundingVolume=f.primitiveBoundingSphere,!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){f._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=d(function(){if(f.primitiveReferenceFrame){var t=f._primitive.modelMatrix;f._modelMatrixPrimitive=new s({modelMatrix:t}),f._scene.primitives.add(f._modelMatrixPrimitive)}else e(f._modelMatrixPrimitive)&&(f._scene.primitives.remove(f._modelMatrixPrimitive),f._modelMatrixPrimitive=void 0);return!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){f._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=d(function(){return f.filterPrimitive?f._scene.debugCommandFilter=function(t){return!(!e(f._modelMatrixPrimitive)||t.owner!==f._modelMatrixPrimitive._primitive)||!!e(f._primitive)&&(t.owner===f._primitive||t.owner===f._primitive._billboardCollection||t.owner.primitive===f._primitive)}:f._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){f._doFilterPrimitive()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){v._surface.tileProvider._debug.wireframe=e}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f.scene.debugShowDepthFrustum=e}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){v._surface._debug.suspendLodUpdate=e,e||(f.filterTile=!1)});var _;this._showTileCoordinates=d(function(){return f.tileCoordinates&&!e(_)?_=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!f.tileCoordinates&&e(_)&&(t.imageryLayers.remove(_),_=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){f._showTileCoordinates()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?v._surface.tileProvider._debug.boundingSphereTile=f._tile:v._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return f.filterTile?(f.suspendUpdates=!0,v._surface._tilesToRender=[],e(f._tile)&&f._tile.renderable&&v._surface._tilesToRender.push(f._tile)):f.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){f.doFilterTile()}),this._pickPrimitive=d(function(){f.pickPrimitiveActive=!f.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?g.setInputAction(i,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._pickTile=d(function(){f.pickTileActive=!f.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?g.setInputAction(h,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._removePostRenderEvent=t.postRender.addEventListener(function(){f._update()})}return t(f.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(t){var r=this._primitive;t!==r&&(this.hasPickedPrimitive=!0,e(r)&&(r.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(t){if(e(t)){this.hasPickedTile=!0;if(t!==this._tile){this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north;var r=t.data;e(r)?this.tileText+="<br>Min: "+r.minimumHeight+" Max: "+r.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),f.prototype._update=function(){this.frustums&&(this.frustumStatisticText=h(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=p(1,e,this.depthFrustum),this.depthFrustumText=this.depthFrustum+" of "+e,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),r(this)},f}),define("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=document.createElement("div"),i=new a(t,r);this._viewModel=i,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var d=document.createElement("span");d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(d),c.appendChild(document.createTextNode("General")),u.appendChild(c);var h=document.createElement("div");h.className="cesium-cesiumInspector-section",h.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(h);var p=document.createElement("div");h.appendChild(p);var f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStatistics",f.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var m=document.createElement("input");m.type="checkbox",m.setAttribute("data-bind","checked: frustums"),p.appendChild(m),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(f);var g=document.createElement("div");h.appendChild(g);var v=document.createElement("input");v.type="checkbox",v.setAttribute("data-bind","checked: frustumPlanes"),g.appendChild(v),g.appendChild(document.createTextNode("Show Frustum Planes"));var _=document.createElement("div");h.appendChild(_);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance"),_.appendChild(y),_.appendChild(document.createTextNode("Performance Display")),r.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(r);var b=document.createElement("div");b.className="cesium-cesiumInspector-shaderCache",b.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(b);var C=document.createElement("div");h.appendChild(C);var w=document.createElement("input");w.type="checkbox",w.setAttribute("data-bind","checked: globeDepth"),C.appendChild(w),C.appendChild(document.createTextNode("Show globe depth"));var S=document.createElement("div");C.appendChild(S);var T=document.createElement("div");h.appendChild(T);var E=document.createElement("input");E.type="checkbox",E.setAttribute("data-bind","checked: pickDepth"),T.appendChild(E),T.appendChild(document.createTextNode("Show pick depth"));var x=document.createElement("div");h.appendChild(x);var P=document.createElement("span");P.setAttribute("data-bind",'html: "     Frustum:"'),x.appendChild(P);var A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),x.appendChild(A);var D=document.createElement("input");D.type="button",D.value="-",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: decrementDepthFrustum"),x.appendChild(D);var I=document.createElement("input");I.type="button",I.value="+",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: incrementDepthFrustum"),x.appendChild(I);var O=document.createElement("div");O.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),O.appendChild(d),O.appendChild(document.createTextNode("Primitives")),u.appendChild(O);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 R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",M.appendChild(R);var L=document.createElement("input");L.type="button",L.value="Pick a primitive",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var N=document.createElement("div");N.className="cesium-cesiumInspector-center",N.appendChild(L),R.appendChild(N);var k=document.createElement("div");R.appendChild(k);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),k.appendChild(F),k.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");R.appendChild(B);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(U),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,R.appendChild(V);var z=document.createElement("input");z.type="checkbox",z.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),V.appendChild(z),V.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(d),G.appendChild(document.createTextNode("Terrain")),u.appendChild(G);var H=document.createElement("div");H.className="cesium-cesiumInspector-section",H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(H);var W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",H.appendChild(W);var j=document.createElement("input");j.type="button",j.value="Pick a tile",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),N=document.createElement("div"),N.appendChild(j),N.className="cesium-cesiumInspector-center",W.appendChild(N);var q=document.createElement("div");W.appendChild(q);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Q=document.createElement("input");Q.type="button",Q.value="NE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectNE");var Z=document.createElement("input");Z.type="button",Z.value="SW",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSW");var K=document.createElement("input");K.type="button",K.value="SE",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",q.className="cesium-cesiumInspector-frustumStatistics",q.appendChild(J),q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",q.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),re=document.createElement("tr"),ie=document.createElement("td");ie.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Q),te.appendChild(ie),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(Z);var le=document.createElement("td");le.appendChild(K),re.appendChild(ae),re.appendChild(se),re.appendChild(le),ee.appendChild(te),ee.appendChild(re),q.appendChild(ee);var ue=document.createElement("div");W.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var de=document.createElement("div");W.appendChild(de);var he=document.createElement("input");he.type="checkbox",he.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),de.appendChild(he),de.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");H.appendChild(pe);var fe=document.createElement("input");fe.type="checkbox",fe.setAttribute("data-bind","checked: wireframe"),pe.appendChild(fe),pe.appendChild(document.createTextNode("Wireframe"));var me=document.createElement("div");H.appendChild(me);var ge=document.createElement("input");ge.type="checkbox",ge.setAttribute("data-bind","checked: suspendUpdates"),me.appendChild(ge),me.appendChild(document.createTextNode("Suspend LOD update"));var ve=document.createElement("div");H.appendChild(ve);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates"),ve.appendChild(_e),ve.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(i,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),r(this)},s}),define("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function E(e){function t(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=i-r;s>a&&(e.resize(),e.render(),r=i-s%a),h(t)}else e.resize(),e.render(),h(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var r=0;h(t)}function x(e){var t=e._canvas,r=t.clientWidth,i=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=r,e._canvasHeight=i,r*=o,i*=o,t.width=r,t.height=i,e._canRender=0!==r&&0!==i}function P(e){var t=e._canvas,r=t.width,i=t.height;if(0!==r&&0!==i){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=r/i:(n.top=n.right*(i/r),n.bottom=-n.top)}}function A(e,a){e=S(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),d=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=d,d&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var h=document.createElement("div");h.className="cesium-widget-credits",(o(a.creditContainer)?S(a.creditContainer):s).appendChild(h);var E=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=h,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=E,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new r,x(this);try{var A=new v({canvas:l,contextOptions:a.contextOptions,creditContainer:h,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=A,A.camera.constrainedAxis=t.UNIT_Z,P(this);var I=n(A.mapProjection.ellipsoid,u.WGS84),O=A.frameState.creditDisplay,M=new i("Cesium",D,"http://cesiumjs.org/");O.addDefaultCredit(M);var R=a.globe;o(R)||(R=new m(I)),!1!==R&&(A.globe=R,A.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new C({sources:{positiveX:T("px"),negativeX:T("mx"),positiveY:T("py"),negativeY:T("my"),positiveZ:T("pz"),negativeZ:T("mz")}})),!1!==L&&(A.skyBox=L,A.sun=new w,A.moon=new g);var N=a.skyAtmosphere;o(N)||(N=new b(I)),!1!==N&&(A.skyAtmosphere=N);var k=!1!==a.globe&&a.imageryProvider;o(k)||(k=new f({url:"https://dev.virtualearth.net"})),!1!==k&&A.imageryLayers.addImageryProvider(k),o(a.terrainProvider)&&!1!==a.globe&&(A.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var F=this;A.renderError.addEventListener(function(e,t){if(F._useDefaultRenderLoop=!1,F._renderLoopRunning=!1,F._showRenderLoopErrors){F.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}})}catch(e){if(E){this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',e)}throw e}} var D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(A.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&E(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),A.prototype.showErrorPanel=function(e,t,r){function i(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),i(),o(window.addEventListener)&&window.addEventListener("resize",i,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var h="(no error details available)";o(r)&&(h=d(r));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(h)),u.appendChild(p);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(f);var m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){o(i)&&o(window.removeEventListener)&&window.removeEventListener("resize",i,!1),n.removeChild(a)},f.appendChild(m),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r)&&(this._forceResize=!1,x(this),P(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},A}),define("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";function s(r){t(r)||(r=new e),this._clock=r,this._eventHelper=new n,this._eventHelper.add(r.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(r.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){r.startTime=e,this.synchronize()},this),this.stopTime=a.observable(r.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){r.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(r.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){r.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(r.multiplier),this.multiplier.subscribe(function(e){r.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(r.clockStep),this.clockStep.subscribe(function(e){r.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(r.clockRange),this.clockRange.subscribe(function(e){r.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(r.canAnimate),this.canAnimate.subscribe(function(e){r.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(r.shouldAnimate),this.shouldAnimate.subscribe(function(e){r.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return r(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},s}),define("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),define("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){var r=this,i=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){i(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),r(this)},l}),define("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=new a(t);r._exitFullScreenPath=u,r._enterFullScreenPath=l;var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),n.applyBindings(r,i),this._container=e,this._viewModel=r,this._element=i}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsGeocoderService","../../Core/CartographicGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/Matrix4","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(n){i(n.geocoderServices)?this._geocoderServices=n.geocoderServices:this._geocoderServices=[new t,new e({scene:n.scene})],this._viewContainer=n.container,this._scene=n.scene,this._flightDuration=n.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new a,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=m,this._adjustSuggestionsScroll=_,this._updateSearchSuggestions=w,this._handleArrowDown=f,this._handleArrowUp=p;var o=this;this._suggestionsVisible=l.pureComputed(function(){var e=l.getObservable(o,"_suggestions"),t=e().length>0,r=l.getObservable(o,"_showSuggestions")();return t&&r}),this._searchCommand=c(function(){if(o._focusTextbox=!1,i(o._selectedSuggestion))return o.activateSuggestion(o._selectedSuggestion),!1;o.hideSuggestions(),o.isSearchInProgress?y(o):v(o,o._geocoderServices)}),this.deselectSuggestion=function(){o._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(r||i)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,n="Enter"===t.key||13===t.keyCode;return i?p(o):r?f(o):n&&o._searchCommand(),!0},this.activateSuggestion=function(e){o.hideSuggestions(),o._searchText=e.displayName;var t=e.destination;C(o),m(o,t)},this.hideSuggestions=function(){o._showSuggestions=!1,o._selectedSuggestion=void 0},this.showSuggestions=function(){o._showSuggestions=!0},this.handleMouseover=function(e,t){e!==o._selectedSuggestion&&(o._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=r(n.autocomplete,!0),this._focusTextbox=!1,l.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=l.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){w(o)}),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function p(e){if(0!==e._suggestions.length){var t,r=e._suggestions.indexOf(e._selectedSuggestion);if(-1===r||0===r)return void(e._selectedSuggestion=void 0);t=r-1,e._selectedSuggestion=e._suggestions[t],_(e,t)}}function f(e){if(0!==e._suggestions.length){var t=e._suggestions.length,r=e._suggestions.indexOf(e._selectedSuggestion),i=(r+1)%t;e._selectedSuggestion=e._suggestions[i],_(e,i)}}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:s.IDENTITY})}function g(e,t,r){return e.then(function(e){return i(e)&&"fulfilled"===e.state&&e.value.length>0?e:t.geocode(r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function v(e,t){var r=e._searchText;if(b(r))return void e.showSuggestions();e._isSearchInProgress=!0;for(var n=u.resolve(),o=0;o<t.length;o++)n=g(n,t[o],r);e._geocodePromise=n,n.then(function(t){if(!n.cancel){e._isSearchInProgress=!1;var o=t.value;if("fulfilled"===t.state&&i(o)&&o.length>0)return e._searchText=o[0].displayName,void m(e,o[0].destination);e._searchText=r+" (not found)"}})}function _(e,t){var r=d(e._viewContainer),i=r.getElementsByClassName("search-results")[0],n=r.getElementsByTagName("li"),o=n[t];if(0===t)return void(i.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>i.clientHeight?i.scrollTop=a+o.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function y(e){e._isSearchInProgress=!1,i(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function b(e){return/^\s*$/.test(e)}function C(e){l.getObservable(e,"_suggestions").removeAll()}function w(e){if(e.autoComplete){var t=e._searchText;if(C(e),!b(t)){var r=u.resolve([]);e._geocoderServices.forEach(function(e){r=r.then(function(r){return r.length>=5?r:e.geocode(t).then(function(e){return r=r.concat(e)})})}),r.then(function(t){for(var r=e._suggestions,i=0;i<t.length;i++)r.push(t[i])})}}}return n(h.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),h.prototype.destroy=function(){this._suggestionSubscription.dispose()},h}),define("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=a(e.container),r=new s(e);r._startSearchPath=u,r._stopSearchPath=c;var i=document.createElement("form");i.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(l),this._textBox=l;var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(d),t.appendChild(i);var h=document.createElement("div");h.className="search-results",h.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var f=document.createElement("li");p.appendChild(f),f.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),h.appendChild(p),t.appendChild(h),o.applyBindings(r,i),o.applyBindings(r,h),this._container=t,this._searchSuggestionsContainer=h,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(r._focusTextbox=!0,r.showSuggestions())},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),r(this)},l}),define("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var r=this;this._command=n(function(){r._scene.camera.flyHome(r._duration)}),this.tooltip="View Home",i.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),define("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(i,s),this._container=e,this._viewModel=i,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,r,i){"use strict";function n(){this._cameraClicked=new r,this._closeClicked=new r,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",i.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,i.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),i.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),define("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){t=s(t);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),t.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-infoBox-close",d.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),d.innerHTML="×",n.appendChild(d);var h=document.createElement("iframe");h.className="cesium-infoBox-iframe",h.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),h.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),h.setAttribute("allowfullscreen",!0),n.appendChild(h);var p=new u;a.applyBindings(p,n),this._container=t,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var t=h.contentDocument,o=t.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=t.createElement("div");a.className="cesium-infoBox-description",t.head.appendChild(o),t.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var t=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=r.fromCssColorString(l);i(u)&&0!==u.alpha&&(t=s["background-color"])}}n.style["background-color"]=t;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return n(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(),o(this)},c}),define("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,r){"use strict";function i(){this.showInstructions=!1;var e=this;this._command=r(function(){e.showInstructions=!e.showInstructions}),this._showClick=r(function(){e._touch=!1}),this._showTouch=r(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(i.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),i}),define("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r){var i=l(r.container),n=new u,o=t(r.instructionsInitiallyVisible,!1);n.showInstructions=o, n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",i.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",d.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(d);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Mouse"));var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-right",m.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var g=document.createElement("img");g.src=e("Widgets/Images/NavigationHelp/Touch.svg"),g.className="cesium-navigation-button-icon",g.style.width="25px",g.style.height="25px",m.appendChild(g),m.appendChild(document.createTextNode("Touch")),h.appendChild(p),h.appendChild(m);var v=document.createElement("div");v.className="cesium-click-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',h.appendChild(v);var _=document.createElement("div");_.className="cesium-touch-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),_.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',h.appendChild(_),s.applyBindings(n,c),this._container=i,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return i(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),define("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var r=this;this._dismissMessage=s(function(){r.showingLowFrameRateMessage=!1,r.lowFrameRateMessageDismissed=!0});var i=o.fromScene(t.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener(function(){r.lowFrameRateMessageDismissed||(r.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener(function(){r.showingLowFrameRateMessage=!1})}return r(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i(this)},l}),define("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t=o(e.container),r=new a(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),i.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(l),t.appendChild(i),n.applyBindings(r,i),this._container=t,this._viewModel=r,this._element=i}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/ProjectionPicker/ProjectionPickerViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/OrthographicFrustum","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){this._scene=t,this._orthographic=t.camera.frustum instanceof o,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=t.mode,s.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var r=this;s.defineProperty(this,"selectedTooltip",function(){return r._orthographic?r.tooltipOrthographic:r.tooltipPerspective}),this._toggleDropDown=l(function(){r.sceneMode===a.SCENE2D||r._flightInProgress||(r.dropDownVisible=!r.dropDownVisible)}),this._eventHelper=new n,this._eventHelper.add(t.morphComplete,function(e,t,i,n){r.sceneMode=i,r._orthographic=i===a.SCENE2D||r._scene.camera.frustum instanceof o}),this._eventHelper.add(t.preRender,function(){r._flightInProgress=e(t.camera._currentFlight)}),this._switchToPerspective=l(function(){r.sceneMode!==a.SCENE2D&&(r._scene.camera.switchToPerspectiveFrustum(),r._orthographic=!1,r.dropDownVisible=!1)}),this._switchToOrthographic=l(function(){r.sceneMode!==a.SCENE2D&&(r._scene.camera.switchToOrthographicFrustum(),r._orthographic=!0,r.dropDownVisible=!1)}),this._sceneMode=a}return t(u.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),define("Widgets/ProjectionPicker/ProjectionPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./ProjectionPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t);r._perspectivePath=u,r._orthographicPath=c;var i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button",l.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),l.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',i.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",d.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(d);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",h.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(h),o.applyBindings(r,i),this._viewModel=r,this._container=e,this._wrapper=i,this._closeDropDown=function(e){i.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",c="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},l}),define("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r){this._scene=t;var i=this,n=function(e,t,r,n){i.sceneMode=r,i.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(r,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=i.sceneMode;return e===a.SCENE2D?i.tooltip2D:e===a.SCENE3D?i.tooltip3D:i.tooltipColumbusView}),this._toggleDropDown=l(function(){i.dropDownVisible=!i.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(i._duration)}),this._morphTo3D=l(function(){t.morphTo3D(i._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(i._duration)}),this._sceneMode=a}return r(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},u}),define("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){e=a(e);var i=new s(t,r);i._globePath=u,i._flatMapPath=c,i._columbusViewPath=d;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),h.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',l.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(f);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(m),o.applyBindings(i,l),this._viewModel=i,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",d="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},l}),define("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,i,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=i,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&r(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,r){return a.wgs84ToWindowCoordinates(e,t,r)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&r(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(r(e)){var t=this._container,i=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),i+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},i(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),define("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var r=document.createElement("div");r.className="cesium-selection-wrapper",r.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(r),this._element=r;var i="http://www.w3.org/2000/svg",s=document.createElementNS(i,"svg:svg");s.setAttribute("width",160),s.setAttribute("height",160),s.setAttribute("viewBox","0 0 160 160");var l=document.createElementNS(i,"g");l.setAttribute("transform","translate(80,80)"),s.appendChild(l);var u=document.createElementNS(i,"path");u.setAttribute("data-bind","attr: { transform: _transform }"),u.setAttribute("d","M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z"),l.appendChild(u),r.appendChild(s);var c=new a(t,this._element,this._container);this._viewModel=c,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){ return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),r(this)},s}),define("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function r(t,r,i){this._color=t,this._height=r,this._base=e(i,0)}return r.prototype.getHeight=function(){return this._height},r.prototype.getBase=function(){return this._base},r.prototype.getStartTime=function(){return this._start},r.prototype.getStopTime=function(){return this._stop},r.prototype.setRange=function(e,t){this._start=e,this._stop=t},r.prototype.render=function(e){var r="";if(this._start&&this._stop&&this._color){var i=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(i)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(r='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return r},r}),define("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,r){"use strict";function i(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return i.prototype.render=function(e,i){var n=this.interval.start,o=this.interval.stop,a=i.startJulian,s=r.addSeconds(i.startJulian,i.duration,new r);if(r.lessThan(n,a)&&r.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height);else if(r.lessThanOrEquals(n,s)&&r.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<i.timeBarWidth;++l){var d=r.addSeconds(i.startJulian,l/i.timeBarWidth*i.duration,new r);!t(u)&&r.greaterThanOrEquals(d,n)?u=l:!t(c)&&r.greaterThanOrEquals(d,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height),t(u)&&(t(c)||(c=i.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,i.y,Math.max(c-u,1),this.height))}},i}),define("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var r=document.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=_.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=d(this),this._onMouseMove=h(this),this._onMouseWheel=p(this),this._onTouchStart=f(this),this._onTouchMove=g(this),this._onTouchEnd=m(this);var i=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),i.addEventListener("mousedown",this._onMouseDown,!1),i.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),i.addEventListener("mousewheel",this._onMouseWheel,!1),i.addEventListener("touchstart",this._onTouchStart,!1),i.addEventListener("touchmove",this._onTouchMove,!1),i.addEventListener("touchend",this._onTouchEnd,!1),i.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function d(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var r;if(e._mouseMode===_.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var o=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===_.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function p(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;v=Math.max(Math.min(Math.abs(r),v),1),r/=v,e.zoomFrom(Math.pow(1.05,-r))}}function f(e){return function(t){var r,i,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===o?(r=n.secondsDifference(e._scrubJulian,e._startJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function m(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=_.touchOnly,1!==r?e._touchMode=r>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function g(e){return function(r){var i,o,a,s,l,u,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(r.preventDefault(),1===r.changedTouches.length&&(o=r.changedTouches[0].clientX-d)>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth)):e._touchMode===y.slideZoom&&(a=r.touches.length,2===a?(s=.5*(r.touches[0].clientX+r.touches[1].clientX)-d,l=Math.abs(r.touches[0].clientX-r.touches[1].clientX)):1===a&&(s=r.touches[0].clientX-d,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(i=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,i*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var v=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},b=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),r(this)},l.prototype.addHighlightRange=function(e,t,r){var i=new a(e,t,r);return this._highlightRanges.push(i),this.resize(),i},l.prototype.addTrack=function(e,t,r,i){var n=new s(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,r){if(this._startJulian=t,this._endJulian=r,this._timeBarSecondsSpan=n.secondsDifference(r,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var i=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,i),s=n.secondsDifference(i,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=i,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,r*e-r,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(y/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-y)/p}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var d="",h=0,p=this._timeBarSecondsSpan;p<.01?(p=.01,this._timeBarSecondsSpan=.01,this._endJulian=n.addSeconds(this._startJulian,.01,new n)):p>31536e6&&(p=31536e6,this._timeBarSecondsSpan=31536e6,this._endJulian=n.addSeconds(this._startJulian,31536e6,new n));var f=this._timeBarEle.clientWidth;f<10&&(f=10);var m,g=this._startJulian,v=Math.min(p/f*1e-5,.4),_=n.toGregorianDate(g);m=p>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(_.year/100),0))):p>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(_.year/10),0))):p>86400?n.fromDate(new Date(Date.UTC(_.year,0))):n.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));var y=n.secondsDifference(this._startJulian,n.addSeconds(m,v,new n)),C=y+p;this._epochJulian=m,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-.01,new n));var w=this._rulerEle.offsetWidth+20;w<30&&(w=180);var S=h;h-=1e-10;var T={startTime:y,startJulian:g,epochJulian:m,duration:p,timeBarWidth:f,getAlpha:r};this._highlightRanges.forEach(function(e){d+=e.render(T)});var E=0,x=0,P=0,A=w/f;A>1&&(A=1),A*=this._timeBarSecondsSpan;var D,I=-1,O=-1,M=b.length;for(D=0;D<M;++D){var R=b[D];if(++I,E=R,R>A&&R>h)break;O<0&&f*(R/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=I)}if(I>0){for(;I>0;)if(--I,Math.abs(i(E,b[I]))<1e-5){b[I]>=h&&(x=b[I]);break}if(O>=0)for(;O<I;){if(Math.abs(i(x,b[O]))<1e-5&&b[O]>=h){P=b[O];break}++O}}(h=S)>1e-10&&P<1e-5&&Math.abs(h-E)>1e-10&&(P=h,h<=E+1e-10&&(x=0));var L,N=-999999;if(f*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);o<=C;o=t(o,P))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(f*r(o)).toString()+'px;"></span>';if(f*(x/this._timeBarSecondsSpan)>=3)for(o=e(x);o<=C;o=t(o,x))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(f*r(o)).toString()+'px;"></span>';if(f*(E/this._timeBarSecondsSpan)>=2){this._mainTicSpan=E,C+=E,o=e(E);for(var k=n.computeTaiMinusUtc(m);o<=C;){var F=n.addSeconds(g,o-y,new n);if(E>2.1){var B=n.computeTaiMinusUtc(F);Math.abs(B-k)>.1&&(o+=B-k,F=n.addSeconds(g,o-y,new n))}var U=Math.round(f*r(o)),V=this.makeLabel(F);this._rulerEle.innerHTML=V,L=this._rulerEle.offsetWidth,L<10&&(L=w);var z=U-(L/2-1);z>N?(N=z+L+5,d+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+z.toString()+'px;">'+V+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,E)}}else this._mainTicSpan=-1;d+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=d,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach(function(e){e.render(c._context,T),T.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var r=n.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(r*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),define("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Core/OrthographicFrustum","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e){var r=!1,i=window.screen;return t(i)&&(t(i.lockOrientation)?r=i.lockOrientation(e):t(i.mozLockOrientation)?r=i.mozLockOrientation(e):t(i.msLockOrientation)?r=i.msLockOrientation(e):t(i.orientation&&i.orientation.lock)&&(r=i.orientation.lock(e))),r}function p(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function f(e,t,r,i){i()||(r()?(t.useWebVR=!1,e._locked&&(p(),e._locked=!1),e._noSleep.disable(),a.exitFullscreen(),r(!1)):(a.fullscreen||a.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=h("landscape")),t.useWebVR=!0,r(!0)))}function m(t,r){var i=this,n=l.observable(a.enabled),h=l.observable(!1);this.isVRMode=void 0,l.defineProperty(this,"isVRMode",{get:function(){return h()}}),this.isVREnabled=void 0,l.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&a.enabled)}}),this.tooltip=void 0,l.defineProperty(this,"tooltip",function(){return n()?h()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var m=l.observable(!1);this._isOrthographic=void 0,l.defineProperty(this,"_isOrthographic",{get:function(){return m()}}),this._eventHelper=new o,this._eventHelper.add(t.preRender,function(){m(t.camera.frustum instanceof s)}),this._locked=!1,this._noSleep=new u,this._command=c(function(){f(i,t,h,m)},l.getObservable(this,"isVREnabled")),this._vrElement=e(d(r),document.body),this._callback=function(){!a.fullscreen&&h()&&(t.useWebVR=!1,i._locked&&(p(),i._locked=!1),i._noSleep.disable(),h(!1))},document.addEventListener(a.changeEventName,this._callback)}return r(m.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(a.changeEventName,this._callback),i(this)},m}),define("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._exitVRPath=u,i._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(s),n.applyBindings(i,s),this._container=e,this._viewModel=i,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/Clock","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../ProjectionPicker/ProjectionPicker","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H){"use strict";function W(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function j(e,t){var r=e.scene.pick(t.position);if(n(r)){var o=i(r.id,r.primitive.id);if(o instanceof _)return o}if(n(e.scene.globe))return Y(e,t.position)}function q(e,t,r){if(n(r)){var i=r.clock;n(i)&&(i.getValue(t),n(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}}function Y(e,t){var r=e.scene,i=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(i,r);if(n(o)){var a=new _({id:"Loading...",description:"Loading feature information..."});return T(o,function(t){if(e.selectedEntity===a){if(!n(t)||0===t.length)return void(e.selectedEntity=X());var r=t[0],i=new _({id:r.name,description:r.description});if(n(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,ie);i.position=new m(o)}e.selectedEntity=i}},function(){e.selectedEntity===a&&(e.selectedEntity=X())}),a}}function X(){return new _({id:"None",description:"No features found."})}function Q(e,t){var r=e._geocoder,i=e._homeButton,o=e._sceneModePicker,a=e._projectionPicker,s=e._baseLayerPicker,l=e._animation,u=e._timeline,c=e._fullscreenButton,d=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(n(r)&&(r.container.style.visibility=p),n(i)&&(i.container.style.visibility=p),n(o)&&(o.container.style.visibility=p),n(a)&&(a.container.style.visibility=p),n(s)&&(s.container.style.visibility=p),n(l)&&(l.container.style.visibility=p),n(u)&&(u.container.style.visibility=p),n(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=p),n(d)&&(d.container.style.visibility=p),n(h)&&(h.container.style.visibility=p),e._container){var f=t||!n(c)?0:c.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function Z(e,t){function o(e){var t=j(d,e);n(t)&&(b.getValueOrUndefined(t.position,d.clock.currentTime)?d.trackedEntity=t:d.zoomTo(t))}function a(e){d.selectedEntity=j(d,e)}e=L(e),t=i(t,i.EMPTY_OBJECT);var s=!(n(t.globe)&&!1===t.globe||n(t.baseLayerPicker)&&!1===t.baseLayerPicker),d=this,h=document.createElement("div");h.className="cesium-viewer",e.appendChild(h);var f=document.createElement("div");f.className="cesium-viewer-cesiumWidgetContainer",h.appendChild(f);var m=document.createElement("div");m.className="cesium-viewer-bottom",h.appendChild(m);var _,y,C=i(t.scene3DOnly,!1),w=!1;n(t.clockViewModel)?(y=t.clockViewModel,_=y.clock):(_=new r,y=new O(_),w=!0);var T=new I(f,{terrainProvider:t.terrainProvider,imageryProvider:!s&&t.imageryProvider,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:n(t.creditContainer)?t.creditContainer:m,scene3DOnly:C,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),q=t.dataSources,Y=!1;n(q)||(q=new g,Y=!0);var X=new v({scene:T.scene,dataSourceCollection:q}),K=new u;K.add(_.onTick,Z.prototype._onTick,this),K.add(T.scene.morphStart,Z.prototype._clearTrackedObject,this);var J;if(!n(t.selectionIndicator)||!1!==t.selectionIndicator){var $=document.createElement("div");$.className="cesium-viewer-selectionIndicatorContainer",h.appendChild($),J=new V($,T.scene)}var ee;if(!n(t.infoBox)||!1!==t.infoBox){var te=document.createElement("div");te.className="cesium-viewer-infoBoxContainer",h.appendChild(te),ee=new k(te);var re=ee.viewModel;K.add(re.cameraClicked,Z.prototype._onInfoBoxCameraClicked,this),K.add(re.closeClicked,Z.prototype._onInfoBoxClockClicked,this)}var ie=document.createElement("div");ie.className="cesium-viewer-toolbar",h.appendChild(ie);var ne;if(!n(t.geocoder)||!1!==t.geocoder){var oe=document.createElement("div");oe.className="cesium-viewer-geocoderContainer",ie.appendChild(oe),ne=new R({container:oe,geocoderServices:n(t.geocoder)?c(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:T.scene}),K.add(ne.viewModel.search.beforeExecute,Z.prototype._clearObjects,this)}var ae;n(t.homeButton)&&!1===t.homeButton||(ae=new N(ie,T.scene),n(ne)&&K.add(ae.viewModel.command.afterExecute,function(){var e=ne.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),K.add(ae.viewModel.command.beforeExecute,Z.prototype._clearTrackedObject,this));var se;C||n(t.sceneModePicker)&&!1===t.sceneModePicker||(se=new U(ie,T.scene));var le;t.projectionPicker&&(le=new B(ie,T.scene));var ue,ce;if(s){var de=i(t.imageryProviderViewModels,A()),he=i(t.terrainProviderViewModels,D());ue=new P(ie,{globe:T.scene.globe,imageryProviderViewModels:de,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:he,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});ce=ie.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}var pe;if(!n(t.navigationHelpButton)||!1!==t.navigationHelpButton){var fe=!0;try{if(n(window.localStorage)){var me=window.localStorage.getItem("cesium-hasSeenNavHelp");n(me)&&Boolean(me)?fe=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}pe=new F({container:ie,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,fe)})}var ge;if(!n(t.animation)||!1!==t.animation){var ve=document.createElement("div");ve.className="cesium-viewer-animationContainer",h.appendChild(ve),ge=new E(ve,new x(y))}var _e;if(!n(t.timeline)||!1!==t.timeline){var ye=document.createElement("div");ye.className="cesium-viewer-timelineContainer",h.appendChild(ye),_e=new G(ye,_),_e.addEventListener("settime",W,!1),_e.zoomTo(_.startTime,_.stopTime)}var be,Ce,we;n(t.fullscreenButton)&&!1===t.fullscreenButton||(we=document.createElement("div"),we.className="cesium-viewer-fullscreenContainer",h.appendChild(we),be=new M(we,t.fullscreenElement),Ce=z(be.viewModel,"isFullscreenEnabled",function(e){we.style.display=e?"block":"none",n(_e)&&(_e.container.style.right=we.clientWidth+"px",_e.resize())}));var Se,Te,Ee;if(t.vrButton){var xe=document.createElement("div");xe.className="cesium-viewer-vrContainer",h.appendChild(xe),Se=new H(xe,T.scene,t.fullScreenElement),Te=z(Se.viewModel,"isVREnabled",function(e){xe.style.display=e?"block":"none",n(be)&&(xe.style.right=we.clientWidth+"px"),n(_e)&&(_e.container.style.right=xe.clientWidth+"px",_e.resize())}),Ee=z(Se.viewModel,"isVRMode",function(e){Q(d,e)})}this._baseLayerPickerDropDown=ce,this._fullscreenSubscription=Ce,this._vrSubscription=Te,this._vrModeSubscription=Ee,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=m,this._element=h,this._cesiumWidget=T,this._selectionIndicator=J,this._infoBox=ee,this._dataSourceCollection=q,this._destroyDataSourceCollection=Y,this._dataSourceDisplay=X,this._clockViewModel=y,this._destroyClockViewModel=w,this._toolbar=ie,this._homeButton=ae,this._sceneModePicker=se,this._projectionPicker=le,this._baseLayerPicker=ue,this._navigationHelpButton=pe,this._animation=ge,this._timeline=_e,this._fullscreenButton=be,this._vrButton=Se,this._geocoder=ne,this._eventHelper=K,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=n(ee)||n(J),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new l,this._trackedEntityChanged=new l,S.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),K.add(q.dataSourceAdded,Z.prototype._onDataSourceAdded,this),K.add(q.dataSourceRemoved,Z.prototype._onDataSourceRemoved,this),K.add(T.scene.preRender,Z.prototype.resize,this),K.add(T.scene.postRender,Z.prototype._postRender,this);for(var Pe=q.length,Ae=0;Ae<Pe;Ae++)this._dataSourceAdded(q,q.get(Ae));this._dataSourceAdded(void 0,X.defaultDataSource),K.add(q.dataSourceAdded,Z.prototype._dataSourceAdded,this),K.add(q.dataSourceRemoved,Z.prototype._dataSourceRemoved,this),T.screenSpaceEventHandler.setInputAction(a,p.LEFT_CLICK),T.screenSpaceEventHandler.setInputAction(o,p.LEFT_DOUBLE_CLICK)}function K(e,t,r,o){$(e);var a=T.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=r,T(t,function(t){if(e._zoomPromise===a){if(t instanceof C)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)}) ;if(t.isLoading&&n(t.loadingEvent))var r=t.loadingEvent.addEventListener(function(){r(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(c(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),n(t.entities)&&(t=t.entities.values),c(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function J(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function $(e){var t=e._zoomPromise;n(t)&&(J(e),t.resolve(!1))}function ee(t){var r=t._zoomTarget;if(n(r)&&t.scene.mode!==w.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(r instanceof h){var u={destination:r,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(u):(a.setView(u),s.resolve(!0)),void J(t)}for(var c=[],p=0,m=r.length;p<m;p++){var g=t._dataSourceDisplay.getBoundingSphere(r[p],!1,re);if(g===f.PENDING)return;g!==f.FAILED&&c.push(e.clone(re))}if(0===c.length)return void $(t);t.trackedEntity=void 0;var v=e.fromBoundingSpheres(c);t._zoomIsFlight?(J(t),a.flyToBoundingSphere(v,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(v,t._zoomOptions),a.lookAtTransform(d.IDENTITY),J(t),s.resolve(!0))}}function te(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,r=e.clock.currentTime,i=b.getValueOrUndefined(t.position,r);if(n(i)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,re);if(a!==f.PENDING){var s=o.mode;s!==w.COLUMBUS_VIEW&&s!==w.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==w.COLUMBUS_VIEW&&s!==w.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==f.FAILED?re:void 0;e._entityView=new y(t,o,o.mapProjection.ellipsoid),e._entityView.update(r,l),e._needTrackedEntityUpdate=!1}}}}var re=new e,ie=new t;return o(Z.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,$(this);var t=this.scene,r=t.mode;n(e)&&n(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,r!==w.COLUMBUS_VIEW&&r!==w.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),r!==w.COLUMBUS_VIEW&&r!==w.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(d.IDENTITY)),this._trackedEntityChanged.raiseEvent(e)}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=n(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;n(e)?n(t)&&t.animateAppear():n(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,q(this._timeline,this.clock,e))}}}),Z.prototype.extend=function(e,t){e(this,t)},Z.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,r=t.clientWidth,i=t.clientHeight,o=n(this._animation),a=n(this._timeline);if(this._forceResize||r!==this._lastWidth||i!==this._lastHeight){e.resize(),this._forceResize=!1;var s=i-125,l=this._baseLayerPickerDropDown;if(n(l)&&(l.style.maxHeight=s+"px"),n(this._geocoder)){this._geocoder.searchSuggestionsContainer.style.maxHeight=s+"px"}n(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,d=0,h=0,p=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var f=this._lastWidth;u=this._animation.container,r>900?(d=169,f<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):r>=600?(d=136,(f<600||f>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(d=106,(f>600||0===f)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=d+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var m=this._fullscreenButton,g=this._vrButton,v=c.container,_=v.style;p=v.clientHeight+3,_.left=d+"px";var y=0;n(m)&&(y+=m.container.clientWidth),n(g)&&(y+=g.container.clientWidth),_.right=y+"px",c.resize()}this._bottomContainer.style.left=h+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=r,this._lastHeight=i}},Z.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Z.prototype.render=function(){this._cesiumWidget.render()},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(p.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(p.LEFT_DOUBLE_CLICK);var t=this.dataSources,r=t.length;for(e=0;e<r;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),n(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),n(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),n(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),n(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),n(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),n(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),n(this._timeline)&&(this._timeline.removeEventListener("settime",W,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),n(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),n(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),n(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),n(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),a(this)},Z.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Z.prototype._onEntityCollectionChanged,this)},Z.prototype._dataSourceRemoved=function(e,t){var r=t.entities;r.collectionChanged.removeEventListener(Z.prototype._onEntityCollectionChanged,this),n(this.trackedEntity)&&r.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),n(this.selectedEntity)&&r.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Z.prototype._onTick=function(e){var r=e.currentTime,o=this._dataSourceDisplay.update(r);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(n(a)){var s=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(s,!1,re)===f.DONE&&a.update(r,re)}var l,u=!1,c=this.selectedEntity,d=n(c)&&this._enableInfoOrSelection;if(d&&c.isShowing&&c.isAvailable(r)){this._dataSourceDisplay.getBoundingSphere(c,!0,re)!==f.FAILED?l=re.center:n(c.position)&&(l=c.position.getValue(r,l)),u=n(l)}var h=n(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;n(h)&&(h.position=t.clone(l,h.position),h.showSelection=d&&u,h.update());var p=n(this._infoBox)?this._infoBox.viewModel:void 0;n(p)&&(p.showInfo=d,p.enableCamera=u,p.isCameraTracking=this.trackedEntity===this.selectedEntity,d?(p.titleText=i(c.name,c.id),p.description=b.getValueOrDefault(c.description,r,"")):(p.titleText="",p.description=""))},Z.prototype._onEntityCollectionChanged=function(e,t,r){for(var i=r.length,n=0;n<i;n++){var o=r[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Z.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,r=t.position;n(r)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Z.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Z.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Z.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Z.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&q(this.timeline,this.clock,e)},Z.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var r=t.entities.id,i=this._eventHelper.add(t.changedEvent,Z.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[r]=i},Z.prototype._onDataSourceRemoved=function(e,t){var r=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,r){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Z.prototype.zoomTo=function(e,t){return K(this,e,t,!1)},Z.prototype.flyTo=function(e,t){return K(this,e,t,!0)},Z.prototype._postRender=function(){ee(this),te(this)},Z}),define("Widgets/Viewer/viewerCesium3DTilesInspectorMixin",["../../Core/Check","../../Core/defineProperties","../Cesium3DTilesInspector/Cesium3DTilesInspector"],function(e,t,r){"use strict";function i(e){var i=document.createElement("div");i.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesium3DTilesInspector:{get:function(){return n}}})}return i}),define("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,r,i){"use strict";function n(e){var r=document.createElement("div");r.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(r);var n=new i(r,e.scene);t(e,{cesiumInspector:{get:function(){return n}}})}return n}),define("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,i){function a(e){d(e),g&&(t.entities.removeAll(),t.dataSources.removeAll());for(var r=e.dataTransfer.files,i=r.length,n=0;n<i;n++){var o=r[n],a=new FileReader;a.onload=f(t,o,y,_),a.onerror=m(t,o),a.readAsText(o)}}i=e(i,e.EMPTY_OBJECT);var s=!0,l=e(i.flyToOnDrop,!0),c=new n,g=e(i.clearOnDrop,!0),v=e(i.dropTarget,t.container),_=e(i.clampToGround,!0),y=i.proxy;v=u(v),r(t,{dropTarget:{get:function(){return v},set:function(e){h(v,a),v=e,p(v,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(v,a):h(v,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return g},set:function(e){g=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return _},set:function(e){_=e}}}),p(v,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function d(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",d,!1),i.removeEventListener("dragover",d,!1),i.removeEventListener("dragexit",d,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",d,!1),e.addEventListener("dragover",d,!1),e.addEventListener("dragexit",d,!1)}function f(e,r,i,n){var o=e.scene;return function(u){var c=r.name;try{var d;if(/\.czml$/i.test(c))d=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))d=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);d=l.load(r,{sourceUri:c,proxy:i,camera:o.camera,canvas:o.canvas})}t(d)&&e.dataSources.add(d).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}return c}),define("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,r,i,n){"use strict";function o(t,i){i=e(i,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:i.lowFrameRateMessage});r(t,{performanceWatchdog:{get:function(){return o}}})}return o}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function i(i){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=i(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return i}), define("Cesium",["./Core/appendForwardSlash","./Core/arrayFill","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CullingVolume","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/decodeGoogleEarthEnterpriseData","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/DoublyLinkedList","./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/FrustumGeometry","./Core/FrustumOutlineGeometry","./Core/Fullscreen","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GoogleEarthEnterpriseMetadata","./Core/GoogleEarthEnterpriseTerrainData","./Core/GoogleEarthEnterpriseTerrainProvider","./Core/GoogleEarthEnterpriseTileInformation","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/Heap","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isBitSet","./Core/isBlobUri","./Core/isCrossOriginUrl","./Core/isDataUri","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadCRN","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadKTX","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/ManagedArray","./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/OrthographicFrustum","./Core/OrthographicOffCenterFrustum","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PerspectiveFrustum","./Core/PerspectiveOffCenterFrustum","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/Request","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RequestScheduler","./Core/RequestState","./Core/RequestType","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/TileAvailability","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WeightSpline","./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/KmlCamera","./DataSources/KmlDataSource","./DataSources/KmlLookAt","./DataSources/KmlTour","./DataSources/KmlTourFlyTo","./DataSources/KmlTourWait","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineDashMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/freezeRenderState","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/modernizeShader","./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/AttributeType","./Scene/Axis","./Scene/Batched3DModel3DTileContent","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/BoxEmitter","./Scene/BrdfLutGenerator","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/Cesium3DTile","./Scene/Cesium3DTileBatchTable","./Scene/Cesium3DTileChildrenVisibility","./Scene/Cesium3DTileColorBlendMode","./Scene/Cesium3DTileContent","./Scene/Cesium3DTileContentFactory","./Scene/Cesium3DTileContentState","./Scene/Cesium3DTileFeature","./Scene/Cesium3DTileFeatureTable","./Scene/Cesium3DTileOptimizationHint","./Scene/Cesium3DTileOptimizations","./Scene/Cesium3DTileRefine","./Scene/Cesium3DTileset","./Scene/Cesium3DTilesetStatistics","./Scene/Cesium3DTilesetTraversal","./Scene/Cesium3DTileStyle","./Scene/Cesium3DTileStyleEngine","./Scene/CircleEmitter","./Scene/ClassificationPrimitive","./Scene/ClassificationType","./Scene/ColorBlendMode","./Scene/Composite3DTileContent","./Scene/ConditionsExpression","./Scene/ConeEmitter","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Empty3DTileContent","./Scene/Expression","./Scene/ExpressionNodeType","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthEnterpriseImageryProvider","./Scene/GoogleEarthEnterpriseMapsProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Instanced3DModel3DTileContent","./Scene/InvertClassification","./Scene/JobScheduler","./Scene/JobType","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelInstance","./Scene/ModelInstanceCollection","./Scene/ModelMaterial","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/Particle","./Scene/ParticleBurst","./Scene/ParticleEmitter","./Scene/ParticleSystem","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PickDepth","./Scene/PointCloud3DTileContent","./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/SphereEmitter","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/StyleExpression","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingRegion","./Scene/TileBoundingSphere","./Scene/TileBoundingVolume","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileOrientedBoundingBox","./Scene/TileReplacementQueue","./Scene/Tileset3DTileContent","./Scene/TileState","./Scene/TileTerrain","./Scene/TimeDynamicImagery","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/BrdfLutGeneratorFS","./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/passCesium3DTile","./Shaders/Builtin/Constants/passCesium3DTileClassification","./Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTerrainClassification","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/HSBToRGB","./Shaders/Builtin/Functions/HSLToRGB","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToHSB","./Shaders/Builtin/Functions/RGBToHSL","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineDashMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/crunch","./ThirdParty/earcut-2.1.1","./ThirdParty/GltfPipeline/addDefaults","./ThirdParty/GltfPipeline/addExtensionsRequired","./ThirdParty/GltfPipeline/addExtensionsUsed","./ThirdParty/GltfPipeline/addPipelineExtras","./ThirdParty/GltfPipeline/addToArray","./ThirdParty/GltfPipeline/byteLengthForComponentType","./ThirdParty/GltfPipeline/findAccessorMinMax","./ThirdParty/GltfPipeline/ForEach","./ThirdParty/GltfPipeline/getAccessorByteStride","./ThirdParty/GltfPipeline/getJointCountForMaterials","./ThirdParty/GltfPipeline/glslTypeToWebGLConstant","./ThirdParty/GltfPipeline/numberOfComponentsForType","./ThirdParty/GltfPipeline/parseBinaryGltf","./ThirdParty/GltfPipeline/processModelMaterialsCommon","./ThirdParty/GltfPipeline/processPbrMetallicRoughness","./ThirdParty/GltfPipeline/removeExtensionsRequired","./ThirdParty/GltfPipeline/removeExtensionsUsed","./ThirdParty/GltfPipeline/removePipelineExtras","./ThirdParty/GltfPipeline/techniqueParameterForSemantic","./ThirdParty/GltfPipeline/updateVersion","./ThirdParty/GltfPipeline/webGLConstantToGlslType","./ThirdParty/google-earth-dbroot-parser","./ThirdParty/jsep","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.2","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/pako_inflate","./ThirdParty/protobuf-minimal","./ThirdParty/Shaders/FXAA3_11","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector","./Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/ProjectionPicker/ProjectionPicker","./Widgets/ProjectionPicker/ProjectionPickerViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesium3DTilesInspectorMixin","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Te,Ee,xe,Pe,Ae,De,Ie,Oe,Me,Re,Le,Ne,ke,Fe,Be,Ue,Ve,ze,Ge,He,We,je,qe,Ye,Xe,Qe,Ze,Ke,Je,$e,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,gt,vt,_t,yt,bt,Ct,wt,St,Tt,Et,xt,Pt,At,Dt,It,Ot,Mt,Rt,Lt,Nt,kt,Ft,Bt,Ut,Vt,zt,Gt,Ht,Wt,jt,qt,Yt,Xt,Qt,Zt,Kt,Jt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,gr,vr,_r,yr,br,Cr,wr,Sr,Tr,Er,xr,Pr,Ar,Dr,Ir,Or,Mr,Rr,Lr,Nr,kr,Fr,Br,Ur,Vr,zr,Gr,Hr,Wr,jr,qr,Yr,Xr,Qr,Zr,Kr,Jr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,gi,vi,_i,yi,bi,Ci,wi,Si,Ti,Ei,xi,Pi,Ai,Di,Ii,Oi,Mi,Ri,Li,Ni,ki,Fi,Bi,Ui,Vi,zi,Gi,Hi,Wi,ji,qi,Yi,Xi,Qi,Zi,Ki,Ji,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,gn,vn,_n,yn,bn,Cn,wn,Sn,Tn,En,xn,Pn,An,Dn,In,On,Mn,Rn,Ln,Nn,kn,Fn,Bn,Un,Vn,zn,Gn,Hn,Wn,jn,qn,Yn,Xn,Qn,Zn,Kn,Jn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,go,vo,_o,yo,bo,Co,wo,So,To,Eo,xo,Po,Ao,Do,Io,Oo,Mo,Ro,Lo,No,ko,Fo,Bo,Uo,Vo,zo,Go,Ho,Wo,jo,qo,Yo,Xo,Qo,Zo,Ko,Jo,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,ga,va,_a,ya,ba,Ca,wa,Sa,Ta,Ea,xa,Pa,Aa,Da,Ia,Oa,Ma,Ra,La,Na,ka,Fa,Ba,Ua,Va,za,Ga,Ha,Wa,ja,qa,Ya,Xa,Qa,Za,Ka,Ja,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,gs,vs,_s,ys,bs,Cs,ws,Ss,Ts,Es,xs,Ps,As,Ds,Is,Os,Ms,Rs,Ls,Ns,ks,Fs,Bs,Us,Vs,zs,Gs,Hs,Ws,js,qs,Ys,Xs,Qs,Zs,Ks,Js,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,gl,vl,_l,yl,bl,Cl,wl,Sl,Tl,El,xl,Pl,Al,Dl,Il,Ol,Ml,Rl,Ll,Nl,kl,Fl,Bl,Ul,Vl,zl,Gl,Hl,Wl,jl,ql,Yl,Xl,Ql,Zl,Kl,Jl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,gu,vu,_u,yu,bu,Cu,wu,Su,Tu,Eu,xu,Pu,Au,Du,Iu,Ou,Mu,Ru,Lu,Nu,ku,Fu,Bu,Uu,Vu,zu,Gu,Hu,Wu,ju,qu,Yu,Xu,Qu,Zu,Ku,Ju,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,vc,_c,yc,bc,Cc,wc,Sc,Tc,Ec,xc,Pc,Ac,Dc,Ic,Oc,Mc,Rc,Lc,Nc,kc,Fc,Bc,Uc,Vc,zc,Gc,Hc,Wc,jc,qc,Yc,Xc,Qc,Zc,Kc,Jc,$c,ed,td,rd,id,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,vd,_d,yd,bd,Cd,wd,Sd,Td,Ed,xd,Pd,Ad,Dd,Id,Od,Md,Rd,Ld,Nd,kd,Fd,Bd,Ud,Vd,zd,Gd,Hd,Wd,jd,qd,Yd,Xd,Qd,Zd,Kd,Jd,$d,eh,th,rh,ih,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,vh,_h,yh,bh,Ch,wh,Sh,Th,Eh,xh,Ph,Ah,Dh,Ih,Oh,Mh,Rh,Lh,Nh,kh,Fh,Bh,Uh,Vh,zh,Gh,Hh,Wh,jh,qh,Yh,Xh,Qh,Zh,Kh,Jh,$h,ep,tp,rp,ip,np,op,ap,sp,lp,up,cp,dp,hp,pp,fp,mp,gp,vp,_p,yp,bp,Cp,wp,Sp,Tp,Ep,xp,Pp,Ap,Dp,Ip,Op,Mp,Rp,Lp,Np,kp,Fp,Bp,Up,Vp,zp,Gp,Hp){"use strict";var Wp={VERSION:"1.39",_shaders:{}};return Wp.appendForwardSlash=e,Wp.arrayFill=t,Wp.arrayRemoveDuplicates=r,Wp.AssociativeArray=i,Wp.AttributeCompression=n,Wp.AxisAlignedBoundingBox=o,Wp.barycentricCoordinates=a,Wp.binarySearch=s,Wp.BingMapsApi=l,Wp.BingMapsGeocoderService=u,Wp.BoundingRectangle=c,Wp.BoundingSphere=d,Wp.BoxGeometry=h,Wp.BoxOutlineGeometry=p,Wp.buildModuleUrl=f,Wp.cancelAnimationFrame=m,Wp.Cartesian2=g,Wp.Cartesian3=v,Wp.Cartesian4=_,Wp.Cartographic=y,Wp.CartographicGeocoderService=b,Wp.CatmullRomSpline=C,Wp.CesiumTerrainProvider=w,Wp.Check=S,Wp.CircleGeometry=T,Wp.CircleOutlineGeometry=E,Wp.Clock=x,Wp.ClockRange=P,Wp.ClockStep=A,Wp.clone=D,Wp.Color=I,Wp.ColorGeometryInstanceAttribute=O,Wp.combine=M,Wp.ComponentDatatype=R,Wp.CompressedTextureBuffer=L,Wp.CornerType=N,Wp.CorridorGeometry=k,Wp.CorridorGeometryLibrary=F,Wp.CorridorOutlineGeometry=B,Wp.createGuid=U,Wp.Credit=V,Wp.CubicRealPolynomial=z,Wp.CullingVolume=G,Wp.CylinderGeometry=H,Wp.CylinderGeometryLibrary=W,Wp.CylinderOutlineGeometry=j,Wp.decodeGoogleEarthEnterpriseData=q,Wp.DefaultProxy=Y,Wp.defaultValue=X,Wp.defined=Q,Wp.defineProperties=Z,Wp.deprecationWarning=K,Wp.destroyObject=J,Wp.DeveloperError=$,Wp.DistanceDisplayCondition=ee,Wp.DistanceDisplayConditionGeometryInstanceAttribute=te,Wp.DoublyLinkedList=re,Wp.EarthOrientationParameters=ie,Wp.EarthOrientationParametersSample=ne,Wp.EasingFunction=oe,Wp.EllipseGeometry=ae,Wp.EllipseGeometryLibrary=se,Wp.EllipseOutlineGeometry=le,Wp.Ellipsoid=ue,Wp.EllipsoidalOccluder=ce,Wp.EllipsoidGeodesic=de,Wp.EllipsoidGeometry=he,Wp.EllipsoidOutlineGeometry=pe,Wp.EllipsoidTangentPlane=fe,Wp.EllipsoidTerrainProvider=me,Wp.EncodedCartesian3=ge,Wp.Event=ve,Wp.EventHelper=_e,Wp.ExtrapolationType=ye,Wp.FeatureDetection=be,Wp.formatError=Ce,Wp.freezeObject=we,Wp.FrustumGeometry=Se,Wp.FrustumOutlineGeometry=Te,Wp.Fullscreen=Ee,Wp.GeocoderService=xe,Wp.GeographicProjection=Pe,Wp.GeographicTilingScheme=Ae,Wp.Geometry=De,Wp.GeometryAttribute=Ie,Wp.GeometryAttributes=Oe,Wp.GeometryInstance=Me,Wp.GeometryInstanceAttribute=Re,Wp.GeometryPipeline=Le,Wp.GeometryType=Ne,Wp.getAbsoluteUri=ke,Wp.getBaseUri=Fe,Wp.getExtensionFromUri=Be,Wp.getFilenameFromUri=Ue,Wp.getImagePixels=Ve,Wp.getMagic=ze,Wp.getStringFromTypedArray=Ge,Wp.getTimestamp=He,Wp.GoogleEarthEnterpriseMetadata=We,Wp.GoogleEarthEnterpriseTerrainData=je,Wp.GoogleEarthEnterpriseTerrainProvider=qe,Wp.GoogleEarthEnterpriseTileInformation=Ye,Wp.GregorianDate=Xe,Wp.HeadingPitchRange=Qe,Wp.HeadingPitchRoll=Ze,Wp.Heap=Ke,Wp.HeightmapTerrainData=Je,Wp.HeightmapTessellator=$e,Wp.HermitePolynomialApproximation=et,Wp.HermiteSpline=tt,Wp.Iau2000Orientation=rt,Wp.Iau2006XysData=it,Wp.Iau2006XysSample=nt,Wp.IauOrientationAxes=ot,Wp.IauOrientationParameters=at,Wp.IndexDatatype=st,Wp.InterpolationAlgorithm=lt,Wp.Intersect=ut,Wp.Intersections2D=ct,Wp.IntersectionTests=dt,Wp.Interval=ht,Wp.isArray=pt,Wp.isBitSet=ft,Wp.isBlobUri=mt,Wp.isCrossOriginUrl=gt,Wp.isDataUri=vt,Wp.isLeapYear=_t,Wp.Iso8601=yt,Wp.joinUrls=bt,Wp.JulianDate=Ct,Wp.KeyboardEventModifier=wt,Wp.LagrangePolynomialApproximation=St,Wp.LeapSecond=Tt,Wp.LinearApproximation=Et,Wp.LinearSpline=xt,Wp.loadArrayBuffer=Pt,Wp.loadBlob=At,Wp.loadCRN=Dt,Wp.loadImage=It,Wp.loadImageFromTypedArray=Ot,Wp.loadImageViaBlob=Mt,Wp.loadJson=Rt,Wp.loadJsonp=Lt,Wp.loadKTX=Nt,Wp.loadText=kt,Wp.loadWithXhr=Ft,Wp.loadXML=Bt,Wp.ManagedArray=Ut,Wp.MapboxApi=Vt,Wp.MapProjection=zt,Wp.Math=Gt,Wp.Matrix2=Ht,Wp.Matrix3=Wt,Wp.Matrix4=jt,Wp.mergeSort=qt,Wp.NearFarScalar=Yt,Wp.objectToQuery=Xt,Wp.Occluder=Qt,Wp.oneTimeWarning=Zt,Wp.OrientedBoundingBox=Kt,Wp.OrthographicFrustum=Jt,Wp.OrthographicOffCenterFrustum=$t,Wp.Packable=er,Wp.PackableForInterpolation=tr,Wp.parseResponseHeaders=rr,Wp.PerspectiveFrustum=ir,Wp.PerspectiveOffCenterFrustum=nr,Wp.PinBuilder=or,Wp.PixelFormat=ar,Wp.Plane=sr,Wp.pointInsideTriangle=lr, Wp.PolygonGeometry=ur,Wp.PolygonGeometryLibrary=cr,Wp.PolygonHierarchy=dr,Wp.PolygonOutlineGeometry=hr,Wp.PolygonPipeline=pr,Wp.PolylineGeometry=fr,Wp.PolylinePipeline=mr,Wp.PolylineVolumeGeometry=gr,Wp.PolylineVolumeGeometryLibrary=vr,Wp.PolylineVolumeOutlineGeometry=_r,Wp.PrimitiveType=yr,Wp.QuadraticRealPolynomial=br,Wp.QuantizedMeshTerrainData=Cr,Wp.QuarticRealPolynomial=wr,Wp.Quaternion=Sr,Wp.QuaternionSpline=Tr,Wp.queryToObject=Er,Wp.Queue=xr,Wp.Ray=Pr,Wp.Rectangle=Ar,Wp.RectangleGeometry=Dr,Wp.RectangleGeometryLibrary=Ir,Wp.RectangleOutlineGeometry=Or,Wp.ReferenceFrame=Mr,Wp.Request=Rr,Wp.requestAnimationFrame=Lr,Wp.RequestErrorEvent=Nr,Wp.RequestScheduler=kr,Wp.RequestState=Fr,Wp.RequestType=Br,Wp.RuntimeError=Ur,Wp.sampleTerrain=Vr,Wp.sampleTerrainMostDetailed=zr,Wp.scaleToGeodeticSurface=Gr,Wp.ScreenSpaceEventHandler=Hr,Wp.ScreenSpaceEventType=Wr,Wp.ShowGeometryInstanceAttribute=jr,Wp.Simon1994PlanetaryPositions=qr,Wp.SimplePolylineGeometry=Yr,Wp.SphereGeometry=Xr,Wp.SphereOutlineGeometry=Qr,Wp.Spherical=Zr,Wp.Spline=Kr,Wp.subdivideArray=Jr,Wp.TaskProcessor=$r,Wp.TerrainData=ei,Wp.TerrainEncoding=ti,Wp.TerrainMesh=ri,Wp.TerrainProvider=ii,Wp.TerrainQuantization=ni,Wp.TileAvailability=oi,Wp.TileProviderError=ai,Wp.TilingScheme=si,Wp.TimeConstants=li,Wp.TimeInterval=ui,Wp.TimeIntervalCollection=ci,Wp.TimeStandard=di,Wp.Tipsify=hi,Wp.Transforms=pi,Wp.TranslationRotationScale=fi,Wp.TridiagonalSystemSolver=mi,Wp.TrustedServers=gi,Wp.VertexFormat=vi,Wp.VideoSynchronizer=_i,Wp.Visibility=yi,Wp.VRTheWorldTerrainProvider=bi,Wp.WallGeometry=Ci,Wp.WallGeometryLibrary=wi,Wp.WallOutlineGeometry=Si,Wp.WebGLConstants=Ti,Wp.WebMercatorProjection=Ei,Wp.WebMercatorTilingScheme=xi,Wp.WeightSpline=Pi,Wp.WindingOrder=Ai,Wp.wrapFunction=Di,Wp.writeTextToCanvas=Ii,Wp.BillboardGraphics=Oi,Wp.BillboardVisualizer=Mi,Wp.BoundingSphereState=Ri,Wp.BoxGeometryUpdater=Li,Wp.BoxGraphics=Ni,Wp.CallbackProperty=ki,Wp.CheckerboardMaterialProperty=Fi,Wp.ColorMaterialProperty=Bi,Wp.CompositeEntityCollection=Ui,Wp.CompositeMaterialProperty=Vi,Wp.CompositePositionProperty=zi,Wp.CompositeProperty=Gi,Wp.ConstantPositionProperty=Hi,Wp.ConstantProperty=Wi,Wp.CorridorGeometryUpdater=ji,Wp.CorridorGraphics=qi,Wp.createMaterialPropertyDescriptor=Yi,Wp.createPropertyDescriptor=Xi,Wp.createRawPropertyDescriptor=Qi,Wp.CustomDataSource=Zi,Wp.CylinderGeometryUpdater=Ki,Wp.CylinderGraphics=Ji,Wp.CzmlDataSource=$i,Wp.DataSource=en,Wp.DataSourceClock=tn,Wp.DataSourceCollection=rn,Wp.DataSourceDisplay=nn,Wp.dynamicGeometryGetBoundingSphere=on,Wp.DynamicGeometryUpdater=an,Wp.EllipseGeometryUpdater=sn,Wp.EllipseGraphics=ln,Wp.EllipsoidGeometryUpdater=un,Wp.EllipsoidGraphics=cn,Wp.Entity=dn,Wp.EntityCluster=hn,Wp.EntityCollection=pn,Wp.EntityView=fn,Wp.GeoJsonDataSource=mn,Wp.GeometryUpdater=gn,Wp.GeometryVisualizer=vn,Wp.GridMaterialProperty=_n,Wp.ImageMaterialProperty=yn,Wp.KmlCamera=bn,Wp.KmlDataSource=Cn,Wp.KmlLookAt=wn,Wp.KmlTour=Sn,Wp.KmlTourFlyTo=Tn,Wp.KmlTourWait=En,Wp.LabelGraphics=xn,Wp.LabelVisualizer=Pn,Wp.MaterialProperty=An,Wp.ModelGraphics=Dn,Wp.ModelVisualizer=In,Wp.NodeTransformationProperty=On,Wp.PathGraphics=Mn,Wp.PathVisualizer=Rn,Wp.PointGraphics=Ln,Wp.PointVisualizer=Nn,Wp.PolygonGeometryUpdater=kn,Wp.PolygonGraphics=Fn,Wp.PolylineArrowMaterialProperty=Bn,Wp.PolylineDashMaterialProperty=Un,Wp.PolylineGeometryUpdater=Vn,Wp.PolylineGlowMaterialProperty=zn,Wp.PolylineGraphics=Gn,Wp.PolylineOutlineMaterialProperty=Hn,Wp.PolylineVolumeGeometryUpdater=Wn,Wp.PolylineVolumeGraphics=jn,Wp.PositionProperty=qn,Wp.PositionPropertyArray=Yn,Wp.Property=Xn,Wp.PropertyArray=Qn,Wp.PropertyBag=Zn,Wp.RectangleGeometryUpdater=Kn,Wp.RectangleGraphics=Jn,Wp.ReferenceProperty=$n,Wp.Rotation=eo,Wp.SampledPositionProperty=to,Wp.SampledProperty=ro,Wp.ScaledPositionProperty=io,Wp.StaticGeometryColorBatch=no,Wp.StaticGeometryPerMaterialBatch=oo,Wp.StaticGroundGeometryColorBatch=ao,Wp.StaticOutlineGeometryBatch=so,Wp.StripeMaterialProperty=lo,Wp.StripeOrientation=uo,Wp.TimeIntervalCollectionPositionProperty=co,Wp.TimeIntervalCollectionProperty=ho,Wp.VelocityOrientationProperty=po,Wp.VelocityVectorProperty=fo,Wp.Visualizer=mo,Wp.WallGeometryUpdater=go,Wp.WallGraphics=vo,Wp.AutomaticUniforms=_o,Wp.Buffer=yo,Wp.BufferUsage=bo,Wp.ClearCommand=Co,Wp.ComputeCommand=wo,Wp.ComputeEngine=So,Wp.Context=To,Wp.ContextLimits=Eo,Wp.createUniform=xo,Wp.createUniformArray=Po,Wp.CubeMap=Ao,Wp.CubeMapFace=Do,Wp.DrawCommand=Io,Wp.Framebuffer=Oo,Wp.freezeRenderState=Mo,Wp.loadCubeMap=Ro,Wp.MipmapHint=Lo,Wp.modernizeShader=No,Wp.Pass=ko,Wp.PassState=Fo,Wp.PickFramebuffer=Bo,Wp.PixelDatatype=Uo,Wp.Renderbuffer=Vo,Wp.RenderbufferFormat=zo,Wp.RenderState=Go,Wp.Sampler=Ho,Wp.ShaderCache=Wo,Wp.ShaderProgram=jo,Wp.ShaderSource=qo,Wp.Texture=Yo,Wp.TextureMagnificationFilter=Xo,Wp.TextureMinificationFilter=Qo,Wp.TextureWrap=Zo,Wp.UniformState=Ko,Wp.VertexArray=Jo,Wp.VertexArrayFacade=$o,Wp.Appearance=ea,Wp.ArcGisMapServerImageryProvider=ta,Wp.AttributeType=ra,Wp.Axis=ia,Wp.Batched3DModel3DTileContent=na,Wp.BatchTable=oa,Wp.Billboard=aa,Wp.BillboardCollection=sa,Wp.BingMapsImageryProvider=la,Wp.BingMapsStyle=ua,Wp.BlendEquation=ca,Wp.BlendFunction=da,Wp.BlendingState=ha,Wp.BlendOption=pa,Wp.BoxEmitter=fa,Wp.BrdfLutGenerator=ma,Wp.Camera=ga,Wp.CameraEventAggregator=va,Wp.CameraEventType=_a,Wp.CameraFlightPath=ya,Wp.Cesium3DTile=ba,Wp.Cesium3DTileBatchTable=Ca,Wp.Cesium3DTileChildrenVisibility=wa,Wp.Cesium3DTileColorBlendMode=Sa,Wp.Cesium3DTileContent=Ta,Wp.Cesium3DTileContentFactory=Ea,Wp.Cesium3DTileContentState=xa,Wp.Cesium3DTileFeature=Pa,Wp.Cesium3DTileFeatureTable=Aa,Wp.Cesium3DTileOptimizationHint=Da,Wp.Cesium3DTileOptimizations=Ia,Wp.Cesium3DTileRefine=Oa,Wp.Cesium3DTileset=Ma,Wp.Cesium3DTilesetStatistics=Ra,Wp.Cesium3DTilesetTraversal=La,Wp.Cesium3DTileStyle=Na,Wp.Cesium3DTileStyleEngine=ka,Wp.CircleEmitter=Fa,Wp.ClassificationPrimitive=Ba,Wp.ClassificationType=Ua,Wp.ColorBlendMode=Va,Wp.Composite3DTileContent=za,Wp.ConditionsExpression=Ga,Wp.ConeEmitter=Ha,Wp.createOpenStreetMapImageryProvider=Wa,Wp.createTangentSpaceDebugPrimitive=ja,Wp.createTileMapServiceImageryProvider=qa,Wp.CreditDisplay=Ya,Wp.CullFace=Xa,Wp.DebugAppearance=Qa,Wp.DebugCameraPrimitive=Za,Wp.DebugModelMatrixPrimitive=Ka,Wp.DepthFunction=Ja,Wp.DepthPlane=$a,Wp.DeviceOrientationCameraController=es,Wp.DiscardMissingTileImagePolicy=ts,Wp.EllipsoidPrimitive=rs,Wp.EllipsoidSurfaceAppearance=is,Wp.Empty3DTileContent=ns,Wp.Expression=os,Wp.ExpressionNodeType=as,Wp.Fog=ss,Wp.FrameRateMonitor=ls,Wp.FrameState=us,Wp.FrustumCommands=cs,Wp.FXAA=ds,Wp.getAttributeOrUniformBySemantic=hs,Wp.getBinaryAccessor=ps,Wp.GetFeatureInfoFormat=fs,Wp.Globe=ms,Wp.GlobeDepth=gs,Wp.GlobeSurfaceShaderSet=vs,Wp.GlobeSurfaceTile=_s,Wp.GlobeSurfaceTileProvider=ys,Wp.GoogleEarthEnterpriseImageryProvider=bs,Wp.GoogleEarthEnterpriseMapsProvider=Cs,Wp.GridImageryProvider=ws,Wp.GroundPrimitive=Ss,Wp.HeightReference=Ts,Wp.HorizontalOrigin=Es,Wp.Imagery=xs,Wp.ImageryLayer=Ps,Wp.ImageryLayerCollection=As,Wp.ImageryLayerFeatureInfo=Ds,Wp.ImageryProvider=Is,Wp.ImagerySplitDirection=Os,Wp.ImageryState=Ms,Wp.Instanced3DModel3DTileContent=Rs,Wp.InvertClassification=Ls,Wp.JobScheduler=Ns,Wp.JobType=ks,Wp.Label=Fs,Wp.LabelCollection=Bs,Wp.LabelStyle=Us,Wp.MapboxImageryProvider=Vs,Wp.MapMode2D=zs,Wp.Material=Gs,Wp.MaterialAppearance=Hs,Wp.Model=Ws,Wp.ModelAnimation=js,Wp.ModelAnimationCache=qs,Wp.ModelAnimationCollection=Ys,Wp.ModelAnimationLoop=Xs,Wp.ModelAnimationState=Qs,Wp.ModelInstance=Zs,Wp.ModelInstanceCollection=Ks,Wp.ModelMaterial=Js,Wp.ModelMesh=$s,Wp.ModelNode=el,Wp.Moon=tl,Wp.NeverTileDiscardPolicy=rl,Wp.OIT=il,Wp.Particle=nl,Wp.ParticleBurst=ol,Wp.ParticleEmitter=al,Wp.ParticleSystem=sl,Wp.PerformanceDisplay=ll,Wp.PerInstanceColorAppearance=ul,Wp.PickDepth=cl,Wp.PointCloud3DTileContent=dl,Wp.PointPrimitive=hl,Wp.PointPrimitiveCollection=pl,Wp.Polyline=fl,Wp.PolylineCollection=ml,Wp.PolylineColorAppearance=gl,Wp.PolylineMaterialAppearance=vl,Wp.Primitive=_l,Wp.PrimitiveCollection=yl,Wp.PrimitivePipeline=bl,Wp.PrimitiveState=Cl,Wp.QuadtreeOccluders=wl,Wp.QuadtreePrimitive=Sl,Wp.QuadtreeTile=Tl,Wp.QuadtreeTileLoadState=El,Wp.QuadtreeTileProvider=xl,Wp.Scene=Pl,Wp.SceneMode=Al,Wp.SceneTransforms=Dl,Wp.SceneTransitioner=Il,Wp.ScreenSpaceCameraController=Ol,Wp.ShadowMap=Ml,Wp.ShadowMapShader=Rl,Wp.ShadowMode=Ll,Wp.SingleTileImageryProvider=Nl,Wp.SkyAtmosphere=kl,Wp.SkyBox=Fl,Wp.SphereEmitter=Bl,Wp.StencilFunction=Ul,Wp.StencilOperation=Vl,Wp.StyleExpression=zl,Wp.Sun=Gl,Wp.SunPostProcess=Hl,Wp.TerrainState=Wl,Wp.TextureAtlas=jl,Wp.TileBoundingRegion=ql,Wp.TileBoundingSphere=Yl,Wp.TileBoundingVolume=Xl,Wp.TileCoordinatesImageryProvider=Ql,Wp.TileDiscardPolicy=Zl,Wp.TileImagery=Kl,Wp.TileOrientedBoundingBox=Jl,Wp.TileReplacementQueue=$l,Wp.Tileset3DTileContent=eu,Wp.TileState=tu,Wp.TileTerrain=ru,Wp.TimeDynamicImagery=iu,Wp.TweenCollection=nu,Wp.UrlTemplateImageryProvider=ou,Wp.VerticalOrigin=au,Wp.ViewportQuad=su,Wp.WebMapServiceImageryProvider=lu,Wp.WebMapTileServiceImageryProvider=uu,Wp._shaders.AdjustTranslucentFS=cu,Wp._shaders.AllMaterialAppearanceFS=du,Wp._shaders.AllMaterialAppearanceVS=hu,Wp._shaders.BasicMaterialAppearanceFS=pu,Wp._shaders.BasicMaterialAppearanceVS=fu,Wp._shaders.EllipsoidSurfaceAppearanceFS=mu,Wp._shaders.EllipsoidSurfaceAppearanceVS=gu,Wp._shaders.PerInstanceColorAppearanceFS=vu,Wp._shaders.PerInstanceColorAppearanceVS=_u,Wp._shaders.PerInstanceFlatColorAppearanceFS=yu,Wp._shaders.PerInstanceFlatColorAppearanceVS=bu,Wp._shaders.PolylineColorAppearanceVS=Cu,Wp._shaders.PolylineMaterialAppearanceVS=wu,Wp._shaders.TexturedMaterialAppearanceFS=Su,Wp._shaders.TexturedMaterialAppearanceVS=Tu,Wp._shaders.BillboardCollectionFS=Eu,Wp._shaders.BillboardCollectionVS=xu,Wp._shaders.BrdfLutGeneratorFS=Pu,Wp._shaders.degreesPerRadian=Au,Wp._shaders.depthRange=Du,Wp._shaders.epsilon1=Iu,Wp._shaders.epsilon2=Ou,Wp._shaders.epsilon3=Mu,Wp._shaders.epsilon4=Ru,Wp._shaders.epsilon5=Lu,Wp._shaders.epsilon6=Nu,Wp._shaders.epsilon7=ku,Wp._shaders.infinity=Fu,Wp._shaders.oneOverPi=Bu,Wp._shaders.oneOverTwoPi=Uu,Wp._shaders.passCesium3DTile=Vu,Wp._shaders.passCesium3DTileClassification=zu,Wp._shaders.passCesium3DTileClassificationIgnoreShow=Gu,Wp._shaders.passCompute=Hu,Wp._shaders.passEnvironment=Wu,Wp._shaders.passGlobe=ju,Wp._shaders.passOpaque=qu,Wp._shaders.passOverlay=Yu,Wp._shaders.passTerrainClassification=Xu,Wp._shaders.passTranslucent=Qu,Wp._shaders.pi=Zu,Wp._shaders.piOverFour=Ku,Wp._shaders.piOverSix=Ju,Wp._shaders.piOverThree=$u,Wp._shaders.piOverTwo=ec,Wp._shaders.radiansPerDegree=tc,Wp._shaders.sceneMode2D=rc,Wp._shaders.sceneMode3D=ic,Wp._shaders.sceneModeColumbusView=nc,Wp._shaders.sceneModeMorphing=oc,Wp._shaders.solarRadius=ac,Wp._shaders.threePiOver2=sc,Wp._shaders.twoPi=lc,Wp._shaders.webMercatorMaxLatitude=uc,Wp._shaders.CzmBuiltins=cc,Wp._shaders.alphaWeight=dc,Wp._shaders.antialias=hc,Wp._shaders.cascadeColor=pc,Wp._shaders.cascadeDistance=fc,Wp._shaders.cascadeMatrix=mc,Wp._shaders.cascadeWeights=gc,Wp._shaders.columbusViewMorph=vc,Wp._shaders.computePosition=_c,Wp._shaders.cosineAndSine=yc,Wp._shaders.decompressTextureCoordinates=bc,Wp._shaders.eastNorthUpToEyeCoordinates=Cc,Wp._shaders.ellipsoidContainsPoint=wc,Wp._shaders.ellipsoidNew=Sc,Wp._shaders.ellipsoidWgs84TextureCoordinates=Tc,Wp._shaders.equalsEpsilon=Ec,Wp._shaders.eyeOffset=xc,Wp._shaders.eyeToWindowCoordinates=Pc,Wp._shaders.fog=Ac,Wp._shaders.geodeticSurfaceNormal=Dc,Wp._shaders.getDefaultMaterial=Ic,Wp._shaders.getLambertDiffuse=Oc,Wp._shaders.getSpecular=Mc,Wp._shaders.getWaterNoise=Rc,Wp._shaders.getWgs84EllipsoidEC=Lc,Wp._shaders.HSBToRGB=Nc,Wp._shaders.HSLToRGB=kc,Wp._shaders.hue=Fc,Wp._shaders.isEmpty=Bc,Wp._shaders.isFull=Uc,Wp._shaders.latitudeToWebMercatorFraction=Vc,Wp._shaders.luminance=zc,Wp._shaders.metersPerPixel=Gc,Wp._shaders.modelToWindowCoordinates=Hc,Wp._shaders.multiplyWithColorBalance=Wc,Wp._shaders.nearFarScalar=jc,Wp._shaders.octDecode=qc,Wp._shaders.packDepth=Yc,Wp._shaders.phong=Xc,Wp._shaders.pointAlongRay=Qc,Wp._shaders.rayEllipsoidIntersectionInterval=Zc,Wp._shaders.RGBToHSB=Kc,Wp._shaders.RGBToHSL=Jc,Wp._shaders.RGBToXYZ=$c,Wp._shaders.saturation=ed,Wp._shaders.shadowDepthCompare=td,Wp._shaders.shadowVisibility=rd,Wp._shaders.signNotZero=id,Wp._shaders.tangentToEyeSpaceMatrix=nd,Wp._shaders.translateRelativeToEye=od,Wp._shaders.translucentPhong=ad,Wp._shaders.transpose=sd,Wp._shaders.unpackDepth=ld,Wp._shaders.windowToEyeCoordinates=ud,Wp._shaders.XYZToRGB=cd,Wp._shaders.depthRangeStruct=dd,Wp._shaders.ellipsoid=hd,Wp._shaders.material=pd,Wp._shaders.materialInput=fd,Wp._shaders.ray=md,Wp._shaders.raySegment=gd,Wp._shaders.shadowParameters=vd,Wp._shaders.CompositeOITFS=_d,Wp._shaders.DepthPlaneFS=yd,Wp._shaders.DepthPlaneVS=bd,Wp._shaders.EllipsoidFS=Cd,Wp._shaders.EllipsoidVS=wd,Wp._shaders.GlobeFS=Sd,Wp._shaders.GlobeVS=Td,Wp._shaders.GroundAtmosphere=Ed,Wp._shaders.BumpMapMaterial=xd,Wp._shaders.CheckerboardMaterial=Pd,Wp._shaders.DotMaterial=Ad,Wp._shaders.FadeMaterial=Dd,Wp._shaders.GridMaterial=Id,Wp._shaders.NormalMapMaterial=Od,Wp._shaders.PolylineArrowMaterial=Md,Wp._shaders.PolylineDashMaterial=Rd,Wp._shaders.PolylineGlowMaterial=Ld,Wp._shaders.PolylineOutlineMaterial=Nd,Wp._shaders.RimLightingMaterial=kd,Wp._shaders.StripeMaterial=Fd,Wp._shaders.Water=Bd,Wp._shaders.PointPrimitiveCollectionFS=Ud,Wp._shaders.PointPrimitiveCollectionVS=Vd,Wp._shaders.PolylineCommon=zd,Wp._shaders.PolylineFS=Gd,Wp._shaders.PolylineVS=Hd,Wp._shaders.AdditiveBlend=Wd,Wp._shaders.BrightPass=jd,Wp._shaders.FXAA=qd,Wp._shaders.GaussianBlur1D=Yd,Wp._shaders.PassThrough=Xd,Wp._shaders.ReprojectWebMercatorFS=Qd,Wp._shaders.ReprojectWebMercatorVS=Zd,Wp._shaders.ShadowVolumeFS=Kd,Wp._shaders.ShadowVolumeVS=Jd,Wp._shaders.SkyAtmosphereFS=$d,Wp._shaders.SkyAtmosphereVS=eh,Wp._shaders.SkyBoxFS=th,Wp._shaders.SkyBoxVS=rh,Wp._shaders.SunFS=ih,Wp._shaders.SunTextureFS=nh,Wp._shaders.SunVS=oh,Wp._shaders.ViewportQuadFS=ah,Wp._shaders.ViewportQuadVS=sh,Wp.Autolinker=lh,Wp.crunch=uh,Wp["earcut-2.1.1"]=ch,Wp.addDefaults=dh,Wp.addExtensionsRequired=hh,Wp.addExtensionsUsed=ph,Wp.addPipelineExtras=fh,Wp.addToArray=mh,Wp.byteLengthForComponentType=gh,Wp.findAccessorMinMax=vh,Wp.ForEach=_h,Wp.getAccessorByteStride=yh,Wp.getJointCountForMaterials=bh,Wp.glslTypeToWebGLConstant=Ch,Wp.numberOfComponentsForType=wh,Wp.parseBinaryGltf=Sh,Wp.processModelMaterialsCommon=Th,Wp.processPbrMetallicRoughness=Eh,Wp.removeExtensionsRequired=xh,Wp.removeExtensionsUsed=Ph,Wp.removePipelineExtras=Ah,Wp.techniqueParameterForSemantic=Dh,Wp.updateVersion=Ih,Wp.webGLConstantToGlslType=Oh,Wp["google-earth-dbroot-parser"]=Mh,Wp.jsep=Rh,Wp.kdbush=Lh,Wp["knockout-3.4.2"]=Nh,Wp["knockout-es5"]=kh,Wp.knockout=Fh,Wp.measureText=Bh,Wp["mersenne-twister"]=Uh,Wp.NoSleep=Vh,Wp.pako_inflate=zh,Wp["protobuf-minimal"]=Gh,Wp.FXAA3_11=Hh,Wp.sprintf=Wh,Wp.topojson=jh,Wp.Tween=qh,Wp.Uri=Yh,Wp.when=Xh,Wp.zip=Qh,Wp.Animation=Zh,Wp.AnimationViewModel=Kh,Wp.BaseLayerPicker=Jh,Wp.BaseLayerPickerViewModel=$h,Wp.createDefaultImageryProviderViewModels=ep,Wp.createDefaultTerrainProviderViewModels=tp,Wp.ProviderViewModel=rp,Wp.Cesium3DTilesInspector=ip,Wp.Cesium3DTilesInspectorViewModel=np,Wp.CesiumInspector=op,Wp.CesiumInspectorViewModel=ap,Wp.CesiumWidget=sp,Wp.ClockViewModel=lp,Wp.Command=up,Wp.createCommand=cp,Wp.FullscreenButton=dp,Wp.FullscreenButtonViewModel=hp,Wp.Geocoder=pp,Wp.GeocoderViewModel=fp,Wp.getElement=mp,Wp.HomeButton=gp,Wp.HomeButtonViewModel=vp,Wp.InfoBox=_p,Wp.InfoBoxViewModel=yp,Wp.NavigationHelpButton=bp,Wp.NavigationHelpButtonViewModel=Cp,Wp.PerformanceWatchdog=wp,Wp.PerformanceWatchdogViewModel=Sp,Wp.ProjectionPicker=Tp,Wp.ProjectionPickerViewModel=Ep,Wp.SceneModePicker=xp,Wp.SceneModePickerViewModel=Pp,Wp.SelectionIndicator=Ap,Wp.SelectionIndicatorViewModel=Dp,Wp.subscribeAndEvaluate=Ip,Wp.SvgPathBindingHandler=Op,Wp.Timeline=Mp,Wp.TimelineHighlightRange=Rp,Wp.TimelineTrack=Lp,Wp.ToggleButtonViewModel=Np,Wp.Viewer=kp,Wp.viewerCesium3DTilesInspectorMixin=Fp,Wp.viewerCesiumInspectorMixin=Bp,Wp.viewerDragDropMixin=Up,Wp.viewerPerformanceWatchdogMixin=Vp,Wp.VRButton=zp,Wp.VRButtonViewModel=Gp,Wp.createTaskProcessorWorker=Hp,Wp});require(["Cesium"],function(e){"use strict";("undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Cesium=e},void 0,!0)}();