Cesium.js 2.7 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. /**
  2. * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
  3. *
  4. * Copyright 2011-2017 Cesium Contributors
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * Columbus View (Pat. Pend.)
  19. *
  20. * Portions licensed separately.
  21. * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
  22. */
  23. /**
  24. * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
  25. * Released under MIT license, http://github.com/requirejs/almond/LICENSE
  26. */
  27. /**
  28. @license
  29. mersenne-twister.js - https://gist.github.com/banksean/300494
  30. Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
  31. All rights reserved.
  32. Redistribution and use in source and binary forms, with or without
  33. modification, are permitted provided that the following conditions
  34. are met:
  35. 1. Redistributions of source code must retain the above copyright
  36. notice, this list of conditions and the following disclaimer.
  37. 2. Redistributions in binary form must reproduce the above copyright
  38. notice, this list of conditions and the following disclaimer in the
  39. documentation and/or other materials provided with the distribution.
  40. 3. The names of its contributors may not be used to endorse or promote
  41. products derived from this software without specific prior written
  42. permission.
  43. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  46. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  47. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  48. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  49. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  50. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  51. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  52. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  53. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. /**
  56. * @license
  57. *
  58. * Grauw URI utilities
  59. *
  60. * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
  61. *
  62. * @author Laurens Holst (http://www.grauw.nl/)
  63. *
  64. * Copyright 2012 Laurens Holst
  65. *
  66. * Licensed under the Apache License, Version 2.0 (the "License");
  67. * you may not use this file except in compliance with the License.
  68. * You may obtain a copy of the License at
  69. *
  70. * http://www.apache.org/licenses/LICENSE-2.0
  71. *
  72. * Unless required by applicable law or agreed to in writing, software
  73. * distributed under the License is distributed on an "AS IS" BASIS,
  74. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  75. * See the License for the specific language governing permissions and
  76. * limitations under the License.
  77. *
  78. */
  79. /**
  80. @license
  81. when.js - https://github.com/cujojs/when
  82. MIT License (c) copyright B Cavalier & J Hann
  83. * A lightweight CommonJS Promises/A and when() implementation
  84. * when is part of the cujo.js family of libraries (http://cujojs.com/)
  85. *
  86. * Licensed under the MIT License at:
  87. * http://www.opensource.org/licenses/mit-license.php
  88. *
  89. * @version 1.7.1
  90. */
  91. /**
  92. @license
  93. sprintf.js from the php.js project - https://github.com/kvz/phpjs
  94. Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js
  95. php.js is copyright 2012 Kevin van Zonneveld.
  96. Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
  97. (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
  98. (http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
  99. Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
  100. Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
  101. Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
  102. (https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
  103. Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
  104. L. Rodrigues (http://www.jsfromhell.com), Ash Searle
  105. (http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
  106. Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
  107. Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
  108. http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
  109. Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
  110. (http://webdevhobo.blogspot.com/), marrtins, GeekFG
  111. (http://geekfg.blogspot.com), Andrea Giammarchi
  112. (http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
  113. gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
  114. Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
  115. (http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
  116. Marc Palau, Martin
  117. (http://www.erlenwiese.de/), Breaking Par Consulting Inc
  118. (http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
  119. Chris, Mirek Slugen, saulius, Alfonso Jimenez
  120. (http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
  121. Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
  122. Ariede (http://caioariede.com), Robin, Kankrelune
  123. (http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
  124. (http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
  125. Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
  126. David, Aman Gupta, Michael White, Public Domain
  127. (http://www.json.org/json2.js), Steven Levithan
  128. (http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
  129. Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
  130. Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
  131. (http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
  132. Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
  133. Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
  134. (http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
  135. (http://javascript.crockford.com), madipta, Slawomir Kaniecki,
  136. ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
  137. (http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
  138. Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
  139. (https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
  140. Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
  141. (http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
  142. josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
  143. Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
  144. (http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
  145. (http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
  146. Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
  147. (http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
  148. (http://yass.meetcweb.com), Peter-Paul Koch
  149. (http://www.quirksmode.org/js/beat.html), Olivier Louvignes
  150. (http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
  151. Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
  152. vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
  153. Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
  154. (http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
  155. B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
  156. (http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
  157. Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
  158. Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
  159. (http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
  160. Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
  161. Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
  162. sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
  163. Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
  164. (http://www.premasolutions.com/), Philippe Jausions
  165. (http://pear.php.net/user/jausions), Aidan Lister
  166. (http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
  167. strcmp, Taras Bogach, jpfle, Alexander Ermolaev
  168. (http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
  169. dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
  170. (http://www.pedrotainha.com), James, Arnout Kazemier
  171. (http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
  172. FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
  173. Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
  174. daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
  175. W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
  176. (http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
  177. Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
  178. (http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
  179. Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
  180. Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
  181. (http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
  182. Russell Walker (http://www.nbill.co.uk/), Jamie Beck
  183. (http://www.terabit.ca/), setcookie, Michael, YUI Library:
  184. http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
  185. http://hacks.bluesmoon.info/strftime/strftime.js, Ben
  186. (http://benblume.co.uk/), DtTvB
  187. (http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
  188. meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
  189. (http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
  190. Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
  191. Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
  192. Bryan
  193. Licensed under the MIT (MIT-LICENSE.txt) license.
  194. Permission is hereby granted, free of charge, to any person obtaining a
  195. copy of this software and associated documentation files (the
  196. "Software"), to deal in the Software without restriction, including
  197. without limitation the rights to use, copy, modify, merge, publish,
  198. distribute, sublicense, and/or sell copies of the Software, and to
  199. permit persons to whom the Software is furnished to do so, subject to
  200. the following conditions:
  201. The above copyright notice and this permission notice shall be included
  202. in all copies or substantial portions of the Software.
  203. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  204. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  205. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  206. IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
  207. OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  208. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  209. OTHER DEALINGS IN THE SOFTWARE.
  210. */
  211. // Copyright 2012 Google Inc., Apache 2.0 license.
  212. /**
  213. @license
  214. tween.js - https://github.com/sole/tween.js
  215. Copyright (c) 2010-2012 Tween.js authors.
  216. Easing equations Copyright (c) 2001 Robert Penner http://robertpenner.com/easing/
  217. Permission is hereby granted, free of charge, to any person obtaining a copy
  218. of this software and associated documentation files (the "Software"), to deal
  219. in the Software without restriction, including without limitation the rights
  220. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  221. copies of the Software, and to permit persons to whom the Software is
  222. furnished to do so, subject to the following conditions:
  223. The above copyright notice and this permission notice shall be included in
  224. all copies or substantial portions of the Software.
  225. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  226. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  227. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  228. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  229. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  230. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  231. THE SOFTWARE.
  232. */
  233. /*!
  234. * protobuf.js v6.7.0 (c) 2016, Daniel Wirtz
  235. * Compiled Wed, 22 Mar 2017 17:30:26 UTC
  236. * Licensed under the BSD-3-Clause License
  237. * see: https://github.com/dcodeIO/protobuf.js for details
  238. */
  239. /**
  240. * Dictionary of provider id to copyright strings.
  241. * @type {Object}
  242. * @default {}
  243. */
  244. /**
  245. @license
  246. fontmetrics.js - https://github.com/Pomax/fontmetrics.js
  247. Copyright (C) 2011 by Mike "Pomax" Kamermans
  248. Permission is hereby granted, free of charge, to any person obtaining a copy
  249. of this software and associated documentation files (the "Software"), to deal
  250. in the Software without restriction, including without limitation the rights
  251. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  252. copies of the Software, and to permit persons to whom the Software is
  253. furnished to do so, subject to the following conditions:
  254. The above copyright notice and this permission notice shall be included in
  255. all copies or substantial portions of the Software.
  256. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  257. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  258. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  259. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  260. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  261. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  262. THE SOFTWARE.
  263. **/
  264. /**
  265. @license
  266. topojson - https://github.com/mbostock/topojson
  267. Copyright (c) 2012, Michael Bostock
  268. All rights reserved.
  269. Redistribution and use in source and binary forms, with or without
  270. modification, are permitted provided that the following conditions are met:
  271. * Redistributions of source code must retain the above copyright notice, this
  272. list of conditions and the following disclaimer.
  273. * Redistributions in binary form must reproduce the above copyright notice,
  274. this list of conditions and the following disclaimer in the documentation
  275. and/or other materials provided with the distribution.
  276. * The name Michael Bostock may not be used to endorse or promote products
  277. derived from this software without specific prior written permission.
  278. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  279. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  280. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  281. DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
  282. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  283. BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  284. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  285. OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  286. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  287. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  288. */
  289. /*!
  290. * Autolinker.js
  291. * 0.17.1
  292. *
  293. * Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com>
  294. * MIT Licensed. http://www.opensource.org/licenses/mit-license.php
  295. *
  296. * https://github.com/gregjacobs/Autolinker.js
  297. */
  298. /**
  299. @license
  300. Copyright (c) 2013 Gildas Lormeau. All rights reserved.
  301. Redistribution and use in source and binary forms, with or without
  302. modification, are permitted provided that the following conditions are met:
  303. 1. Redistributions of source code must retain the above copyright notice,
  304. this list of conditions and the following disclaimer.
  305. 2. Redistributions in binary form must reproduce the above copyright
  306. notice, this list of conditions and the following disclaimer in
  307. the documentation and/or other materials provided with the distribution.
  308. 3. The names of the authors may not be used to endorse or promote products
  309. derived from this software without specific prior written permission.
  310. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  311. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  312. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
  313. INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
  314. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  315. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  316. OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  317. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  318. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  319. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  320. **/
  321. /**
  322. * @license
  323. * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
  324. *
  325. * Redistribution and use in source and binary forms, with or without
  326. * modification, are permitted provided that the following conditions
  327. * are met:
  328. * * Redistributions of source code must retain the above copyright
  329. * notice, this list of conditions and the following disclaimer.
  330. * * Redistributions in binary form must reproduce the above copyright
  331. * notice, this list of conditions and the following disclaimer in the
  332. * documentation and/or other materials provided with the distribution.
  333. * * Neither the name of NVIDIA CORPORATION nor the names of its
  334. * contributors may be used to endorse or promote products derived
  335. * from this software without specific prior written permission.
  336. *
  337. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  338. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  339. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  340. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  341. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  342. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  343. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  344. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  345. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  346. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  347. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  348. */
  349. /**
  350. * @license
  351. * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com)
  352. * All rights reserved.
  353. *
  354. * Redistribution and use in source and binary forms, with or without
  355. * modification, are permitted provided that the following conditions
  356. * are met:
  357. *
  358. * * Redistributions of source code must retain the above copyright notice,
  359. * this list of conditions and the following disclaimer.
  360. * * Redistributions in binary form must reproduce the above copyright notice,
  361. * this list of conditions and the following disclaimer in the documentation
  362. * and/or other materials provided with the distribution.
  363. * * Neither the name of the project nor the names of its contributors may be
  364. * used to endorse or promote products derived from this software without
  365. * specific prior written permission.
  366. *
  367. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  368. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  369. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  370. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  371. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  372. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  373. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  374. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  375. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  376. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  377. *
  378. * Modifications made by Analytical Graphics, Inc.
  379. */
  380. /**
  381. * @licence
  382. *
  383. * crunch/crnlib v1.04 - Advanced DXTn texture compression library
  384. * Copyright (C) 2010-2016 Richard Geldreich, Jr. and Binomial LLC http://binomial.info
  385. */
  386. /**
  387. * @license
  388. *
  389. * crunch_lib.cpp
  390. *
  391. * Copyright (c) 2013, Evan Parker, Brandon Jones. All rights reserved.
  392. *
  393. * Redistribution and use in source and binary forms, with or without modification,
  394. * are permitted provided that the following conditions are met:
  395. *
  396. * * Redistributions of source code must retain the above copyright notice, this
  397. * list of conditions and the following disclaimer.
  398. * * Redistributions in binary form must reproduce the above copyright notice,
  399. * this list of conditions and the following disclaimer in the documentation
  400. * and/or other materials provided with the distribution.
  401. *
  402. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  403. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  404. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  405. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  406. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  407. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  408. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  409. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  410. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  411. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  412. */
  413. /*!
  414. * Knockout JavaScript library v3.4.2
  415. * (c) The Knockout.js team - http://knockoutjs.com/
  416. * License: MIT (http://www.opensource.org/licenses/mit-license.php)
  417. */
  418. /**
  419. * @license
  420. * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
  421. * Copyright (c) Steve Sanderson
  422. * MIT license
  423. */
  424. /**
  425. * @license
  426. * NoSleep.js v0.5.0 - git.io/vfn01
  427. * Rich Tibbett
  428. * MIT license
  429. **/
  430. !function(){var requirejs,require,define;!function(e){function t(e,t){return _.call(e,t)}function r(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=g.map,v=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,g.nodeIdCompat&&b.test(e[a])&&(e[a]=e[a].replace(b,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c<e.length;c++)if("."===(h=e[c]))e.splice(c,1),c-=1;else if(".."===h){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||v)&&m){for(r=e.split("/"),c=r.length;c>0;c-=1){if(i=r.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if((n=m[f.slice(0,d).join("/")])&&(n=n[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<n.length;y+=1)if(_=h(n[y],b),"require"===(d=_.f))w[y]=p.require(r);else if("exports"===d)w[y]=p.exports(r),C=!0;else if("module"===d)c=w[y]=p.module(r);else if(t(f,d)||t(m,d)||t(v,d))w[y]=a(d);else{if(!_.p)throw new Error(r+" missing "+d);_.p.load(_.n,i(u,!0),o(d),{}),w[y]=f[d]}g=s?s.apply(f[r],w):void 0,r&&(c&&c.exports!==e&&c.exports!==f[r]?f[r]=c.exports:g===e&&C||(f[r]=g))}else r&&(f[r]=s)},requirejs=require=d=function(t,r,i,n,o){if("string"==typeof t)return p[t]?p[t](r):a(h(t,l(r)).f);if(!t.splice){if(g=t,g.deps&&d(g.deps,g.callback),!r)return;r.splice?(t=r,r=i,i=null):t=e}return r=r||function(){},"function"==typeof i&&(i=n,n=o),n?c(e,t,r,i):setTimeout(function(){c(e,t,r,i)},4),d},d.config=function(e){return d(e)},requirejs._defined=f,define=function(e,r,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");r.splice||(i=r,r=[]),t(f,e)||t(m,e)||(m[e]=[e,r,i])},define.amd={jQuery:!0}}(),define("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var n={};return n.typeOf={},n.defined=function(i,n){if(!e(n))throw new t(r(i))},n.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(i(typeof r,"function",e))},n.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(i(typeof r,"string",e))},n.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(i(typeof r,"number",e))},n.typeOf.number.lessThan=function(e,r,i){if(n.typeOf.number(e,r),r>=i)throw new t("Expected "+e+" to be less than "+i+", actual value was "+r)},n.typeOf.number.lessThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r>i)throw new t("Expected "+e+" to be less than or equal to "+i+", actual value was "+r)},n.typeOf.number.greaterThan=function(e,r,i){if(n.typeOf.number(e,r),r<=i)throw new t("Expected "+e+" to be greater than "+i+", actual value was "+r)},n.typeOf.number.greaterThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r<i)throw new t("Expected "+e+" to be greater than or equal to"+i+", actual value was "+r)},n.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(i(typeof r,"object",e))},n.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(i(typeof r,"boolean",e))},n.typeOf.number.equals=function(e,r,i,o){if(n.typeOf.number(e,i),n.typeOf.number(r,o),i!==o)throw new t(e+" must be equal to "+r+", the actual values are "+i+" and "+o)},n}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/arrayFill",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i,n){if("function"==typeof e.fill)return e.fill(r,i,n);for(var o=e.length>>>0,a=t(i,0),s=a<0?Math.max(o+a,0):Math.min(a,o),l=t(n,o),u=l<0?Math.max(o+l,0):Math.min(l,o);s<u;)e[s]=r,s++;return e}return i}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>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&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,r,i,n){n=t(n,i);var o=Math.abs(e-r);return o<=n||o<=i*Math.max(Math.abs(e),Math.abs(r))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;i<=e;i++)o.push(r*i);return o[e]},n.incrementWrap=function(e,r,i){return i=t(i,0),++e,e>r&&(e=i),e},n.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},n.clamp=function(e,t,r){return e<t?t:e>r?r:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.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;s<a&&(l=e[s-1],u=e[s],!i(l,u,o));++s);if(s===a)return n&&i(e[0],e[e.length-1],o)?e.slice(1):e;for(var c=e.slice(0,s);s<a;++s)u=e[s],i(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&i(c[0],c[c.length-1],o)&&c.shift(),c}}var o=i.EPSILON10;return n}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(){this._array=[],this._hash={}}return t(i.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),i.prototype.contains=function(t){return e(this._hash[t])},i.prototype.set=function(e,t){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;n<i;++n)a.pack(e[n],t,2*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/2:t=new Array(i/2);for(var n=0;n<i;n+=2){var o=n/2;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,u),a.normalize(t,c),o.acosClamped(a.dot(u,c))};var d=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0)}a.fromSpherical=function(e,i){r(i)||(i=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return i.x=l*Math.cos(n),i.y=l*Math.sin(n),i.z=s*Math.cos(o),i},a.fromElements=function(e,t,i,n){return r(n)?(n.x=e,n.y=t,n.z=i,n):new a(e,t,i)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i]=e.z,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=3*i:t=new Array(3*i);for(var n=0;n<i;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/3:t=new Array(i/3);for(var n=0;n<i;n+=3){var o=n/3;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var r=a.dot(u,c),i=a.magnitude(a.cross(u,c,u));return Math.atan2(i,r)};var d=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)},a.cross=function(e,t,r){var i=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-i*l,d=i*s-n*a;return r.x=u,r.y=c,r.z=d,r},a.fromDegrees=function(e,t,r,i,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,i,n)};var h=new a,p=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,i,n,o,s){n=t(n,0);var l=r(o)?o.radiiSquared:f,u=Math.cos(i);h.x=u*Math.cos(e),h.y=u*Math.sin(e),h.z=Math.sin(i),h=a.normalize(h,h),a.multiplyComponents(l,h,p);var c=Math.sqrt(a.dot(h,p));return p=a.divideByScalar(p,c,p),h=a.multiplyByScalar(h,n,h),r(s)||(s=new a),a.add(p,h,s)},a.fromDegreesArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromDegrees(s,l,0,t,i[u])}return i},a.fromRadiansArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromRadians(s,l,0,t,i[u])}return i},a.fromDegreesArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;i[c]=a.fromDegrees(s,l,u,t,i[c])}return i},a.fromRadiansArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;i[c]=a.fromRadians(s,l,u,t,i[c])}return i},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,i,n,o){"use strict";var a={};a.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=r.x,n=r.y;r.x=(1-Math.abs(n))*o.signNotZero(i),r.y=(1-Math.abs(i))*o.signNotZero(n)}return r.x=o.toSNorm(r.x,t),r.y=o.toSNorm(r.y,t),r},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,r,i,n){if(n.x=o.fromSNorm(e,i),n.y=o.fromSNorm(r,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){return 256*e.x+e.y};var s=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,s),a.octPackFloat(s)},a.octDecodeFloat=function(e,t){var r=e/256,i=Math.floor(r),n=256*(r-i);return a.octDecode(i,n,t)},a.octPack=function(e,t,r,i){var n=a.octEncodeFloat(e),o=a.octEncodeFloat(t),l=a.octEncode(r,s);return i.x=65536*l.x+n,i.y=65536*l.y+o,i},a.octUnpack=function(e,t,r,i){var n=e.x/65536,o=Math.floor(n),s=65536*(n-o);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);a.octDecodeFloat(s,t),a.octDecodeFloat(u,r),a.octDecode(o,l,i)},a.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},a.decompressTextureCoordinates=function(e,t){var r=e/4096,i=Math.floor(r);return t.x=i/4095,t.y=(e-4096*i)/4095,t},a}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";return e({OUTSIDE:-1,INTERSECTING:0,INSIDE:1})}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,r,i,n){"use strict";function o(t,n,o){this.minimum=e.clone(r(t,e.ZERO)),this.maximum=e.clone(r(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,d=t.length,h=1;h<d;h++){var p=t[h],f=p.x,m=p.y,g=p.z;n=Math.min(f,n),l=Math.max(f,l),a=Math.min(m,a),u=Math.max(m,u),s=Math.min(g,s),c=Math.max(g,c)}var v=r.minimum;v.x=n,v.y=a,v.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(v,_,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){if(i(t))return i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum)},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,r){a=e.subtract(t.maximum,t.minimum,a);var i=e.multiplyByScalar(a,.5,a),o=r.normal,s=i.x*Math.abs(o.x)+i.y*Math.abs(o.y)+i.z*Math.abs(o.z),l=e.dot(t.center,o)+r.distance;return l-s>0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,i){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,g,v,_;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),g=t.dot(d,p),v=t.dot(h,h),_=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),g=e.dot(d,p),v=e.dot(h,h),_=e.dot(h,p));var y=1/(f*v-m*m);return c.y=(v*g-m*_)*y,c.z=(f*_-m*g)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var i,n,o=0,a=e.length-1;o<=a;)if(i=~~((o+a)/2),(n=r(e[i],t))<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;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function p(t,r){var i=b.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function f(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function m(e,t){for(var r,i=0;r=e[i++];)r(t)}function g(e,t){for(var r,i=t.length;i>e;)if(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(;o<n;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function r(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),d=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],d&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],u[a]="object"==typeof l?r(s,l,o):s):u[a]=s);if(d)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return r}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(e){var t="";for(var i in e)if(e.hasOwnProperty(i)){var n=e[i],o=encodeURIComponent(i)+"=";if(r(n))for(var a=0,s=n.length;a<s;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return i}),define("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(t){var i={};if(""===t)return i;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;o<a;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=i[l];"string"==typeof c?i[l]=[c,u]:r(c)?c.push(u):i[l]=u}return i}return i}),define("Core/RequestState",["../Core/freezeObject"],function(e){
  431. "use strict";return e({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5})}),define("Core/RequestType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3})}),define("Core/Request",["./defaultValue","./defined","./defineProperties","./RequestState","./RequestType"],function(e,t,r,i,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.throttleByServer,!1),o=r||e(t.throttle,!1);this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=e(t.priority,0),this.throttle=o,this.throttleByServer=r,this.type=e(t.type,n.OTHER),this.serverKey=void 0,this.state=i.UNISSUED,this.deferred=void 0,this.cancelled=!1}return o.prototype.cancel=function(){this.cancelled=!0},o}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n}return t}),define("Core/Heap",["./Check","./defaultValue","./defined","./defineProperties"],function(e,t,r,i){"use strict";function n(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function o(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}return i(n.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),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<r&&i(n[u],n[e])<0?u:e,l<r&&i(n[l],n[a])<0&&(a=l),a!==e?(o(n,a,e),e=a):s=!1}},n.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},n.prototype.insert=function(e){var t=this._array,i=this._comparator,n=this._maximumLength,a=this._length++;for(a<t.length?t[a]=e:t.push(e);0!==a;){var s=Math.floor((a-1)/2);if(!(i(t[a],t[s])<0))break;o(t,a,s),a=s}var l;return r(n)&&this._length>n&&(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]<d.maximumRequestsPerServer}function f(e){return e.state===u.UNISSUED&&(e.state=u.ISSUED,e.deferred=t.defer()),e.deferred.promise}function m(e){return function(t){e.state!==u.CANCELLED&&(--C.numberOfActiveRequests,--E[e.serverKey],e.state=u.RECEIVED,e.deferred.resolve(t))}}function g(e){return function(t){e.state!==u.CANCELLED&&(++C.numberOfFailedRequests,--C.numberOfActiveRequests,--E[e.serverKey],e.state=u.FAILED,e.deferred.reject(t))}}function v(e){var t=f(e);return e.state=u.ACTIVE,T.push(e),++C.numberOfActiveRequests,++C.numberOfActiveRequestsEver,++E[e.serverKey],e.requestFunction().then(m(e)).otherwise(g(e)),t}function _(e){var t=e.state===u.ACTIVE;e.state=u.CANCELLED,++C.numberOfCancelledRequests,e.deferred.reject(),t&&(--C.numberOfActiveRequests,--E[e.serverKey],++C.numberOfCancelledActiveRequests),n(e.cancelFunction)&&e.cancelFunction()}function y(){C.numberOfAttemptedRequests=0,C.numberOfCancelledRequests=0,C.numberOfCancelledActiveRequests=0}function b(){d.debugShowStatistics&&(C.numberOfAttemptedRequests>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(e<w)for(;S.length>e;){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;e<i;++e)t=T[e],t.cancelled&&_(t),t.state===u.ACTIVE?r>0&&(T[e-r]=t):++r;T.length-=r;var n=S.internalArray,o=S.length;for(e=0;e<o;++e)h(n[e]);S.resort();for(var a=Math.max(d.maximumRequests-T.length,0),s=0;s<a&&S.length>0;)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;t<e;++t)_(T[t]);T.length=0,E={},C.numberOfAttemptedRequests=0,C.numberOfActiveRequests=0,C.numberOfCancelledRequests=0,C.numberOfCancelledActiveRequests=0,C.numberOfFailedRequests=0,C.numberOfActiveRequestsEver=0},d.numberOfActiveRequestsByServer=function(e){return E[e]},d.requestHeap=S,d}),define("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject","./Request","./RequestScheduler"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(o,d,h){d=i(d,i.EMPTY_OBJECT);var p;do{p="loadJsonp"+Math.random().toString().substring(2,8)}while(n(window[p]));var f=new e(o),m=s(i(f.query,""));n(d.parameters)&&(m=r(d.parameters,m)),m[i(d.callbackParameterName,"callback")]=p,f.query=a(m),o=f.toString();var g=d.proxy;return n(g)&&(o=g.getURL(o)),h=n(h)?h:new l,h.url=o,h.requestFunction=function(){var e=t.defer();return window[p]=function(t){e.resolve(t);try{delete window[p]}catch(e){window[p]=void 0}},c.loadAndExecuteScript(o,p,e),e.promise},u.request(h)}return c.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},c.defaultLoadAndExecuteScript=c.loadAndExecuteScript,c}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(r,n,s,l,u){var c=r.x,d=r.y,h=r.z,p=n.x,f=n.y,m=n.z,g=c*c*p*p,v=d*d*f*f,_=h*h*m*m,y=g+v+_,b=Math.sqrt(1/y),C=e.multiplyByScalar(r,b,o);if(y<l)return isFinite(b)?e.clone(C,u):void 0;var w=s.x,S=s.y,T=s.z,E=a;E.x=C.x*w*2,E.y=C.y*S*2,E.z=C.z*T*2;var x,P,A,D,I,O,M,R,L,N,k,F=(1-b)*e.magnitude(r)/(.5*e.magnitude(E)),B=0;do{F-=B,A=1/(1+F*w),D=1/(1+F*S),I=1/(1+F*T),O=A*A,M=D*D,R=I*I,L=O*A,N=M*D,k=R*I,x=g*O+v*M+_*R-1,P=g*L*w+v*N*S+_*k*T;B=x/(-2*P)}while(Math.abs(x)>i.EPSILON12);return t(u)?(u.x=c*A,u.y=d*D,u.z=h*I,u):new e(c*A,d*D,h*I)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,i){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(i,0)}s.fromRadians=function(e,t,n,o){return n=r(n,0),i(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new s(e,t,n)},s.fromDegrees=function(e,t,r,i){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,r,i)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,g=i(r)?r._centerToleranceSquared:p,v=a(t,f,m,g,u);if(i(v)){var _=e.multiplyComponents(v,m,l);_=e.normalize(_,_);var y=e.subtract(t,v,c),b=Math.atan2(_.y,_.x),C=Math.asin(_.z),w=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=b,n.latitude=C,n.height=w,n):new s(b,C,w)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./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<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,m=new e,g=new e;return d.prototype.cartesianToCartographic=function(r,i){var o=this.scaleToGeodeticSurface(r,m);if(n(o)){var a=this.geodeticSurfaceNormal(o,f),s=e.subtract(r,o,g),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),d=l.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=u,i.latitude=c,i.height=d,i):new t(u,c,d)}},d.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},d.prototype.scaleToGeodeticSurface=function(e,t){return u(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},d.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(i*i*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,r)},d.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},d.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},d.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},d.prototype.toString=function(){return this._radii.toString()},d.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,r,o){r=i(r,0);var a=this._squaredXOverSquaredZ;if(n(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=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<r&&(t+=s.TWO_PI),t-r},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,t,n,o,a){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),n=s.toRadians(r(n,0)),o=s.toRadians(r(o,0)),i(a)?(a.west=e,a.south=t,a.east=n,a.north=o,a):new l(e,t,n,o)},l.fromRadians=function(e,t,n,o,a){return i(a)?(a.west=r(e,0),a.south=r(t,0),a.east=r(n,0),a.north=r(o,0),a):new l(e,t,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var p=e[d];r=Math.min(r,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var f=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,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<m;f++){var g=t.cartesianToCartographic(e[f]);a=Math.min(a,g.longitude),u=Math.max(u,g.longitude),h=Math.min(h,g.latitude),p=Math.max(p,g.latitude);var v=g.longitude>=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;n<o&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),d=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&d<=c)){var h=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(h>=p))return i(r)?(r.west=c,r.south=h,r.east=d,r.north=p,r):new l(c,h,d,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(o,u)),d=s.convertLongitudeRange(Math.max(n,a));return r.west=c,r.south=Math.min(e.south,t.south),r.east=d,r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},l.contains=function(e,t){var r=t.longitude,i=t.latitude,n=e.west,o=e.east;return o<n&&(o+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>n||s.equalsEpsilon(r,n,s.EPSILON14))&&(r<o||s.equalsEpsilon(r,o,s.EPSILON14))&&i>=e.south&&i<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0),i(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,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;u<r;u++){var c=e[u],d=c.x,h=c.y;i=Math.min(d,i),a=Math.max(d,a),o=Math.min(h,o),s=Math.max(h,s)}return t.x=i,t.y=o,t.width=a-i,t.height=s-o,t};var u=new o,c=new t,d=new t;return l.fromRectangle=function(t,r,o){if(n(o)||(o=new l),!n(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;r=i(r,u);var a=r.project(s.southwest(t,c)),h=r.project(s.northeast(t,d));return e.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height)},l.union=function(e,t,r){n(r)||(r=new l);var i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return r.x=i,r.y=o,r.width=a-i,r.height=s-o,r},l.expand=function(e,t,r){r=l.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:i<0&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:n<0&&(r.height-=n,r.y=t.y),r},l.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.width<n||i+e.height<o||i>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,o,a,s,l,u){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(s,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(l,0),this[6]=r(i,0),this[7]=r(a,0),this[8]=r(u,0)}function u(e){for(var t=0,r=0;r<9;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var i=e[l.getElementIndex(m[r],f[r])];t+=2*i*i}return Math.sqrt(t)}function d(e,t){for(var r=s.EPSILON15,i=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>i&&(n=o,i=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>r){var p,g=e[l.getElementIndex(h,h)],v=e[l.getElementIndex(d,d)],_=e[l.getElementIndex(h,d)],y=(g-v)/2/_;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=r-s-d+p,m=2*(n-h),g=2*(o+c),v=2*(n+h),_=-r+s-d+p,y=2*(u-a),b=2*(o-c),C=2*(u+a),w=-r-s+d+p;return i(t)?(t[0]=f,t[1]=v,t[2]=b,t[3]=m,t[4]=_,t[5]=C,t[6]=g,t[7]=y,t[8]=w,t):new l(f,m,g,v,_,y,b,C,w)},l.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=r*s,f=o*n+u*a*s,m=-u*n+o*a*s,g=-a,v=u*r,_=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=g,t[3]=d,t[4]=f,t[5]=v,t[6]=h,t[7]=m,t[8]=_,t):new l(c,d,h,p,f,m,g,v,_)},l.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new l(e.x,0,0,0,e.y,0,0,0,e.z)},l.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new l(e,0,0,0,e,0,0,0,e)},l.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new l(1,0,0,0,r,-n,0,n,r)},l.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new l(r,0,n,0,1,0,-n,0,r)},l.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(r,-n,0,n,r,0,0,0,1)},l.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,r){var i=3*t,n=e[i],o=e[i+1],a=e[i+2];return r.x=n,r.y=o,r.z=a,r},l.setColumn=function(e,t,r,i){i=l.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},l.getRow=function(e,t,r){var i=e[t],n=e[t+3],o=e[t+6];return r.x=i,r.y=n,r.z=o,r},l.setRow=function(e,t,r,i){return i=l.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i};var h=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=u,r[7]=c,r[8]=d,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},l.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[3]*n+e[6]*o,s=e[1]*i+e[4]*n+e[7]*o,l=e[2]*i+e[5]*n+e[8]*o;return r.x=a,r.y=s,r.z=l,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},l.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},l.transpose=function(e,t){var r=e[0],i=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],g=new l,v=new l;return l.computeEigenDecomposition=function(e,t){var r=s.EPSILON20,n=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(){
  432. return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)}a.fromElements=function(e,t,i,n,o){return r(o)?(o.x=e,o.y=t,o.z=i,o.w=n,o):new a(e,t,i,n)},a.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i++],n.w=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=4*i:t=new Array(4*i);for(var n=0;n<i;++n)a.pack(e[n],t,4*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/4:t=new Array(i/4);for(var n=0;n<i;n+=4){var o=n/4;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)&&o.equalsEpsilon(e.w,t.w,i,n)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,n,o,a,s,l,u,c,d,h,p,f,m,g){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(p,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(f,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(d,0),this[11]=i(m,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(h,0),this[15]=i(g,0)}c.packedLength=16,c.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,r){return t=i(t,0),n(r)||(r=new c),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},c.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,r,o){return r=i(r,e.ZERO),n(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,i){n(i)||(i=new c);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,u=t.x*t.y,d=t.x*t.z,h=t.x*t.w,p=t.y*t.y,f=t.y*t.z,m=t.y*t.w,g=t.z*t.z,v=t.z*t.w,_=t.w*t.w,y=l-p-g+_,b=2*(u-v),C=2*(d+m),w=2*(u+v),S=-l+p-g+_,T=2*(f-h),E=2*(d-m),x=2*(f+h),P=-l-p+g+_;return i[0]=y*o,i[1]=w*o,i[2]=E*o,i[3]=0,i[4]=b*a,i[5]=S*a,i[6]=x*a,i[7]=0,i[8]=C*s,i[9]=T*s,i[10]=P*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(l.IDENTITY,e,t)},c.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,p=new e;c.fromCamera=function(t,r){var i=t.position,o=t.direction,a=t.up;e.normalize(o,d),e.normalize(e.cross(d,a,h),h),e.normalize(e.cross(h,d,p),p);var s=h.x,l=h.y,u=h.z,f=d.x,m=d.y,g=d.z,v=p.x,_=p.y,y=p.z,b=i.x,C=i.y,w=i.z,S=s*-b+l*-C+u*-w,T=v*-b+_*-C+y*-w,E=f*b+m*C+g*w;return n(r)?(r[0]=s,r[1]=v,r[2]=-f,r[3]=0,r[4]=l,r[5]=_,r[6]=-m,r[7]=0,r[8]=u,r[9]=y,r[10]=-g,r[11]=0,r[12]=S,r[13]=T,r[14]=E,r[15]=1,r):new c(s,l,u,S,v,_,y,T,-f,-m,-g,E,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,i,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(i+r)/(r-i),u=2*i*r/(r-i);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},c.computeOrthographicOffCenter=function(e,t,r,i,n,o,a){var s=1/(t-e),l=1/(i-r),u=1/(o-n),c=-(t+e)*s,d=-(i+r)*l,h=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=d,a[14]=h,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,r,i,n,o,a){var s=2*n/(t-e),l=2*n/(i-r),u=(t+e)/(t-e),c=(i+r)/(i-r),d=-(o+n)/(o-n),h=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=d,a[11]=-1,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,i,n,o){var a=2*n/(t-e),s=2*n/(i-r),l=(t+e)/(t-e),u=(i+r)/(i-r),c=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,d=.5*(r-t),h=u,p=c,f=d,m=o+u,g=a+c,v=t+d;return n[0]=h,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=f,n[11]=0,n[12]=m,n[13]=g,n[14]=v,n[15]=1,n},c.computeView=function(t,r,i,n,o){return o[0]=n.x,o[1]=i.x,o[2]=-r.x,o[3]=0,o[4]=n.y,o[5]=i.y,o[6]=-r.y,o[7]=0,o[8]=n.z,o[9]=i.z,o[10]=-r.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(i,t),o[14]=e.dot(r,t),o[15]=1,o},c.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var i=4*t,n=e[i],o=e[i+1],a=e[i+2],s=e[i+3];return r.x=n,r.y=o,r.z=a,r.w=s,r},c.setColumn=function(e,t,r,i){i=c.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},c.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},c.getRow=function(e,t,r){var i=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return r.x=i,r.y=n,r.z=o,r.w=a,r},c.setRow=function(e,t,r,i){return i=c.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i};var f=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.multiply=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],_=e[15],y=t[0],b=t[1],C=t[2],w=t[3],S=t[4],T=t[5],E=t[6],x=t[7],P=t[8],A=t[9],D=t[10],I=t[11],O=t[12],M=t[13],R=t[14],L=t[15],N=i*y+s*b+d*C+m*w,k=n*y+l*b+h*C+g*w,F=o*y+u*b+p*C+v*w,B=a*y+c*b+f*C+_*w,U=i*S+s*T+d*E+m*x,V=n*S+l*T+h*E+g*x,z=o*S+u*T+p*E+v*x,G=a*S+c*T+f*E+_*x,H=i*P+s*A+d*D+m*I,W=n*P+l*A+h*D+g*I,j=o*P+u*A+p*D+v*I,q=a*P+c*A+f*D+_*I,Y=i*O+s*M+d*R+m*L,X=n*O+l*M+h*R+g*L,Q=o*O+u*M+p*R+v*L,Z=a*O+c*M+f*R+_*L;return r[0]=N,r[1]=k,r[2]=F,r[3]=B,r[4]=U,r[5]=V,r[6]=z,r[7]=G,r[8]=H,r[9]=W,r[10]=j,r[11]=q,r[12]=Y,r[13]=X,r[14]=Q,r[15]=Z,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},c.multiplyTransformation=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=e[12],p=e[13],f=e[14],m=t[0],g=t[1],v=t[2],_=t[4],y=t[5],b=t[6],C=t[8],w=t[9],S=t[10],T=t[12],E=t[13],x=t[14],P=i*m+a*g+u*v,A=n*m+s*g+c*v,D=o*m+l*g+d*v,I=i*_+a*y+u*b,O=n*_+s*y+c*b,M=o*_+l*y+d*b,R=i*C+a*w+u*S,L=n*C+s*w+c*S,N=o*C+l*w+d*S,k=i*T+a*E+u*x+h,F=n*T+s*E+c*x+p,B=o*T+l*E+d*x+f;return r[0]=P,r[1]=A,r[2]=D,r[3]=0,r[4]=I,r[5]=O,r[6]=M,r[7]=0,r[8]=R,r[9]=L,r[10]=N,r[11]=0,r[12]=k,r[13]=F,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=t[0],p=t[1],f=t[2],m=t[3],g=t[4],v=t[5],_=t[6],y=t[7],b=t[8],C=i*h+a*p+u*f,w=n*h+s*p+c*f,S=o*h+l*p+d*f,T=i*m+a*g+u*v,E=n*m+s*g+c*v,x=o*m+l*g+d*v,P=i*_+a*y+u*b,A=n*_+s*y+c*b,D=o*_+l*y+d*b;return r[0]=C,r[1]=w,r[2]=S,r[3]=0,r[4]=T,r[5]=E,r[6]=x,r[7]=0,r[8]=P,r[9]=A,r[10]=D,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},c.multiplyByTranslation=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=i*e[0]+n*e[4]+o*e[8]+e[12],s=i*e[1]+n*e[5]+o*e[9]+e[13],l=i*e[2]+n*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=a,r[13]=s,r[14]=l,r[15]=e[15],r};var g=new e;c.multiplyByUniformScale=function(e,t,r){return g.x=t,g.y=t,g.z=t,c.multiplyByScale(e,g,r)},c.multiplyByScale=function(e,t,r){var i=t.x,n=t.y,o=t.z;return 1===i&&1===n&&1===o?c.clone(e,r):(r[0]=i*e[0],r[1]=i*e[1],r[2]=i*e[2],r[3]=0,r[4]=n*e[4],r[5]=n*e[5],r[6]=n*e[6],r[7]=0,r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*i+e[4]*n+e[8]*o+e[12]*a,l=e[1]*i+e[5]*n+e[9]*o+e[13]*a,u=e[2]*i+e[6]*n+e[10]*o+e[14]*a,c=e[3]*i+e[7]*n+e[11]*o+e[15]*a;return r.x=s,r.y=l,r.z=u,r.w=c,r},c.multiplyByPointAsVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o,s=e[1]*i+e[5]*n+e[9]*o,l=e[2]*i+e[6]*n+e[10]*o;return r.x=a,r.y=s,r.z=l,r},c.multiplyByPoint=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o+e[12],s=e[1]*i+e[5]*n+e[9]*o+e[13],l=e[2]*i+e[6]*n+e[10]*o+e[14];return r.x=a,r.y=s,r.z=l,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var r=e[1],i=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var v=new l,_=new l,y=new t,b=new t(0,0,0,1);return c.inverse=function(e,r){if(l.equalsEpsilon(c.getRotation(e,v),_,s.EPSILON7)&&t.equals(c.getRow(e,3,y),b))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var i=e[0],n=e[4],o=e[8],a=e[12],d=e[1],h=e[5],p=e[9],f=e[13],m=e[2],g=e[6],C=e[10],w=e[14],S=e[3],T=e[7],E=e[11],x=e[15],P=C*x,A=w*E,D=g*x,I=w*T,O=g*E,M=C*T,R=m*x,L=w*S,N=m*E,k=C*S,F=m*T,B=g*S,U=P*h+I*p+O*f-(A*h+D*p+M*f),V=A*d+R*p+k*f-(P*d+L*p+N*f),z=D*d+L*h+F*f-(I*d+R*h+B*f),G=M*d+N*h+B*p-(O*d+k*h+F*p),H=A*n+D*o+M*a-(P*n+I*o+O*a),W=P*i+L*o+N*a-(A*i+R*o+k*a),j=I*i+R*n+B*a-(D*i+L*n+F*a),q=O*i+k*n+F*o-(M*i+N*n+B*o);P=o*f,A=a*p,D=n*f,I=a*h,O=n*p,M=o*h,R=i*f,L=a*d,N=i*p,k=o*d,F=i*h,B=n*d;var Y=P*T+I*E+O*x-(A*T+D*E+M*x),X=A*S+R*E+k*x-(P*S+L*E+N*x),Q=D*S+L*T+F*x-(I*S+R*T+B*x),Z=M*S+N*T+B*E-(O*S+k*T+F*E),K=D*C+M*w+A*g-(O*w+P*g+I*C),J=N*w+P*m+L*C-(R*C+k*w+A*m),$=R*g+B*w+I*m-(F*w+D*m+L*g),ee=F*C+O*m+k*g-(N*g+B*C+M*m),te=i*U+n*V+o*z+a*G;if(Math.abs(te)<s.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=U*te,r[1]=V*te,r[2]=z*te,r[3]=G*te,r[4]=H*te,r[5]=W*te,r[6]=j*te,r[7]=q*te,r[8]=Y*te,r[9]=X*te,r[10]=Q*te,r[11]=Z*te,r[12]=K*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},c.inverseTransformation=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],d=e[12],h=e[13],p=e[14],f=-r*d-i*h-n*p,m=-o*d-a*h-s*p,g=-l*d-u*h-c*p;return t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=f,t[13]=m,t[14]=g,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=a(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this.center=e.clone(i(t,e.ZERO)),this.radius=i(r,0)}var p=new e,f=new e,m=new e,g=new e,v=new e,_=new e,y=new e,b=new e,C=new e,w=new e,S=new e,T=new e;h.fromPoints=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i,o=e.clone(t[0],y),a=e.clone(o,p),s=e.clone(o,f),l=e.clone(o,m),u=e.clone(o,g),c=e.clone(o,v),d=e.clone(o,_),E=t.length;for(i=1;i<E;i++){e.clone(t[i],o);var x=o.x,P=o.y,A=o.z;x<a.x&&e.clone(o,a),x>u.x&&e.clone(o,u),P<s.y&&e.clone(o,s),P>c.y&&e.clone(o,c),A<l.z&&e.clone(o,l),A>d.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;i<E;i++){e.clone(t[i],o);var G=e.magnitude(e.subtract(o,V,b));G>z&&(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 F<z?(e.clone(N,r.center),r.radius=F):(e.clone(V,r.center),r.radius=z),r};var E=new a,x=new e,P=new e,A=new t,D=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,r,o,a,s){if(n(s)||(s=new h),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;r=i(r,E),d.southwest(t,A),A.height=o,d.northeast(t,D),D.height=a;var l=r.project(A,x),u=r.project(D,P),c=u.x-l.x,p=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(c*c+p*p+f*f);var m=s.center;return m.x=l.x+.5*c,m.y=l.y+.5*p,m.z=l.z+.5*f,s};var I=[];h.fromRectangle3D=function(t,r,a,s){if(r=i(r,o.WGS84),a=i(a,0),n(s)||(s=new h),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;var l=d.subsample(t,r,a,I);return h.fromPoints(l,s)},h.fromVertices=function(t,r,o,a){if(n(a)||(a=new h),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;r=i(r,e.ZERO),o=i(o,3);var s=y;s.x=t[0]+r.x,s.y=t[1]+r.y,s.z=t[2]+r.z;var l,u=e.clone(s,p),c=e.clone(s,f),d=e.clone(s,m),E=e.clone(s,g),x=e.clone(s,v),P=e.clone(s,_),A=t.length;for(l=0;l<A;l+=o){var D=t[l]+r.x,I=t[l+1]+r.y,O=t[l+2]+r.z;s.x=D,s.y=I,s.z=O,D<u.x&&e.clone(s,u),D>E.x&&e.clone(s,E),I<c.y&&e.clone(s,c),I>x.y&&e.clone(s,x),O<d.z&&e.clone(s,d),O>P.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;l<A;l+=o){s.x=t[l]+r.x,s.y=t[l+1]+r.y,s.z=t[l+2]+r.z;var j=e.magnitude(e.subtract(s,H,b));j>W&&(W=j);var q=e.magnitudeSquared(e.subtract(s,B,b));if(q>U){var Y=Math.sqrt(q);V=.5*(V+Y),U=V*V;var X=Y-V;B.x=(V*B.x+X*s.x)/Y,B.y=(V*B.y+X*s.y)/Y,B.z=(V*B.z+X*s.z)/Y}}return V<W?(e.clone(B,a.center),a.radius=V):(e.clone(H,a.center),a.radius=W),a},h.fromEncodedCartesianVertices=function(t,r,i){if(n(i)||(i=new h),!n(t)||!n(r)||t.length!==r.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var o=y;o.x=t[0]+r[0],o.y=t[1]+r[1],o.z=t[2]+r[2];var a,s=e.clone(o,p),l=e.clone(o,f),u=e.clone(o,m),c=e.clone(o,g),d=e.clone(o,v),E=e.clone(o,_),x=t.length;for(a=0;a<x;a+=3){var P=t[a]+r[a],A=t[a+1]+r[a+1],D=t[a+2]+r[a+2];o.x=P,o.y=A,o.z=D,P<s.x&&e.clone(o,s),P>c.x&&e.clone(o,c),A<l.y&&e.clone(o,l),A>d.y&&e.clone(o,d),D<u.z&&e.clone(o,u),D>E.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;a<x;a+=3){o.x=t[a]+r[a],o.y=t[a+1]+r[a+1],o.z=t[a+2]+r[a+2];var H=e.magnitude(e.subtract(o,z,b));H>G&&(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<G?(e.clone(k,i.center),i.radius=B):(e.clone(z,i.center),i.radius=G),i},h.fromCornerPoints=function(t,r,i){n(i)||(i=new h);var o=i.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),i.radius=e.distance(o,r),i},h.fromEllipsoid=function(t,r){return n(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var O=new e;h.fromBoundingSpheres=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=t.length;if(1===i)return h.clone(t[0],r);if(2===i)return h.union(t[0],t[1],r);var o,a=[];for(o=0;o<i;o++)a.push(t[o].center);r=h.fromPoints(a,r);var s=r.center,l=r.radius;for(o=0;o<i;o++){var u=t[o];l=Math.max(l,e.distance(s,u.center,O)+u.radius)}return r.radius=l,r};var M=new e,R=new e,L=new e;h.fromOrientedBoundingBox=function(t,r){n(r)||(r=new h);var i=t.halfAxes,o=u.getColumn(i,0,M),a=u.getColumn(i,1,R),s=u.getColumn(i,2,L);return e.add(o,a,o),e.add(o,s,o),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(o),r},h.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=i(r,0);var n=e.center;return t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius,t},h.unpack=function(e,t,r){t=i(t,0),n(r)||(r=new h);var o=r.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],r.radius=e[t],r};var N=new e,k=new e;h.union=function(t,r,i){n(i)||(i=new h);var o=t.center,a=t.radius,s=r.center,l=r.radius,u=e.subtract(s,o,N),c=e.magnitude(u);if(a>=c+l)return t.clone(i),i;if(l>=c+a)return r.clone(i),i;var d=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+d)/c,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<n?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,r){return n(r)||(r=new h),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var B=new e;h.distanceSquaredTo=function(t,r){var i=e.subtract(t.center,r,B);return e.magnitudeSquared(i)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return n(r)||(r=new h),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var U=new e;h.computePlaneDistances=function(t,r,i,o){n(o)||(o=new l);var a=e.subtract(t.center,r,U),s=e.dot(i,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var V=new e,z=new e,G=new e,H=new e,W=new e,j=new t,q=new Array(8),Y=0;Y<8;++Y)q[Y]=new e;var X=new a;return h.projectTo2D=function(t,r,n){r=i(r,X);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,V),u=e.cross(e.UNIT_Z,l,z);e.normalize(u,u);var c=e.cross(l,u,G);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,W),p=e.negate(u,H),f=q,m=f[0];e.add(l,c,m),e.add(m,u,m),m=f[1],e.add(l,c,m),e.add(m,p,m),m=f[2],e.add(l,d,m),e.add(m,p,m),m=f[3],e.add(l,d,m),e.add(m,u,m),e.negate(l,l),m=f[4],e.add(l,c,m),e.add(m,u,m),m=f[5],e.add(l,c,m),e.add(m,p,m),m=f[6],e.add(l,d,m),e.add(m,p,m),m=f[7],e.add(l,d,m),e.add(m,u,m);for(var g=f.length,v=0;v<g;++v){var _=f[v];e.add(a,_,_);var y=o.cartesianToCartographic(_,j);r.project(y,_)}n=h.fromPoints(f,n),a=n.center;var b=a.x,C=a.y,w=a.z;return a.x=w,a.y=b,a.z=C,n},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,i={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[i.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[i.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",r=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a<s;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(i.requestFullscreen=n,r=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(i.requestFullscreen=n,r=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?i.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(i.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?i.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(i.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),i.fullscreenerror=n)}return r},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[i.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function i(e){for(var t=e.split("."),r=0,i=t.length;r<i;++r)t[r]=parseInt(t[r],10);return t}function n(){if(!t(C)&&(C=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(C=!0,w=i(e[1]))}return C}function o(){return n()&&w}function a(){if(!t(S)&&(S=!1,!n()&&!h()&&/ Safari\/[\.0-9]+/.test(b.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(S=!0,T=i(e[1]))}return S}function s(){return a()&&T}function l(){if(!t(E)){E=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(b.userAgent);null!==e&&(E=!0,x=i(e[1]),x.isNightly=!!e[2])}return E}function u(){return l()&&x}function c(){if(!t(P)){P=!1;var e;"Microsoft Internet Explorer"===b.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent))&&(P=!0,A=i(e[1])):"Netscape"===b.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent))&&(P=!0,A=i(e[1]))}return P}function d(){return c()&&A}function h(){if(!t(D)){D=!1;var e=/ Edge\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(D=!0,I=i(e[1]))}return D}function p(){return h()&&I}function f(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(O=!0,M=i(e[1]))}return O}function m(){return t(R)||(R=/Windows/i.test(b.appVersion)),R}function g(){return f()&&M}function v(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(b.pointerEnabled)||b.pointerEnabled)),L}function _(){if(!t(k)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;k=t(r)&&""!==r,k&&(N=r)}return k}function y(){return _()?N:void 0}var b;b="undefined"!=typeof navigator?navigator:{};var C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:d,isEdge:h,edgeVersion:p,isFirefox:f,firefoxVersion:g,isWindows:m,hardwareConcurrency:e(b.hardwareConcurrency,3),supportsPointerEvents:v,supportsImageRenderingPixelated:_,imageRenderingValue:y};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){
  433. return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";return e({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047})}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,i,n,o){"use strict";if(!i.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,r,i,n){switch(i=e(i,0),n=e(n,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,n);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,n);case a.SHORT:return new Int16Array(r,i,n);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,n);case a.INT:return new Int32Array(r,i,n);case a.UNSIGNED_INT:return new Uint32Array(r,i,n);case a.FLOAT:return new Float32Array(r,i,n);case a.DOUBLE:return new Float64Array(r,i,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";return e({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3})}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,o.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(e){var t=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&r(e.attributes[i])&&r(e.attributes[i].values)){var n=e.attributes[i],o=n.values.length/n.componentsPerAttribute;t=o}return t},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=i(new n({position:!0})),n.POSITION_AND_NORMAL=i(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=i(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=i(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=i(new n({position:!0,color:!0})),n.ALL=i(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,r,i){return i=e(i,0),r[i++]=t.position?1:0,r[i++]=t.normal?1:0,r[i++]=t.st?1:0,r[i++]=t.tangent?1:0,r[i++]=t.bitangent?1:0,r[i]=t.color?1:0,r},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.position=1===r[i++],o.normal=1===r[i++],o.st=1===r[i++],o.tangent=1===r[i++],o.bitangent=1===r[i++],o.color=1===r[i],o},n.clone=function(e,r){if(t(e))return t(r)||(r=new n),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum,o=n(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(r),this._maximum=t.clone(i),this._vertexFormat=o,this._workerName="createBoxGeometry"}var h=new t;d.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new d({minimum:t.negate(i,new t),maximum:i,vertexFormat:e.vertexFormat})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,r,i){return i=n(i,0),t.pack(e._minimum,r,i),t.pack(e._maximum,r,i+t.packedLength),c.pack(e._vertexFormat,r,i+2*t.packedLength),r};var p=new t,f=new t,m=new c,g={minimum:p,maximum:f,vertexFormat:m};return d.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,p),s=t.unpack(e,r+t.packedLength,f),l=c.unpack(e,r+2*t.packedLength,m);return o(i)?(i._minimum=t.clone(a,i._minimum),i._maximum=t.clone(s,i._maximum),i._vertexFormat=c.clone(l,i._vertexFormat),i):new d(g)},d.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var d,p,f=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var m=new Float32Array(72);m[0]=0,m[1]=0,m[2]=1,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=1,m[9]=0,m[10]=0,m[11]=1,m[12]=0,m[13]=0,m[14]=-1,m[15]=0,m[16]=0,m[17]=-1,m[18]=0,m[19]=0,m[20]=-1,m[21]=0,m[22]=0,m[23]=-1,m[24]=1,m[25]=0,m[26]=0,m[27]=1,m[28]=0,m[29]=0,m[30]=1,m[31]=0,m[32]=0,m[33]=1,m[34]=0,m[35]=0,m[36]=-1,m[37]=0,m[38]=0,m[39]=-1,m[40]=0,m[41]=0,m[42]=-1,m[43]=0,m[44]=0,m[45]=-1,m[46]=0,m[47]=0,m[48]=0,m[49]=1,m[50]=0,m[51]=0,m[52]=1,m[53]=0,m[54]=0,m[55]=1,m[56]=0,m[57]=0,m[58]=1,m[59]=0,m[60]=0,m[61]=-1,m[62]=0,m[63]=0,m[64]=-1,m[65]=0,m[66]=0,m[67]=-1,m[68]=0,m[69]=0,m[70]=-1,m[71]=0,f.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:m})}if(c.st){var g=new Float32Array(48);g[0]=0,g[1]=0,g[2]=1,g[3]=0,g[4]=1,g[5]=1,g[6]=0,g[7]=1,g[8]=1,g[9]=0,g[10]=0,g[11]=0,g[12]=0,g[13]=1,g[14]=1,g[15]=1,g[16]=0,g[17]=0,g[18]=1,g[19]=0,g[20]=1,g[21]=1,g[22]=0,g[23]=1,g[24]=1,g[25]=0,g[26]=0,g[27]=0,g[28]=0,g[29]=1,g[30]=1,g[31]=1,g[32]=1,g[33]=0,g[34]=0,g[35]=0,g[36]=0,g[37]=1,g[38]=1,g[39]=1,g[40]=0,g[41]=0,g[42]=1,g[43]=0,g[44]=1,g[45]=1,g[46]=0,g[47]=1,f.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:g})}if(c.tangent){var v=new Float32Array(72);v[0]=1,v[1]=0,v[2]=0,v[3]=1,v[4]=0,v[5]=0,v[6]=1,v[7]=0,v[8]=0,v[9]=1,v[10]=0,v[11]=0,v[12]=-1,v[13]=0,v[14]=0,v[15]=-1,v[16]=0,v[17]=0,v[18]=-1,v[19]=0,v[20]=0,v[21]=-1,v[22]=0,v[23]=0,v[24]=0,v[25]=1,v[26]=0,v[27]=0,v[28]=1,v[29]=0,v[30]=0,v[31]=1,v[32]=0,v[33]=0,v[34]=1,v[35]=0,v[36]=0,v[37]=-1,v[38]=0,v[39]=0,v[40]=-1,v[41]=0,v[42]=0,v[43]=-1,v[44]=0,v[45]=0,v[46]=-1,v[47]=0,v[48]=-1,v[49]=0,v[50]=0,v[51]=-1,v[52]=0,v[53]=0,v[54]=-1,v[55]=0,v[56]=0,v[57]=-1,v[58]=0,v[59]=0,v[60]=1,v[61]=0,v[62]=0,v[63]=1,v[64]=0,v[65]=0,v[66]=1,v[67]=0,v[68]=0,v[69]=1,v[70]=0,v[71]=0,f.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}if(c.bitangent){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,f.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}d=new Uint16Array(36),d[0]=0,d[1]=1,d[2]=2,d[3]=0,d[4]=2,d[5]=3,d[6]=6,d[7]=5,d[8]=4,d[9]=7,d[10]=6,d[11]=4,d[12]=8,d[13]=9,d[14]=10,d[15]=8,d[16]=10,d[17]=11,d[18]=14,d[19]=13,d[20]=12,d[21]=15,d[22]=14,d[23]=12,d[24]=18,d[25]=17,d[26]=16,d[27]=19,d[28]=18,d[29]=16,d[30]=20,d[31]=21,d[32]=22,d[33]=20,d[34]=22,d[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d=new Uint16Array(36),d[0]=4,d[1]=5,d[2]=6,d[3]=4,d[4]=6,d[5]=7,d[6]=1,d[7]=0,d[8]=3,d[9]=1,d[10]=3,d[11]=2,d[12]=1,d[13]=6,d[14]=5,d[15]=1,d[16]=2,d[17]=6,d[18]=2,d[19]=3,d[20]=7,d[21]=2,d[22]=7,d[23]=6,d[24]=3,d[25]=0,d[26]=4,d[27]=3,d[28]=4,d[29]=7,d[30]=0,d[31]=1,d[32]=5,d[33]=0,d[34]=5,d[35]=4;var y=t.subtract(o,n,h),b=.5*t.magnitude(y);return new a({attributes:f,indices:d,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,b)})}},d}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum;this._min=t.clone(r),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var d=new t;c.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._min,r,i),t.pack(e._max,r,i+t.packedLength),r};var h=new t,p=new t,f={minimum:h,maximum:p};return c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,h),s=t.unpack(e,r+t.packedLength,p);return o(i)?(i._min=t.clone(a,i._min),i._max=t.clone(s,i._max),i):new c(f)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,h=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h[0]=4,h[1]=5,h[2]=5,h[3]=6,h[4]=6,h[5]=7,h[6]=7,h[7]=4,h[8]=0,h[9]=1,h[10]=1,h[11]=2,h[12]=2,h[13]=3,h[14]=3,h[15]=0,h[16]=0,h[17]=4,h[18]=1,h[19]=5,h[20]=2,h[21]=6,h[22]=3,h[23]=7;var f=t.subtract(o,n,d),m=.5*t.magnitude(f);return new a({attributes:c,indices:h,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,m)})}},c}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(r,i){i=t(i,document.location.href);var n=new e(i);return new e(r).resolve(n).toString()}return n}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(i,n,o){if(o=t(o,!0),i instanceof e||(i=new e(i)),n instanceof e||(n=new e(n)),"data"===i.scheme)return i.toString();if("data"===n.scheme)return n.toString();r(n.authority)&&!r(n.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?n.scheme=new e(document.location.href).scheme:n.scheme=i.scheme);var a=i;n.isAbsolute()&&(a=n);var s="";r(a.scheme)&&(s+=a.scheme+":"),r(a.authority)&&(s+="//"+a.authority,""!==a.path&&"/"!==a.path&&(s=s.replace(/\/?$/,"/"),a.path=a.path.replace(/^\/?/g,""))),s+=a===i?o?i.path.replace(/\/?$/,"/")+n.path.replace(/^\/?/g,""):i.path+n.path:n.path;var l=r(i.query),u=r(n.query);l&&u?s+="?"+i.query+"&"+n.query:l&&!u?s+="?"+i.query:!l&&u&&(s+="?"+n.query);var c=r(n.fragment);return r(i.fragment)&&!c?s+="#"+i.fragment:c&&(s+="#"+n.fragment),s}return n}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,i,n,o){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var i=e[t].getAttribute("src"),n=f.exec(i);if(null!==n)return n[1]}}function s(){if(t(d))return d;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),d=new e(i(r))}function l(e){return o.toUrl("../"+e)}function u(e){return n(s(),e)}function c(e){t(h)||(h=t(define.amd)&&!define.amd.toUrlUndefined&&t(o.toUrl)?l:u),t(p)||(p=document.createElement("a"));var r=h(e);return p.href=r,p.href=p.href,p.href}var d,h,p,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=f,c.setBaseUrl=function(t){d=new e(t).resolve(new e(document.location.href))},c}),define("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){r(e)}if("undefined"!=typeof window){var r=window.cancelAnimationFrame;return function(){if(!e(r))for(var t=["webkit","moz","ms","o"],i=0,n=t.length;i<n&&!e(r);)r=window[t[i]+"CancelAnimationFrame"],e(r)||(r=window[t[i]+"CancelRequestAnimationFrame"]),++i;e(r)||(r=clearTimeout)}(),t}}),define("Core/CartographicGeocoderService",["../ThirdParty/when","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties"],function(e,t,r,i,n,o){"use strict";function a(){}return a.prototype.geocode=function(r){var i=r.match(/[^\s,\n]+/g);if(2===i.length||3===i.length){var n=+i[0],o=+i[1],a=3===i.length?+i[2]:300;if(isNaN(n)&&isNaN(o))for(var s=/^(\d+.?\d*)([nsew])/i,l=0;l<i.length;++l){var u=i[l].match(s);s.test(i[l])&&3===u.length&&(/^[ns]/i.test(u[2])?o=/^[n]/i.test(u[2])?+u[1]:-u[1]:/^[ew]/i.test(u[2])&&(n=/^[e]/i.test(u[2])?+u[1]:-u[1]))}if(!isNaN(n)&&!isNaN(o)&&!isNaN(a)){var c={displayName:r,destination:t.fromDegrees(n,o,a)};return e.resolve([c])}}return e.resolve([])},a}),define("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(){this.times=void 0,this.points=void 0,r.throwInstantiationError()}return i.prototype.evaluate=r.throwInstantiationError,i.prototype.findTimeInterval=function(t,r){var i=this.times,n=i.length;if(r=e(r,0),t>=i[r]){if(r+1<n&&t<i[r+1])return r;if(r+2<n&&t<i[r+2])return r+1}else if(r-1>=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;o<n-1&&!(t>=i[o]&&t<i[o+1]);++o);else for(o=r-1;o>=0&&!(t>=i[o]&&t<i[o+1]);--o);return o===n-1&&(o=n-2),o},i}),define("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var r=e.points,i=e.times;this._times=i,this._points=r,this._lastTimeIndex=0}return i(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,i){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return r(i)||(i=new e),e.lerp(n[a],n[a+1],s,i)},a}),define("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.solve=function(t,r,i,n){var o,a=new Array(i.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=i[0]/r[0],s[0]=e.multiplyByScalar(n[0],1/r[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(r[o]-a[o-1]*t[o-1]),a[o]=i[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(r[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},i}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=p,a=m,s=f,l=g
  434. ;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(i(d)||(d=l[0]=new e),e.clone(r,d),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d);return o[c]=0,a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d),s[c+1]=1,d=l[c+1],i(d)||(d=l[c+1]=new e),e.clone(n,d),u.solve(o,s,a,l)}function d(t){var r=p,n=m,o=f,a=g;r.length=n.length=t.length-1,o.length=a.length=t.length;var s;r[0]=n[0]=1,o[0]=2;var l=a[0];for(i(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<r.length;++s)r[s]=n[s]=1,o[s]=4,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(r,o,n,a)}function h(e){e=r(e,r.EMPTY_OBJECT);var t=e.points,i=e.times,n=e.inTangents,o=e.outTangents;this._times=i,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],f=[],m=[],g=[];n(h.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),h.createC1=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.tangents,o=n.slice(0,n.length-1);return new h({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:o})},h.createNaturalCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points;if(i.length<3)return new a({points:i,times:t});var n=d(i),o=n.slice(0,n.length-1);return new h({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:o})},h.createClampedCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.firstTangent,o=e.lastTangent;if(i.length<3)return new a({points:i,times:t});var s=c(i,n,o),l=s.slice(0,s.length-1);return new h({times:t,points:i,inTangents:s.slice(1,s.length),outTangents:l})},h.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),h.prototype.findTimeInterval=l.prototype.findTimeInterval;var v=new t,_=new e;return h.prototype.evaluate=function(t,r){i(r)||(r=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),d=v;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;var p=s.multiplyByVector(h.hermiteCoefficientMatrix,d,d);return r=e.multiplyByScalar(n[u],p.x,r),e.multiplyByScalar(n[u+1],p.y,_),e.add(r,_,r),e.multiplyByScalar(l[u],p.z,_),e.add(r,_,r),e.multiplyByScalar(a[u],p.w,_),e.add(r,_,r)},h}),define("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./HermiteSpline","./Matrix4","./Spline"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){var r=t.points,i=t.times;if(r.length<3){var o=i[0],l=1/(i[1]-o),u=r[0],f=r[1];return function(t,r){n(r)||(r=new e);var i=(t-o)*l;return e.lerp(u,f,i,r)}}return function(o,l){n(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),f=(o-i[u])/(i[u+1]-i[u]),m=d;m.z=f,m.y=f*f,m.x=m.y*f,m.w=1;var g,v,_,y,b;return 0===u?(g=r[0],v=r[1],_=t.firstTangent,y=e.subtract(r[2],g,h),e.multiplyByScalar(y,.5,y),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):u===r.length-2?(g=r[u],v=r[u+1],y=t.lastTangent,_=e.subtract(v,r[u-1],h),e.multiplyByScalar(_,.5,_),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):(g=r[u-1],v=r[u],_=r[u+1],y=r[u+2],b=s.multiplyByVector(c.catmullRomCoefficientMatrix,m,m)),l=e.multiplyByScalar(g,b.x,l),e.multiplyByScalar(v,b.y,p),e.add(l,p,l),e.multiplyByScalar(_,b.z,p),e.add(l,p,l),e.multiplyByScalar(y,b.w,p),e.add(l,p,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var r=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(r.length>2&&(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;o<r.length;o++)if(r[o]===e&&i[o]===t){n=o;break}return-1!==n&&(this._insideRaiseEvent?(this._toRemove.push(n),r[n]=void 0,i[n]=void 0):(r.splice(n,1),i.splice(n,1)),!0)},i.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var e,r=this._listeners,i=this._scopes,o=r.length;for(e=0;e<o;e++){var a=r[e];t(a)&&r[e].apply(i[e],arguments)}var s=this._toRemove;if((o=s.length)>0){for(s.sort(n),e=0;e<o;e++){var l=s[e];r.splice(l,1),i.splice(l,1)}s.length=0}this._insideRaiseEvent=!1},i}),define("Core/GeographicTilingScheme",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e=r(e,{}),this._ellipsoid=r(e.ellipsoid,o.WGS84),this._rectangle=r(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=r(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=r(e.numberOfLevelZeroTilesY,1)}return n(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var r=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return i(t)?(t.west=r,t.south=n,t.east=o,t.north=a,t):new l(r,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,r,i){var n=this.tileXYToRectangle(e,t,r,i);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,r,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),u=o.width/a,c=e*u+o.west,d=(e+1)*u+o.west,h=o.height/s,p=o.north-t*h,f=o.north-(t+1)*h;return i(n)||(n=new l(c,f,d,p)),n.west=c,n.south=f,n.east=d,n.north=p,n},u.prototype.positionToTileXY=function(t,r,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(r),u=this.getNumberOfYTilesAtLevel(r),c=o.width/a,d=o.height/u,h=t.longitude;o.east<o.west&&(h+=s.TWO_PI);var p=(h-o.west)/c|0;p>=a&&(p=a-1);var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),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;d<h;++d){var p=r[d],f=l(o,p,a);s=Math.max(s,f)}return u(a,s,i)};var h=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,r,o,a,s){n(s)||(s=new t),a=i(a,t.ZERO);for(var d=this._ellipsoid,p=c(d,e),f=0,m=0,g=r.length;m<g;m+=o){h.x=r[m]+a.x,h.y=r[m+1]+a.y,h.z=r[m+2]+a.z;var v=l(d,h,p);f=Math.max(f,v)}return u(p,f,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(r,i,n){var o=a.subsample(r,i,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*i.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var f=new t,m=new t,g=new t;return s}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<i?0:n}var i={};return i.computeDiscriminant=function(e,t,r){return t*t-4*e*r},i.computeRealRoots=function(e,i,n){var o;if(0===e)return 0===i?[]:[-n/i];if(0===i){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(a<s&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if((o=-n/e)<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,o<0?[o,0]:[0,o];var u=i*i,c=4*e*n,d=r(u,-c,t.EPSILON14);if(d<0)return[];var h=-.5*r(i,t.sign(i)*Math.sqrt(d),t.EPSILON14);return i>0?[h/e,n/h]:[n/h,h/e]},i}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,g=s*u-p,v=4*f*g-m*m;if(v<0){var _,y,b;h*d>=c*p?(_=a,y=f,b=-2*s*f+a*m):(_=u,y=g,b=-u*m+2*l*g);var C=b<0?-1:1,w=-C*Math.abs(_)*Math.sqrt(-v);o=-b+w;var S=o/2,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)<r.EPSILON14){var f=i.computeRealRoots(1,l,c);if(2===f.length){var m,g=f[0],v=f[1];if(g>=0&&v>=0){var _=Math.sqrt(g),y=Math.sqrt(v);return[h-y,h-_,h+_,h+y]}if(g>=0&&v<0)return m=Math.sqrt(g),[h-m,h+m];if(g<0&&v>=0)return m=Math.sqrt(v),[h-m,h+m]}return[]}if(p>0){var b=Math.sqrt(p),C=(l+p-u/b)/2,w=(l+p+u/b)/2,S=i.computeRealRoots(1,b,C),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]<T[1]?[T[0],S[0],T[1],S[1]]:[S[0],T[0],S[1],T[1]]):S):0!==T.length?(T[0]+=h,T[1]+=h,T):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,d=o*t+l-4*a,h=u*a-o*n*t+s,p=e.computeRealRoots(1,c,d,h);if(p.length>0){var f,m,g=p[0],v=n-g,_=v*v,y=t/2,b=v/2,C=_-4*a,w=_+4*Math.abs(a),S=u-4*g,T=u+4*Math.abs(g);if(g<0||C*T<S*w){var E=Math.sqrt(S);f=E/2,m=0===E?0:(t*b-o)/E}else{var x=Math.sqrt(C);f=0===x?0:(t*b-o)/x,m=x/2}var P,A;0===y&&0===f?(P=0,A=0):r.sign(y)===r.sign(f)?(P=y+f,A=g/P):(A=y-f,P=g/A);var D,I;0===b&&0===m?(D=0,I=0):r.sign(b)===r.sign(m)?(D=b+m,I=a/D):(I=b-m,D=a/I);var O=i.computeRealRoots(1,P,D),M=i.computeRealRoots(1,A,I);if(0!==O.length)return 0!==M.length?O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[0]>=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]<M[1]?[M[0],O[0],M[1],O[1]]:[O[0],M[0],O[1],M[1]]:O;if(0!==M.length)return M}return[]}var a={};return a.computeDiscriminant=function(e,t,r,i,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=r*r,c=u*r,d=i*i,h=d*i,p=n*n;return s*u*d-4*l*h-4*e*c*d+18*e*t*r*h-27*o*d*d+256*a*(p*n)+n*(18*l*r*i-4*s*c+16*e*u*u-80*e*t*u*i-6*e*s*d+144*o*r*d)+p*(144*e*s*r-27*s*s-128*o*u-192*o*t*i)},a.computeRealRoots=function(t,i,a,s,l){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(i,a,s,l);var u=i/t,c=a/t,d=s/t,h=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=d<0?p+1:p,p+=h<0?p+1:p){case 0:return n(u,c,d,h);case 1:case 2:return o(u,c,d,h);case 3:case 4:return n(u,c,d,h);case 5:return o(u,c,d,h);case 6:case 7:return n(u,c,d,h);case 8:return o(u,c,d,h);case 9:case 10:return n(u,c,d,h);case 11:return o(u,c,d,h);case 12:case 13:case 14:case 15:return n(u,c,d,h);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(r,i){i=e.clone(t(i,e.ZERO)),e.equals(i,e.ZERO)||e.normalize(i,i),this.origin=e.clone(t(r,e.ZERO)),this.direction=i}return n.getPoint=function(t,i,n){return r(n)||(n=new e),n=e.multiplyByScalar(t.direction,i,n),e.add(t.origin,n,n)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r,i){var n=t*t-4*e*r;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(i.root0=s,i.root1=l):(i.root0=l,i.root1=s),i}var u=-t/(2*e);if(0!==u)return i.root0=i.root1=u,i}}function h(t,r,n){i(n)||(n=new o);var a=t.origin,s=t.direction,l=r.center,u=r.radius*r.radius,c=e.subtract(a,l,_),h=e.dot(s,s),p=2*e.dot(s,c),f=e.magnitudeSquared(c)-u,m=d(h,p,f,w);if(i(m))return n.start=m.root0,n.stop=m.root1,n}function p(e,t,r){var i=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<r?0:i}function f(t,r,i,n,o){var c,d=n*n,h=o*o,f=(t[s.COLUMN1ROW1]-t[s.COLUMN2ROW2])*h,m=o*(n*p(t[s.COLUMN1ROW0],t[s.COLUMN0ROW1],a.EPSILON15)+r.y),g=t[s.COLUMN0ROW0]*d+t[s.COLUMN2ROW2]*h+n*r.x+i,v=h*p(t[s.COLUMN2ROW1],t[s.COLUMN1ROW2],a.EPSILON15),_=o*(n*p(t[s.COLUMN2ROW0],t[s.COLUMN0ROW2])+r.z),y=[];if(0===_&&0===v){if(c=l.computeRealRoots(f,m,g),0===c.length)return y;var b=c[0],C=Math.sqrt(Math.max(1-b*b,0));if(y.push(new e(n,o*b,o*-C)),y.push(new e(n,o*b,o*C)),2===c.length){var w=c[1],S=Math.sqrt(Math.max(1-w*w,0));y.push(new e(n,o*w,o*-S)),y.push(new e(n,o*w,o*S))}return y}var T=_*_,E=v*v,x=f*f,P=_*v,A=x+E,D=2*(m*f+P),I=2*g*f+m*m-E+T,O=2*(g*m-P),M=g*g-T;if(0===A&&0===D&&0===I&&0===O)return y;c=u.computeRealRoots(A,D,I,O,M);var R=c.length;if(0===R)return y;for(var L=0;L<R;++L){var N,k=c[L],F=k*k,B=Math.max(1-F,0),U=Math.sqrt(B);N=a.sign(f)===a.sign(g)?p(f*F+g,m*k,a.EPSILON12):a.sign(g)===a.sign(m*k)?p(f*F,m*k+g,a.EPSILON12):p(f*F+m*k,g,a.EPSILON12);var V=p(v*k,_,a.EPSILON15),z=N*V;z<0?y.push(new e(n,o*k,o*U)):z>0?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)<a.EPSILON15)){var c=(-r.distance-e.dot(l,o))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(o,n,n)}};var g=new e,v=new e,_=new e,y=new e,b=new e;m.rayTriangleParametric=function(t,i,n,o,s){s=r(s,!1);var l,u,c,d,h,p=t.origin,f=t.direction,m=e.subtract(n,i,g),C=e.subtract(o,i,v),w=e.cross(f,C,_),S=e.dot(m,w);if(s){if(S<a.EPSILON6)return;if(l=e.subtract(p,i,y),(c=e.dot(l,w))<0||c>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)<a.EPSILON6)return;var T=1/S;if(l=e.subtract(p,i,y),(c=e.dot(l,w)*T)<0||c>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,f<a)return;if(f>a){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,g=i/l;return m<g?new o(m,g):{start:g,stop:m}}var v=Math.sqrt(i/n);return new o(v,v)}return h<1?(i=h-1,n=e.magnitudeSquared(d),a=n*i,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(d),new o(0,-p/n)):void 0};var x=new e,P=new e,A=new e,D=new e,I=new e,O=new s,M=new s,R=new s,L=new s,N=new s,k=new s,F=new s,B=new e,U=new e,V=new t;m.grazingAltitudeLocation=function(t,r){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=r.geodeticSurfaceNormal(n,x);if(e.dot(o,l)>=0)return n}var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(o,x),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(h,d,P),P),m=e.normalize(e.cross(d,p,A),A),g=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;j<G;++j){C=s.multiplyByVector(_,s.multiplyByVector(g,z[j],B),B);var q=e.normalize(e.subtract(C,n,D),D),Y=e.dot(q,o);Y>W&&(W=Y,H=e.clone(C,H))}var X=r.cartesianToCartographic(H,V);return W=a.clamp(W,0,1),w=e.magnitude(e.subtract(H,n,D))*Math.sqrt(1-W*W),w=u?-w:w,X.height=w,r.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,r,n,o){i(o)||(o=new e);var s=e.subtract(r,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON6)){var c=e.dot(l,t),d=-(n.distance+c)/u;if(!(d<0||d>1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,r,i,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,r)+a<0,u=e.dot(o,i)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,r,i,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,r,i,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,r,i,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,r,i,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,r,i,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,r,i,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./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<S;T++)switch(l.charAt(T)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":w=l.charAt(T+1);break;case"0":b=!0;break;case"#":C=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,u<0&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[r++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,v=i?t[i.slice(0,-1)]:t[r++],h){case"s":return s(String(v),_,u,d,b,w);case"c":return s(String.fromCharCode(+v),_,u,d,b);case"b":return a(v,2,C,_,u,d,b);case"o":return a(v,8,C,_,u,d,b);case"x":return a(v,16,C,_,u,d,b);case"X":return a(v,16,C,_,u,d,b).toUpperCase();case"u":return a(v,10,C,_,u,d,b);case"i":case"d":return p=+v||0,p=Math.round(p-p%1),f=p<0?"-":y,v=f+n(String(Math.abs(p)),d,"0",!1),o(v,f,_,u,b);case"e":case"E":case"f":case"F":case"g":case"G":return p=+v,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=f+Math.abs(p)[m](d),o(v,f,_,u,b)[g]();default:return e}};return i.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4==0&&e%100!=0||e%400==0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";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)},
  435. 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;i<r.length;++i){var n=r[i],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r){var i=new e(r);i.normalize();var n=i.getAuthority();if(t(n)){if(-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<r.length;o++)n[o]=r.charCodeAt(o);return i}function p(e,t){t=r(t,"");var i=e[1],n=!!e[2],o=e[3];switch(t){case"":case"text":return d(n,o);case"arraybuffer":return h(n,o);case"blob":var a=h(n,o);return new Blob([a],{type:i});case"document":return(new DOMParser).parseFromString(d(n,o),i);case"json":return JSON.parse(d(n,o))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,n,o,s,c){var d=f.exec(e);if(null!==d)return void s.resolve(p(d,t));var h=new XMLHttpRequest;if(u.contains(e)&&(h.withCredentials=!0),i(c)&&i(h.overrideMimeType)&&h.overrideMimeType(c),h.open(r,e,!0),i(o))for(var m in o)o.hasOwnProperty(m)&&h.setRequestHeader(m,o[m]);i(t)&&(h.responseType=t);var g=!1;return"string"==typeof e&&(g=0===e.indexOf("file://")),h.onload=function(){if((h.status<200||h.status>=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;b<C;b+=e._columnCount){var w=g[b+n],S=g[b+m],T=w+c.MODIFIED_JULIAN_DATE_DIFFERENCE,E=new a(T,S,d.TAI);if(v.push(E),y){if(S!==_&&i(_)){var x=a.leapSeconds,P=t(x,E,p);if(P<0){var A=new s(E,S);x.splice(~P,0,A)}}_=S}}}function m(e,t,r,i,n){var o=r*i;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function g(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||i.equals(u))return m(e,r,n,l,s),s;if(i.equals(c))return m(e,r,o,l,s),s;var d=a.secondsDifference(i,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=r[h+e._ut1MinusUtcSecondsColumn],v=r[p+e._ut1MinusUtcSecondsColumn],_=v-f;if(_>.5||_<-.5){var y=r[h+e._taiMinusUtcSecondsColumn],b=r[p+e._taiMinusUtcSecondsColumn];y!==b&&(c.equals(i)?f=v:v-=b-y)}return s.xPoleWander=g(d,r[h+e._xPoleWanderRadiansColumn],r[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=g(d,r[h+e._yPoleWanderRadiansColumn],r[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=g(d,r[h+e._xCelestialPoleOffsetRadiansColumn],r[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=g(d,r[h+e._yCelestialPoleOffsetRadiansColumn],r[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=g(d,f,v),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(i(this._samples)){if(i(r)||(r=new n(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!i(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,v(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(g<o.length-1&&o[g+1].equals(e)&&++g,l=g,c=g):(c=~g,(l=c-1)<0&&(l=0)),this._lastIndex=l,v(this,o,this._samples,e,l,c,r),r}if(i(this._dataError))throw new u(this._dataError)},h}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;l<=t;++l){i[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;u<=t;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,r){var i=d;return i.dayNumber=t,i.secondsOfDay=r,o.daysDifference(i,e._sampleZeroDateTT)}function c(r,n){if(r._chunkDownloadsInProgress[n])return r._chunkDownloadsInProgress[n];var o=e.defer();r._chunkDownloadsInProgress[n]=o;var s,l=r._xysFileUrlTemplate;return s=i(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){r._chunkDownloadsInProgress[n]=!1;for(var t=r._samples,i=e.samples,a=n*r._samplesPerXysFile*3,s=0,l=i.length;s<l;++s)t[a+s]=i[s];o.resolve()}),o.promise}var d=new o(0,0,s.TAI);return l.prototype.preload=function(t,r,i,n){var o=u(this,t,r),a=u(this,i,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,r){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,(l=d-s)<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<o;n++){var a=3*n;u.unpack(e,4*(t+n),y),u.multiply(y,C,y),y.w<0&&u.negate(y,y),u.computeAxis(y,v);var s=u.computeAngle(y);i[a]=v.x*s,i[a+1]=v.y*s,i[a+2]=v.z*s}},u.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new u),e.fromArray(t,0,_);var s=e.magnitude(_);return u.unpack(r,4*o,b),0===s?u.clone(u.IDENTITY,y):u.fromAxisAngle(_,s,y),u.multiply(y,b,a)},u.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new u(e.x,e.y,e.z,e.w)},u.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},u.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))},u.normalize=function(e,t){var r=1/u.magnitude(e),i=e.x*r,n=e.y*r,o=e.z*r,a=e.w*r;return t.x=i,t.y=n,t.z=o,t.w=a,t},u.inverse=function(e,t){var r=u.magnitudeSquared(e);return t=u.conjugate(e,t),u.multiplyByScalar(t,1/r,t)},u.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},u.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},u.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},u.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},u.multiply=function(e,t,r){var i=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,d=a*s+i*c+n*u-o*l,h=a*l-i*u+n*c+o*s,p=a*u+i*l-n*s+o*c,f=a*c-i*s-n*l-o*u;return r.x=d,r.y=h,r.z=p,r.w=f,r},u.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},u.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},u.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var i=1/Math.sqrt(1-r*r);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},u.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var w=new u;u.lerp=function(e,t,r,i){return w=u.multiplyByScalar(t,r,w),i=u.multiplyByScalar(e,1-r,i),u.add(w,i,i)};var S=new u,T=new u,E=new u;u.slerp=function(e,t,r,i){var n=u.dot(e,t),o=t;if(n<0&&(n=-n,o=S=u.negate(t,S)),1-n<s.EPSILON6)return u.lerp(e,o,r,i);var a=Math.acos(n);return T=u.multiplyByScalar(e,Math.sin((1-r)*a),T),E=u.multiplyByScalar(o,Math.sin(r*a),E),i=u.add(T,E,i),u.multiplyByScalar(i,1/Math.sin(a),i)},u.log=function(t,r){var i=s.acosClamped(t.w),n=0;return 0!==i&&(n=i/Math.sin(i)),e.multiplyByScalar(t,n,r)},u.exp=function(t,r){var i=e.magnitude(t),n=0;return 0!==i&&(n=Math.sin(i)/i),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r.w=Math.cos(i),r};var x=new e,P=new e,A=new u,D=new u;u.computeInnerQuadrangle=function(t,r,i,n){var o=u.conjugate(r,A);u.multiply(o,i,D);var a=u.log(D,x);u.multiply(o,t,D);var s=u.log(D,P);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),u.exp(a,A),u.multiply(r,A,n)},u.squad=function(e,t,r,i,n,o){var a=u.slerp(e,t,n,A),s=u.slerp(r,i,n,D);return u.slerp(a,s,2*n*(1-n),o)};for(var I=new u,O=1.9011074535173003,M=n.supportsTypedArrays()?new Float32Array(8):[],R=n.supportsTypedArrays()?new Float32Array(8):[],L=n.supportsTypedArrays()?new Float32Array(8):[],N=n.supportsTypedArrays()?new Float32Array(8):[],k=0;k<7;++k){var F=k+1,B=2*F+1;M[k]=1/(F*B),R[k]=F/B}return M[7]=O/136,R[7]=8*O/17,u.fastSlerp=function(e,t,r,i){var n,o=u.dot(e,t);o>=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;n<i;n++){var a=this.projectPointOntoPlane(e[n],t[r]);o(a)&&(t[r]=a,r++)}return t.length=r,t},f.prototype.projectPointToNearestOnPlane=function(e,i){o(i)||(i=new t);var n=v;n.origin=e,r.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,_);o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,_));var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return i.x=l,i.y=c,i},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var r=e.length;t.length=r;for(var i=0;i<r;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var y=new r;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;o(t)?t.length=i:t=new Array(i);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<i;++c){var d=e[c];r.multiplyByScalar(s,d.x,u),o(t[c])||(t[c]=new r);var h=r.add(a,u,t[c]);r.multiplyByScalar(l,d.y,u),r.add(h,u,h),n.scaleToGeocentricSurface(h,h)}return t},f}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t){this.center=r.clone(n(e,r.ZERO)),this.halfAxes=h.clone(n(t,h.ZERO))}function g(e,t,i,n,a,s,l,u){o(u)||(u=new m);var c=u.halfAxes;h.setColumn(c,0,e.xAxis,c),h.setColumn(c,1,e.yAxis,c),h.setColumn(c,2,e.zAxis,c);var d=E;d.x=(t+i)/2,d.y=(n+a)/2,d.z=(s+l)/2;var p=x;p.x=(i-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var f=u.center;return d=h.multiplyByVector(c,d,d),r.add(e.origin,d,f),h.multiplyByScale(c,p,c),u}var v=new r,_=new r,y=new r,b=new r,C=new r,w=new r,S=new h,T={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(o(t)||(t=new m),!o(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=r.ZERO,t;var i,n=e.length,a=r.clone(e[0],v);for(i=1;i<n;i++)r.add(a,e[i],a);var s=1/n;r.multiplyByScalar(a,s,a);var l,u=0,c=0,d=0,p=0,f=0,g=0;for(i=0;i<n;i++)l=r.subtract(e[i],a,_),u+=l.x*l.x,c+=l.x*l.y,d+=l.x*l.z,p+=l.y*l.y,f+=l.y*l.z,g+=l.z*l.z;u*=s,c*=s,d*=s,p*=s,f*=s,g*=s;var E=S;E[0]=u,E[1]=c,E[2]=d,E[3]=c,E[4]=p,E[5]=f,E[6]=d,E[7]=f,E[8]=g;var x=h.computeEigenDecomposition(E,T),P=h.clone(x.unitary,t.halfAxes),A=h.getColumn(P,0,b),D=h.getColumn(P,1,C),I=h.getColumn(P,2,w),O=-Number.MAX_VALUE,M=-Number.MAX_VALUE,R=-Number.MAX_VALUE,L=Number.MAX_VALUE,N=Number.MAX_VALUE,k=Number.MAX_VALUE;for(i=0;i<n;i++)l=e[i],O=Math.max(r.dot(A,l),O),M=Math.max(r.dot(D,l),M),R=Math.max(r.dot(I,l),R),L=Math.min(r.dot(A,l),L),N=Math.min(r.dot(D,l),N),k=Math.min(r.dot(I,l),k);A=r.multiplyByScalar(A,.5*(L+O),A),D=r.multiplyByScalar(D,.5*(N+M),D),I=r.multiplyByScalar(I,.5*(k+R),I);var F=r.add(A,D,t.center);r.add(F,I,F);var B=y;return B.x=O-L,B.y=M-N,B.z=R-k,r.multiplyByScalar(B,.5,B),h.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var E=new r,x=new r,P=new i,A=new r,D=[new i,new i,new i,new i,new i,new i,new i,new i],I=[new r,new r,new r,new r,new r,new r,new r,new r],O=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,r,i,o){t=n(t,0),r=n(r,0),i=n(i,s.WGS84);var a=f.center(e,P),u=i.cartographicToCartesian(a,A),c=new l(u,i),d=c.plane,h=D[0],m=D[1],v=D[2],_=D[3],y=D[4],b=D[5],C=D[6],w=D[7],S=a.longitude,T=e.south<0&&e.north>0?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
  436. ;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)<m-1?l.BITS12:l.NONE,v=e.center,_=s.inverseTransformation(a,new s);var T=r.negate(b,c);s.multiply(s.fromTranslation(T,p),_,_);var E=c;E.x=1/w.x,E.y=1/w.y,E.z=1/w.z,s.multiply(s.fromScale(E,p),_,_),y=s.clone(a),s.setTranslation(y,r.ZERO,y),a=s.clone(a,new s);var x=s.fromTranslation(b,p),P=s.fromScale(w,f),A=s.multiply(x,P,p);s.multiply(a,A,a),s.multiply(y,A,y)}this.quantization=g,this.minimumHeight=t,this.maximumHeight=i,this.center=v,this.toScaledENU=_,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(h,!1)}var c=new r,d=new r,h=new t,p=new s,f=new s,m=Math.pow(2,12);u.prototype.encode=function(i,n,o,u,d,p,f){var m=u.x,g=u.y;if(this.quantization===l.BITS12){o=s.multiplyByPoint(this.toScaledENU,o,c),o.x=a.clamp(o.x,0,1),o.y=a.clamp(o.y,0,1),o.z=a.clamp(o.z,0,1);var v=this.maximumHeight-this.minimumHeight,_=a.clamp((d-this.minimumHeight)/v,0,1);t.fromElements(o.x,o.y,h);var y=e.compressTextureCoordinates(h);t.fromElements(o.z,_,h);var b=e.compressTextureCoordinates(h);t.fromElements(m,g,h);var C=e.compressTextureCoordinates(h);if(i[n++]=y,i[n++]=b,i[n++]=C,this.hasWebMercatorT){t.fromElements(f,0,h);var w=e.compressTextureCoordinates(h);i[n++]=w}}else r.subtract(o,this.center,c),i[n++]=c.x,i[n++]=c.y,i[n++]=c.z,i[n++]=d,i[n++]=m,i[n++]=g,this.hasWebMercatorT&&(i[n++]=f);return this.hasVertexNormals&&(i[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,i,n){if(o(n)||(n=new r),i*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[i],h);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[i+1],h);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[i],n.y=t[i+1],n.z=t[i+2],r.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(r,i,n){return o(n)||(n=new t),i*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(r[i+2],n):t.fromElements(r[i+4],r[i+5],n)},u.prototype.decodeHeight=function(t,r){if(r*=this.getStride(),this.quantization===l.BITS12){return e.decompressTextureCoordinates(t[r+1],h).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[r+3]},u.prototype.getOctEncodedNormal=function(e,r,i){r=(r+1)*this.getStride()-1;var n=e[r]/256,o=Math.floor(n),a=256*(n-o);return t.fromElements(o,a,i)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var g={position3DAndHeight:0,textureCoordAndEncodedNormals:1},v={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,r=i.FLOAT,n=i.getSizeInBytes(r);if(this.quantization===l.NONE){var o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(4+o)*n,[{index:g.position3DAndHeight,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t},{index:g.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:o,offsetInBytes:4*n,strideInBytes:t}]}var a=3,s=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(++s,t=(a+s)*n,[{index:v.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:v.compressed1,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:s,offsetInBytes:a*n,strideInBytes:t}]):[{index:v.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?g:v},u.clone=function(e,t){return o(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=r.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},u}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var _=new i,y=new d,b=new i,C=new i;return v.computeVertices=function(a){var u,w,S,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<Se;++Pe){var Ae=Pe;Ae<0&&(Ae=0),Ae>=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<Ee;++Ne){var ke=Ne;ke<0&&(ke=0),ke>=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<X;++Ve)Be=Be*Z+M[Ue+Ve];else for(Ve=X-1;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<c.PI_OVER_TWO+c.EPSILON5&&(Je=h.fromRectangle(V,le,ue,F));var et;if(G){et=new l(F).computeHorizonCullingPoint(z,_e)}for(var tt=new e(he,pe,z),rt=new f(tt,fe,ue,ce,!1,W),it=new Float32Array(ve*rt.getStride()),nt=0,ot=0;ot<ve;++ot)nt=rt.encode(it,nt,_e[ot],be[ot],ye[ot],void 0,Ce[ot]);return{vertices:it,maximumHeight:ue,minimumHeight:le,encoding:rt,boundingSphere3D:$e,orientedBoundingBox:Je,occludeePointInScaledSpace:et}},v}),define("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}function i(t,i){function n(){}i=e(i,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=r}return i}),define("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(r)||(r=document.createElement("a")),r.href=window.location.href;var i=r.host,n=r.protocol;return r.href=t,r.href=r.href,n!==r.protocol||i!==r.host}var r;return t}),define("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){if(!i(m._canTransferArrayBuffer)){var t=new Worker(h("Workers/transferTypedArrayTest.js"));t.postMessage=r(t.webkitPostMessage,t.postMessage);var n=new Int8Array([99]);try{t.postMessage({array:n},[n.buffer])}catch(e){return m._canTransferArrayBuffer=!1,m._canTransferArrayBuffer}var o=e.defer();t.onmessage=function(e){var r=e.data.array,n=i(r)&&99===r[0];o.resolve(n),t.terminate(),m._canTransferArrayBuffer=n},m._canTransferArrayBuffer=o.promise}return m._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var r=t.id;if(i(r)){var n=e._deferreds,a=n[r];if(i(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),a.reject(s)}else a.resolve(t.result);delete n[r]}}function h(e){var r=t(e);if(s(r)){var i,n='importScripts("'+r+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),i=a.getBlob("application/javascript")}r=(window.URL||window.webkitURL).createObjectURL(i)}return r}function p(){return i(g)||(g=h("Workers/cesiumWorkerBootstrapper.js")),g}function f(e){var n=new Worker(p());n.postMessage=r(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:m._workerModulePrefix+e._workerName};return i(m._loaderConfig)?o.loaderConfig=m._loaderConfig:i(define.amd)&&!define.amd.toUrlUndefined&&i(u.toUrl)?o.loaderConfig.baseUrl=a("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){d(e,t.data)},n}function m(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var g,v=[];return m.prototype.scheduleTask=function(t,r){if(i(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){i(r)?o||(r.length=0):r=v;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},r),s.promise})}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},m._defaultWorkerModulePrefix="Workers/",m._workerModulePrefix=m._defaultWorkerModulePrefix,m._loaderConfig=void 0,m._canTransferArrayBuffer=void 0,m}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,r,i,n,o,a,s,l,u,c,d){this.center=t,this.vertices=r,this.stride=e(l,6),this.indices=i,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(){r.throwInstantiationError()}t(n.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},hasWaterMask:{get:r.throwInstantiationError},hasVertexNormals:{get:r.throwInstantiationError},availability:{get:r.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,r){var i=o[t];e(i)||(o[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array((t-1)*(r-1)*6);for(var a=0,s=0,l=0;l<r-1;++l){for(var u=0;u<t-1;++u){var c=a,d=c+t,h=d+1,p=c+1;n[s++]=c,n[s++]=d,n[s++]=p,n[s++]=p,n[s++]=d,n[s++]=h,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*r)},n.prototype.requestTileGeometry=r.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,n.prototype.getTileDataAvailable=r.throwInstantiationError,n}),define("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var i=a.DEFAULT_STRUCTURE,n=e.structure;r(n)?n!==i&&(n.heightScale=t(n.heightScale,i.heightScale),n.heightOffset=t(n.heightOffset,i.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,i.elementsPerHeight),n.stride=t(n.stride,i.stride),n.elementMultiplier=t(n.elementMultiplier,i.elementMultiplier),n.isBigEndian=t(n.isBigEndian,i.isBigEndian)):n=i,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function f(e,t,r,i,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south),h=0|c,p=h+1;p>=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var _=c-h,y=d-f;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<e?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function v(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;a<t;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function _(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;else for(l=t-1;l>0;--l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;e[a+l]=s}i(p.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(i,n,a,s,u){var p=i.ellipsoid,f=i.tileXYToNativeRectangle(n,a,s),m=i.tileXYToRectangle(n,a,s);u=t(u,1);var g=p.cartographicToCartesian(l.center(m)),v=this._structure,_=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,i.getNumberOfXTilesAtLevel(0)),b=_/(1<<s);this._skirtHeight=Math.min(4*b,1e3);var C=y.scheduleTask({heightmap:this._buffer,structure:v,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:f,rectangle:m,relativeToCenter:g,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:i instanceof o,exaggeration:u});if(r(C)){var w=this;return e(C,function(e){return w._mesh=new d(g,new Float32Array(e.vertices),h.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,c.clone(e.encoding),u),w._buffer=void 0,w._mesh})}},p.prototype.interpolateHeight=function(e,t,i){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,d=s.isBigEndian,h=s.heightOffset,p=s.heightScale;if(r(this._mesh)){n=m(this._mesh.vertices,this._mesh.encoding,h,p,this._skirtHeight,e,o,a,t,i,this._mesh.exaggeration)}else n=f(this._buffer,u,c,l,d,e,o,a,t,i),n=n*p+h;return n},p.prototype.upsample=function(e,t,i,n,o,a,l){var u=this._width,c=this._height,d=this._structure,h=this._skirtHeight,f=d.stride,g=new this._bufferType(u*c*f),v=this._mesh;if(r(v)){for(var y=v.vertices,b=v.encoding,C=e.tileXYToRectangle(t,i,n),w=e.tileXYToRectangle(o,a,l),S=d.heightOffset,T=d.heightScale,E=v.exaggeration,x=d.elementsPerHeight,P=d.elementMultiplier,A=d.isBigEndian,D=Math.pow(P,x-1),I=0;I<c;++I)for(var O=s.lerp(w.north,w.south,I/(c-1)),M=0;M<u;++M){var R=s.lerp(w.west,w.east,M/(u-1)),L=m(y,b,S,T,h,C,u,c,R,O,E);L=L<d.lowestEncodedHeight?d.lowestEncodedHeight:L,L=L>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<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,i,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},r(o)}),define("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,r,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=i<e,l=n<e,u=o<e):(s=i>e,l=n>e,u=o>e);var c,d,h,p,f,m,g=s+l+u;return 1===g?s?(c=(e-i)/(n-i),d=(e-i)/(o-i),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(i-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(i-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===g?s||i===e?l||n===e?u||o===e||(d=(e-i)/(o-i),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(i-n),f=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==g&&(a.push(0),a.push(1),a.push(2)),a},i.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),g=i-u,v=r-l,_=(p*v+h*g)*m,y=(-f*v+d*g)*m,b=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=b,c):new e(_,y,b)},i}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function r(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;var i=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,i),a=this._vValues=this._quantizedVertices.subarray(i,2*i);this._heightValues=this._quantizedVertices.subarray(2*i,3*i),this._westIndices=g(e.westIndices,t,i),this._southIndices=g(e.southIndices,r,i),this._eastIndices=g(e.eastIndices,t,i),this._northIndices=g(e.northIndices,r,i),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function g(e,t,r){y.length=e.length;for(var i=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(y.sort(t),l.createTypedArray(r,y)):e}function v(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,T),f=o.decodeTextureCoordinates(n,d,E),m=o.decodeTextureCoordinates(n,h,x),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,S);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function _(e,t,r){for(var i=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var d=a[s],h=a[s+1],p=a[s+2],f=i[d],m=i[h],g=i[p],v=n[d],_=n[h],y=n[p],b=u.computeBarycentricCoordinates(t,r,f,v,m,_,g,y,S);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var C=b.x*o[d]+b.y*o[h]+b.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,C/w)}}}a(m.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});var y=[],b=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,r,i,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(r,i,a);s=n(s,1);var d=b.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var r=l.createTypedArray(t,e.indices),i=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,g=e.vertexStride,v=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,i,r,a,u,c,m,g,d,v,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var C=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(r,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,g=2*a===c,v=r.ellipsoid,_=r.tileXYToRectangle(u,c,h),y=C.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:g,childRectangle:_,ellipsoid:v,exaggeration:p.exaggeration});if(o(y)){var b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);var w=f?.5*b:this._westSkirtHeight,S=g?.5*b:this._southSkirtHeight,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<<n)},m.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},m}),define("Core/TileAvailability",["./binarySearch","./Cartographic","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,i,n,o){"use strict";function a(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[];for(var r=0;r<e.getNumberOfYTilesAtLevel();++r)for(var i=0;i<e.getNumberOfXTilesAtLevel();++i)this._rootNodes.push(new s(e,void 0,0,i,r))}function s(e,t,r,i,n){this.tilingScheme=e,this.parent=t,this.level=r,this.x=i,this.y=n,this.extent=e.tileXYToRectangle(i,n,r),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function l(e,t,r,i,n){this.level=e,this.west=t,this.south=r,this.east=i,this.north=n}function u(e,t){var r=Math.max(e.west,t.west),i=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return i<Math.min(e.north,t.north)&&r<n}function c(t,r,i){for(;r.level<t;)if(h(r.nw.extent,i))r=r.nw;else if(h(r.ne.extent,i))r=r.ne;else if(h(r.sw.extent,i))r=r.sw;else{if(!h(r.se.extent,i))break;r=r.se}if(0===r.rectangles.length||r.rectangles[r.rectangles.length-1].level<=i.level)r.rectangles.push(i);else{var n=e(r.rectangles,i.level,d);n<=0&&(n=~n),r.rectangles.splice(n,0,i)}}function d(e,t){return e.level-t}function h(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,r){for(var i=0,n=!1;!n;){var o=t._nw&&p(t._nw.extent,r),a=t._ne&&p(t._ne.extent,r),s=t._sw&&p(t._sw.extent,r),l=t._se&&p(t._se.extent,r);if(o+a+s+l>1){o&&(i=Math.max(i,f(t,t._nw,r))),a&&(i=Math.max(i,f(t,t._ne,r))),s&&(i=Math.max(i,f(t,t._sw,r))),l&&(i=Math.max(i,f(t,t._se,r)));break}o?t=t._nw:a?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;c>=0&&u[c].level>i;--c){var d=u[c];p(d,r)&&(i=d.level)}t=t.parent}return i}function m(e,t,r){if(t){var i,n=!1;for(i=0;i<r.length;++i)n=n||u(t.extent,r[i]);if(n){var o=t.rectangles;for(i=0;i<o.length;++i){var a=o[i];e[a.level]||(e[a.level]=r),e[a.level]=g(e[a.level],a)}m(e,t._nw,r),m(e,t._ne,r),m(e,t._sw,r),m(e,t._se,r)}}}function g(e,t){for(var r=[],i=0;i<e.length;++i){var n=e[i];u(n,t)?(n.west<t.west&&r.push(new o(n.west,n.south,t.west,n.north)),n.east>t.east&&r.push(new o(t.east,n.south,n.east,n.north)),n.south<t.south&&r.push(new o(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&r.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):r.push(n)}return r}var v=new o;a.prototype.addAvailableTileRange=function(e,t,r,i,n){var o=this._tilingScheme;o.tileXYToRectangle(t,r,e,v);var a=v.west,s=v.north;o.tileXYToRectangle(i,n,e,v);for(var d=v.east,h=v.south,p=new l(e,a,h,d,s),f=0;f<this._rootNodes.length;++f){var m=this._rootNodes[f];u(m.extent,p)&&c(this._maximumLevel,m,p)}},a.prototype.computeMaximumLevelAtPosition=function(e){for(var t,r=0;r<this._rootNodes.length;++r){var i=this._rootNodes[r];if(p(i.extent,e)){t=i;break}}return f(void 0,t,e)}
  437. ;var _=[],y=[],b=new o,C=new o;a.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=_;t.length=0,e.east<e.west?(t.push(o.fromRadians(-Math.PI,e.south,e.east,e.north,b)),t.push(o.fromRadians(e.west,e.south,Math.PI,e.north,C))):t.push(e);var i=y;i.length=0;var n;for(n=0;n<this._rootNodes.length;++n)m(i,this._rootNodes[n],t);for(n=i.length-1;n>=0;--n)if(r(i[n])&&0===i[n].length)return n;return 0};var w=new t;return a.prototype.isTileAvailable=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(t,r,e,v);return o.center(i,w),this.computeMaximumLevelAtPosition(w)>=e},a.prototype.computeChildMaskForTile=function(e,t,r){var i=e+1;if(i>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(i,2*t,2*r+1)?1:0,n|=this.isTileAvailable(i,2*t+1,2*r+1)?2:0,n|=this.isTileAvailable(i,2*t,2*r)?4:0,n|=this.isTileAvailable(i,2*t+1,2*r)?8:0},i(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,r){"use strict";function i(t,r,i,n,o,a,s){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return i.handleError=function(e,n,o,a,s,l,u,c,d){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,h.error=d,++h.timesRetried):h=new i(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./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;f<d.length;++f){var w=new e(d[f]),P=new e(g);w.authority&&!P.authority&&(P.authority=w.authority,P.scheme=w.scheme),d[f]=p(P,w).toString().replace("{version}",r.version)}var A,D=r.available;if(a(D)){A=new S(y._tilingScheme,D.length);for(var I=0;I<D.length;++I){var O=D[I],M=y._tilingScheme.getNumberOfYTilesAtLevel(I);a(x[I])||(x[I]=[]);for(var R=0;R<O.length;++R){var L=O[R],N=M-L.endY-1,k=M-L.startY-1;x[I].push([L.startX,N,L.endX,k]),A.addAvailableTileRange(I,L.startX,N,L.endX,k)}}}a(r.extensions)&&-1!==r.extensions.indexOf("octvertexnormals")?o=!0:a(r.extensions)&&-1!==r.extensions.indexOf("vertexnormals")&&(o=!0,u=!1),a(r.extensions)&&-1!==r.extensions.indexOf("watermask")&&(l=!0),y._hasWaterMask=y._hasWaterMask||l,y._hasVertexNormals=y._hasVertexNormals||o,a(r.attribution)&&(C.length>0&&(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;r<e;++r)for(var i=x[r],o=0;o<i.length;++o){var s=i[o];t.addAvailableTileRange(r,s[0],s[1],s[2],s[3])}!a(y._credit)&&C.length>0&&(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;A<x;++A)R+=u(D[A]),L+=u(O[A]),N+=u(M[A]),D[A]=R,O[A]=L,M[A]=N;c%m!=0&&(c+=m-c%m);var k=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var F=h.createTypedArrayFromArrayBuffer(x,t,c,3*k);c+=k*y;var B=0;for(A=0;A<F.length;++A){var U=F[A];F[A]=B-U,0===U&&++B}var V=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var z=h.createTypedArrayFromArrayBuffer(x,t,c,V);c+=V*m;var G=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var H=h.createTypedArrayFromArrayBuffer(x,t,c,G);c+=G*m;var W=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var j=h.createTypedArrayFromArrayBuffer(x,t,c,W);c+=W*m;var q=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var Y=h.createTypedArrayFromArrayBuffer(x,t,c,q);c+=q*m;for(var X,Q;c<b.byteLength;){var Z=b.getUint8(c,!0);c+=Uint8Array.BYTES_PER_ELEMENT;var K=b.getUint32(c,l);c+=Uint32Array.BYTES_PER_ELEMENT,Z===I.OCT_VERTEX_NORMALS&&e._requestVertexNormals?X=new Uint8Array(t,c,2*x):Z===I.WATER_MASK&&e._requestWaterMask&&(Q=new Uint8Array(t,c,K)),c+=K}var J,$=5*e.getLevelMaximumGeometricError(n),ee=e._tilingScheme.tileXYToRectangle(o,a,n);return ee.width<g.PI_OVER_TWO+g.EPSILON5&&(J=v.fromRectangle(ee,w,S,e._tilingScheme.ellipsoid)),new _({center:C,minimumHeight:w,maximumHeight:S,boundingSphere:T,orientedBoundingBox:J,horizonOcclusionPoint:E,quantizedVertices:P,encodedNormals:X,indices:F,westIndices:z,southIndices:H,eastIndices:j,northIndices:Y,westSkirtHeight:$,southSkirtHeight:$,eastSkirtHeight:$,northSkirtHeight:$,childTileMask:e.availability.computeChildMaskForTile(n,o,a),waterMask:Q})}var I={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return x.prototype.requestTileGeometry=function(e,r,i,n){var o,s=this._layers,l=s.length;if(1===l)o=s[0];else for(var u=0;u<l;++u){var c=s[u];if(!a(c.availability)||c.availability.isTileAvailable(i,e,r)){o=c;break}}if(!a(o))return t.reject(new C("Terrain tile doesn't exist"));var d=o.tileUrlTemplates;if(0!==d.length){var h=this._tilingScheme.getNumberOfYTilesAtLevel(i),p=h-r-1,m=d[(e+p+i)%d.length].replace("{z}",i).replace("{x}",e).replace("{y}",p),g=this._proxy;a(g)&&(m=g.getURL(m));var v=[];this._requestVertexNormals&&o.hasVertexNormals&&v.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&o.hasWaterMask&&v.push("watermask");var _=f(m,P(v),n);if(a(_)){var y=this;return t(_,function(t){return a(y._heightmapStructure)?A(y,t,i,e,r,p):D(y,t,i,e,r,p,o.littleEndianExtensionSize)})}}},s(x.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},availability:{get:function(){return this._availability}}}),x.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},x.prototype.getTileDataAvailable=function(e,t,r){if(a(this._availability))return this._availability.isTileAvailable(r,e,t)},x}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,d,h,p,f,m,g){var v=t+n;e.multiplyByScalar(c,Math.cos(v),a),e.multiplyByScalar(o,Math.sin(v),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var b=h/Math.sqrt(p*_+d*y),C=b/f;return i.fromAxisAngle(a,C,l),r.fromQuaternion(l,u),r.multiplyByVector(u,m,g),e.normalize(g,g),e.multiplyByScalar(g,f,g),g}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,d=new e,h=new e,p=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,f=i?u:0,m=0;m<u;m+=3){var g=m+1,v=m+2,_=e.fromArray(t,m,c);n.scaleToGeodeticSurface(_,_);var y=e.clone(_,d),b=n.geodeticSurfaceNormal(_,p),C=e.multiplyByScalar(b,o,h);e.add(_,C,_),i&&(e.multiplyByScalar(b,a,C),e.add(y,C,y),l[m+f]=y.x,l[g+f]=y.y,l[v+f]=y.z),l[m]=_.x,l[g]=_.y,l[v]=_.z}return l};var f=new e,m=new e,g=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,p=8*r.granularity,v=a*a,_=s*s,y=s*a,b=e.magnitude(u),C=e.normalize(u,f),w=e.cross(e.UNIT_Z,u,m);w=e.normalize(w,w);var S=e.cross(C,w,g),T=1+Math.ceil(t.PI_OVER_TWO/p),E=t.PI_OVER_TWO/(T-1),x=t.PI_OVER_TWO-T*E;x<0&&(T-=Math.ceil(Math.abs(x)/E));var P,A,D,I,O,M=T*(T+2)*2,R=i?new Array(3*M):void 0,L=0,N=c,k=d,F=4*T*3,B=F-1,U=0,V=o?new Array(F):void 0;for(x=t.PI_OVER_TWO,N=n(x,l,S,w,v,y,_,b,C,N),i&&(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z),o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x),x=t.PI_OVER_TWO-E,P=1;P<T+1;++P){if(N=n(x,l,S,w,v,y,_,b,C,N),k=n(Math.PI-x,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+2,A=1;A<D-1;++A)I=A/(D-1),O=e.lerp(N,k,I,h),R[L++]=O.x,R[L++]=O.y,R[L++]=O.z;R[L++]=k.x,R[L++]=k.y,R[L++]=k.z}o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,V[U++]=k.x,V[U++]=k.y,V[U++]=k.z),x=t.PI_OVER_TWO-(P+1)*E}for(P=T;P>1;--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<D-1;++A)I=A/(D-1),O=e.lerp(N,k,I,h),R[L++]=O.x,R[L++]=O.y,R[L++]=O.z;R[L++]=k.x,R[L++]=k.y,R[L++]=k.z}o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,V[U++]=k.x,V[U++]=k.y,V[U++]=k.z)}x=t.PI_OVER_TWO,N=n(-x,l,S,w,v,y,_,b,C,N);var z={};return i&&(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,z.positions=R,z.numPts=T),o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,z.outerPositions=V),z},o}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./Check","./defined"],function(e,t,r){"use strict";function i(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}i.encode=function(e,t){r(t)||(t={high:0,low:0});var i;return e>=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];s<a;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var d=o+1,h=0;h<a;++h)d-u[i[h]]>o&&(u[i[h]]=d,++d);return(d-o+1)/(a/3)},i.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n<i;){if(e[n].numLiveTriangles>0)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(;c<h;)d>u&&(u=d),++c,d=o[c];if(-1===u)return 0;++u}var p,f=[];for(p=0;p<u;p++)f[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;for(var m=0;c<h;)f[o[c]].vertexTriangles.push(m),++f[o[c]].numLiveTriangles,f[o[c+1]].vertexTriangles.push(m),++f[o[c+1]].numLiveTriangles,f[o[c+2]].vertexTriangles.push(m),++f[o[c+2]].numLiveTriangles,++m,c+=3;var g=0,v=s+1;n=1;var _,y,b=[],C=[],w=0,S=[],T=l/3,E=[];for(p=0;p<T;p++)E[p]=!1;for(var x,P;-1!==g;){b=[],y=f[g],P=y.vertexTriangles.length;for(var A=0;A<P;++A)if(m=y.vertexTriangles[A],!E[m]){E[m]=!0,c=m+m+m;for(var D=0;D<3;++D)x=o[c],b.push(x),C.push(x),S[w]=x,++w,_=f[x],--_.numLiveTriangles,v-_.timeStamp>s&&(_.timeStamp=v,++v),++c}g=function(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,d=0;d<r.length;){var h=r[d];n[h].numLiveTriangles&&(l=0,o-n[h].timeStamp+2*n[h].numLiveTriangles<=t&&(l=o-n[h].timeStamp),(l>c||-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<t;o+=3,n+=6)E(i,n,e[o],e[o+1],e[o+2]);return i}function P(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.createTypedArray(t,r);E(i,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)E(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function A(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;a<t;++a,o+=6)E(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function D(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&u(e[r])&&u(e[r].values)){var i=e[r];t[r]=new f({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function I(e,t,r){for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values))for(var n=t[i],o=0;o<n.componentsPerAttribute;++o)e[i].values.push(n.values[r*n.componentsPerAttribute+o])}function O(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),C.multiplyByPoint(e,oe,oe),n.pack(oe,r,o)}function M(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),b.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,r,o)}function R(e,t){var r,i=e.length,n={},o=e[0][t].attributes;for(r in o)if(o.hasOwnProperty(r)&&u(o[r])&&u(o[r].values)){for(var a=o[r],l=a.values.length,c=!0,d=1;d<i;++d){var h=e[d][t].attributes[r];if(!u(h)||a.componentDatatype!==h.componentDatatype||a.componentsPerAttribute!==h.componentsPerAttribute||a.normalize!==h.normalize){c=!1;break}l+=h.values.length}c&&(n[r]=new f({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function L(e,t){var i,o,a,s,l,c,d,h=e.length,f=(e[0].modelMatrix,u(e[0][t].indices)),m=e[0][t].primitiveType,v=R(e,t);for(i in v)if(v.hasOwnProperty(i))for(l=v[i].values,s=0,o=0;o<h;++o)for(c=e[o][t].attributes[i].values,d=c.length,a=0;a<d;++a)l[s++]=c[a];var _;if(f){var y=0;for(o=0;o<h;++o)y+=e[o][t].indices.length;var b=p.computeNumberOfVertices(new p({attributes:v,primitiveType:S.POINTS})),C=g.createTypedArray(b,y),w=0,T=0;for(o=0;o<h;++o){var E=e[o][t].indices,x=E.length;for(s=0;s<x;++s)C[w++]=T+E[s];T+=p.computeNumberOfVertices(e[o][t])}_=C}var P,A=new n,D=0;for(o=0;o<h;++o){if(P=e[o][t].boundingSphere,!u(P)){A=void 0;break}n.add(P.center,A,A)}if(u(A))for(n.divideByScalar(A,h,A),o=0;o<h;++o){P=e[o][t].boundingSphere;var I=n.magnitude(n.subtract(P.center,A,le))+P.radius;I>D&&(D=I)}return new p({attributes:v,indices:_,primitiveType:m,boundingSphere:u(A)?new r(A,D):void 0})}function N(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function k(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;n<t;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;n<t-1;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,n+2<t&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function U(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=S.LINES,e}function V(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=S.LINES,e}function z(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return k(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return N(e);case S.LINE_STRIP:return U(e);case S.LINE_LOOP:return V(e);case S.LINES:return B(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(e.y=t?-y.EPSILON6:y.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return G(e,e.y<0),G(t,t.y<0),void G(r,r.y<0);var i,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(r.y);i=n>o?n>a?y.sign(e.y):y.sign(r.y):o>a?y.sign(t.y):y.sign(r.y);var s=i<0;G(e,s),G(t,s),G(r,s)}function W(e,t,r,i){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),r),n.clone(r,i),G(r,!0),G(i,!1)}function j(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var i=e.y<0,n=t.y<0,o=r.y<0,a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(W(e,t,we,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;a<y.length;++a)y[a]=-1,b[a]=-1;var C=g.length;for(a=0;a<C;a+=3){var w=g[a],S=g[a+1],T=g[a+2],E=n.fromArray(c,3*w),x=n.fromArray(c,3*S),P=n.fromArray(c,3*T),A=j(E,x,P);if(u(A)&&A.positions.length>3)for(var D=A.positions,I=A.indices,O=I.length,M=0;M<O;++M){var R=I[M],L=D[R];L.y<0?(t=_.attributes,r=_.indices,i=y):(t=v.attributes,r=v.indices,i=b),o=Z(t,r,i,g,R<3?a+R:-1,L),Q(w,S,T,L,c,d,p,h,f,m,t,o)}else u(A)&&(E=A.positions[0],x=A.positions[1],P=A.positions[2]),E.y<0?(t=_.attributes,r=_.indices,i=y):(t=v.attributes,r=v.indices,i=b),o=Z(t,r,i,g,a,E),Q(w,S,T,E,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+1,x),Q(w,S,T,x,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+2,P),Q(w,S,T,P,c,d,p,h,f,m,t,o)}X(e,_,v)}function J(e){var t,r=e.geometry,i=r.attributes,o=i.position.values,a=r.indices,s=Y(r),l=Y(r),c=a.length,d=[];d.length=o.length/3;var h=[];for(h.length=o.length/3,t=0;t<d.length;++t)d[t]=-1,h[t]=-1;for(t=0;t<c;t+=2){var p=a[t],f=a[t+1],m=n.fromArray(o,3*p,Pe),g=n.fromArray(o,3*f,Ae);Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6),Math.abs(g.y)<y.EPSILON6&&(g.y<0?g.y=-y.EPSILON6:g.y=y.EPSILON6);var v=s.attributes,b=s.indices,C=h,w=l.attributes,S=l.indices,T=d,E=_.lineSegmentPlane(m,g,Le,De);if(u(E)){var x=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,Ne);m.y<0&&(n.negate(x,x),v=l.attributes,b=l.indices,C=d,w=s.attributes,S=s.indices,T=h);var P=n.add(E,x,ke);Z(v,b,C,a,t,m),Z(v,b,C,a,-1,P),n.negate(x,x),n.add(E,x,P),Z(w,S,T,a,-1,P),Z(w,S,T,a,t+1,g)}else{var A,D,I;m.y<0?(A=l.attributes,D=l.indices,I=d):(A=s.attributes,D=s.indices,I=h),Z(A,D,I,a,t,m),Z(A,D,I,a,t+1,g)}}X(e,l,s)}function $(e){for(var t=e.attributes,r=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,a=r.length,s=0;s<a;s+=3){var l=n.unpack(r,s,Ue);if(!(l.x>0)){var u=n.unpack(i,s,Ve);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(i[s]=r[s-3],i[s+1]=r[s-2],i[s+2]=r[s-1]):n.pack(l,i,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3<a?(o[s]=r[s+3],o[s+1]=r[s+4],o[s+2]=r[s+5]):n.pack(l,o,s))}}}function ee(e){var t,r,a,s=e.geometry,l=s.attributes,c=l.position.values,d=l.prevPosition.values,h=l.nextPosition.values,p=l.expandAndWidth.values,f=u(l.st)?l.st.values:void 0,m=u(l.color)?l.color.values:void 0,g=Y(s),v=Y(s),b=!1,C=c.length/3;for(t=0;t<C;t+=4){var w=t,S=t+2,T=n.fromArray(c,3*w,Ue),E=n.fromArray(c,3*S,Ve);if(Math.abs(T.y)<Ye)for(T.y=Ye*(E.y<0?-1:1),c[3*t+1]=T.y,c[3*(t+1)+1]=T.y,r=3*w;r<3*w+12;r+=3)d[r]=c[3*t],d[r+1]=c[3*t+1],d[r+2]=c[3*t+2];if(Math.abs(E.y)<Ye)for(E.y=Ye*(T.y<0?-1:1),c[3*(t+2)+1]=E.y,c[3*(t+3)+1]=E.y,r=3*w;r<3*w+12;r+=3)h[r]=c[3*(t+2)],h[r+1]=c[3*(t+2)+1],h[r+2]=c[3*(t+2)+2];var x=g.attributes,P=g.indices,A=v.attributes,D=v.indices,I=_.lineSegmentPlane(T,E,Le,Ge);if(u(I)){b=!0;var O=n.multiplyByScalar(n.UNIT_Y,qe,He);T.y<0&&(n.negate(O,O),x=v.attributes,P=v.indices,A=g.attributes,D=g.indices);var M=n.add(I,O,We);x.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),x.position.values.push(M.x,M.y,M.z),x.position.values.push(M.x,M.y,M.z),x.prevPosition.values.push(d[3*w],d[3*w+1],d[3*w+2]),x.prevPosition.values.push(d[3*w+3],d[3*w+4],d[3*w+5]),x.prevPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),x.nextPosition.values.push(M.x,M.y,M.z),x.nextPosition.values.push(M.x,M.y,M.z),x.nextPosition.values.push(M.x,M.y,M.z),x.nextPosition.values.push(M.x,M.y,M.z),n.negate(O,O),n.add(I,O,M),A.position.values.push(M.x,M.y,M.z),A.position.values.push(M.x,M.y,M.z),A.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),A.prevPosition.values.push(M.x,M.y,M.z),A.prevPosition.values.push(M.x,M.y,M.z),A.prevPosition.values.push(M.x,M.y,M.z),A.prevPosition.values.push(M.x,M.y,M.z),A.nextPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),A.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),A.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var R=i.fromArray(p,2*w,Fe),L=Math.abs(R.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),A.expandAndWidth.values.push(-1,L,1,L),A.expandAndWidth.values.push(-1,-L,1,-L);var N=n.magnitudeSquared(n.subtract(I,T,ze));if(N/=n.magnitudeSquared(n.subtract(E,T,ze)),u(m)){var k=o.fromArray(m,4*w,je),F=o.fromArray(m,4*S,je),B=y.lerp(k.x,F.x,N),U=y.lerp(k.y,F.y,N),V=y.lerp(k.z,F.z,N),z=y.lerp(k.w,F.w,N);for(r=4*w;r<4*w+8;++r)x.color.values.push(m[r]);for(x.color.values.push(B,U,V,z),x.color.values.push(B,U,V,z),A.color.values.push(B,U,V,z),A.color.values.push(B,U,V,z),r=4*S;r<4*S+8;++r)A.color.values.push(m[r])}if(u(f)){var G=i.fromArray(f,2*w,Fe),H=i.fromArray(f,2*(t+3),Be),W=y.lerp(G.x,H.x,N);for(r=2*w;r<2*w+4;++r)x.st.values.push(f[r]);for(x.st.values.push(W,G.y),x.st.values.push(W,H.y),A.st.values.push(W,G.y),A.st.values.push(W,H.y),r=2*S;r<2*S+4;++r)A.st.values.push(f[r])}a=x.position.values.length/3-4,P.push(a,a+2,a+1),P.push(a+1,a+2,a+3),a=A.position.values.length/3-4,D.push(a,a+2,a+1),D.push(a+1,a+2,a+3)}else{var j,q;for(T.y<0?(j=v.attributes,q=v.indices):(j=g.attributes,q=g.indices),j.position.values.push(T.x,T.y,T.z),j.position.values.push(T.x,T.y,T.z),j.position.values.push(E.x,E.y,E.z),j.position.values.push(E.x,E.y,E.z),r=3*t;r<3*t+12;++r)j.prevPosition.values.push(d[r]),j.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)j.expandAndWidth.values.push(p[r]),u(f)&&j.st.values.push(f[r]);if(u(m))for(r=4*t;r<4*t+16;++r)j.color.values.push(m[r]);a=j.position.values.length/3-4,q.push(a,a+2,a+1),q.push(a+1,a+2,a+3)}}b&&($(v),$(g)),X(e,v,g)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=x(t);break;case S.TRIANGLE_STRIP:e.indices=P(t);break;case S.TRIANGLE_FAN:e.indices=A(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,i){t=l(t,"normal"),i=l(i,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),d=0,h=0;h<a;h+=3)c[d++]=n[h],c[d++]=n[h+1],c[d++]=n[h+2],c[d++]=n[h]+o[h]*i,c[d++]=n[h+1]+o[h+1]*i,c[d++]=n[h+2]+o[h+2]*i;var m,g=e.boundingSphere;return u(g)&&(m=new r(g.center,g.radius+i)),new p({attributes:{position:new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],i=e.attributes,n={},o=0,a=r.length;for(t=0;t<a;++t){var s=r[t];u(i[s])&&(n[s]=o++)}for(var l in i)i.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),r=e.indices;if(u(r)){for(var i=new Int32Array(t),n=0;n<t;n++)i[n]=-1;for(var o,a=r,l=a.length,c=g.createTypedArray(t,l),d=0,h=0,f=0;d<l;)o=i[a[d]],-1!==o?c[h]=o:(o=a[d],i[o]=f,c[h]=f,++f),++d,++h;e.indices=c;var m=e.attributes;for(var v in m)if(m.hasOwnProperty(v)&&u(m[v])&&u(m[v].values)){
  438. for(var _=m[v],y=_.values,b=0,C=_.componentsPerAttribute,w=s.createTypedArray(_.componentDatatype,f*C);b<t;){var S=i[b];if(-1!==S)for(var T=0;T<C;T++)w[C*S+T]=y[C*b+T];++b}_.values=w}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&u(r)){for(var i=r.length,n=0,o=0;o<i;o++)r[o]>n&&(n=r[o]);e.indices=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<c;d+=i){for(var h=0;h<i;++h){var f=l[d+h],m=n[f];u(m)||(m=a++,n[f]=m,I(s,e.attributes,f)),o.push(m)}a+i>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new n,ie=new a;te.projectTo2D=function(e,t,r,i,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m<c.length;m+=3){var g=n.fromArray(c,m,re),v=l.cartesianToCartographic(g,ie),_=o.project(v,re);d[p++]=_.x,d[p++]=_.y,d[p++]=_.z}return e.attributes[r]=a,e.attributes[i]=new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,r,i){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;c<a;++c)d.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var h=n.componentsPerAttribute;return e.attributes[r]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:l}),e.attributes[i]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var oe=new n,ae=new C,se=new b;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(C.equals(t,C.IDENTITY))return e;var i=e.geometry.attributes;O(t,i.position),O(t,i.prevPosition),O(t,i.nextPosition),(u(i.normal)||u(i.tangent)||u(i.bitangent))&&(C.inverse(t,ae),C.transpose(ae,ae),C.getRotation(ae,se),M(se,i.normal),M(se,i.tangent),M(se,i.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=r.transform(n,t,n)),e.modelMatrix=C.clone(C.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],r=[],i=e.length,n=0;n<i;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&r.push(o)}var a=[];return t.length>0&&a.push(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;t<a;t++)u[t]={indexOffset:0,count:0,currentCount:0};var h=0;for(t=0;t<l;t+=3){var p=r[t],m=r[t+1],g=r[t+2],v=3*p,_=3*m,b=3*g;ce.x=o[v],ce.y=o[v+1],ce.z=o[v+2],de.x=o[_],de.y=o[_+1],de.z=o[_+2],he.x=o[b],he.y=o[b+1],he.z=o[b+2],u[p].count++,u[m].count++,u[g].count++,n.subtract(de,ce,de),n.subtract(he,ce,he),c[h]=n.cross(de,he,new n),h++}var C=0;for(t=0;t<a;t++)u[t].indexOffset+=C,C+=u[t].count;h=0;var w;for(t=0;t<l;t+=3){w=u[r[t]];var S=w.indexOffset+w.currentCount;d[S]=h,w.currentCount++,w=u[r[t+1]],S=w.indexOffset+w.currentCount,d[S]=h,w.currentCount++,w=u[r[t+2]],S=w.indexOffset+w.currentCount,d[S]=h,w.currentCount++,h++}var T=new Float32Array(3*a);for(t=0;t<a;t++){var E=3*t;if(w=u[t],n.clone(n.ZERO,ue),w.count>0){for(h=0;h<w.count;h++)n.add(ue,c[d[w.indexOffset+h]],ue);n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&n.clone(c[d[w.indexOffset]],ue)}n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&(ue.z=1),n.normalize(ue,ue),T[E]=ue.x,T[E+1]=ue.y,T[E+2]=ue.z}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:T}),e};var pe=new n,fe=new n,me=new n;te.computeTangentAndBitangent=function(e){var t,r=(e.attributes,e.indices),i=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,l=e.attributes.position.values.length/3,u=r.length,c=new Array(3*l);for(t=0;t<c.length;t++)c[t]=0;var d,h,p;for(t=0;t<u;t+=3){var m=r[t],g=r[t+1],v=r[t+2];d=3*m,h=3*g,p=3*v;var _=2*m,y=2*g,b=2*v,C=i[d],w=i[d+1],S=i[d+2],T=a[_],E=a[_+1],x=a[y+1]-E,P=a[b+1]-E,A=1/((a[y]-T)*P-(a[b]-T)*x),D=(P*(i[h]-C)-x*(i[p]-C))*A,I=(P*(i[h+1]-w)-x*(i[p+1]-w))*A,O=(P*(i[h+2]-S)-x*(i[p+2]-S))*A;c[d]+=D,c[d+1]+=I,c[d+2]+=O,c[h]+=D,c[h+1]+=I,c[h+2]+=O,c[p]+=D,c[p+1]+=I,c[p+2]+=O}var M=new Float32Array(3*l),R=new Float32Array(3*l);for(t=0;t<l;t++){d=3*t,h=d+1,p=d+2;var L=n.fromArray(o,d,pe),N=n.fromArray(c,d,me),k=n.dot(L,N);n.multiplyByScalar(L,k,fe),n.normalize(n.subtract(N,fe,N),N),M[d]=N.x,M[h]=N.y,M[p]=N.z,n.normalize(n.cross(L,N,N),N),R[d]=N.x,R[h]=N.y,R[p]=N.z}return e.attributes.tangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:M}),e.attributes.bitangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ge=new i,ve=new n,_e=new n,ye=new n,be=new i;te.compressVertices=function(t){var r,o,a=t.attributes.extrudeDirection;if(u(a)){var l=a.values;o=l.length/3;var c=new Float32Array(2*o),d=0;for(r=0;r<o;++r)n.fromArray(l,3*r,ve),n.equals(ve,n.ZERO)?d+=2:(be=e.octEncodeInRange(ve,65535,be),c[d++]=be.x,c[d++]=be.y);return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:c}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,p=t.attributes.st,m=u(h),g=u(p);if(!m&&!g)return t;var v,_,y,b,C=t.attributes.tangent,w=t.attributes.bitangent,S=u(C),T=u(w);m&&(v=h.values),g&&(_=p.values),S&&(y=C.values),T&&(b=w.values),o=(m?v.length:_.length)/(m?3:2);var E=o,x=g&&m?2:1;x+=S||T?1:0,E*=x;var P=new Float32Array(E),A=0;for(r=0;r<o;++r){g&&(i.fromArray(_,2*r,ge),P[A++]=e.compressTextureCoordinates(ge));var D=3*r;m&&u(y)&&u(b)?(n.fromArray(v,D,ve),n.fromArray(y,D,_e),n.fromArray(b,D,ye),e.octPack(ve,_e,ye,ge),P[A++]=ge.x,P[A++]=ge.y):(m&&(n.fromArray(v,D,ve),P[A++]=e.octEncodeFloat(ve)),S&&(n.fromArray(y,D,ve),P[A++]=e.octEncodeFloat(ve)),T&&(n.fromArray(b,D,ve),P[A++]=e.octEncodeFloat(ve)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:x,values:P}),m&&delete t.attributes.normal,g&&delete t.attributes.st,T&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ce=new n,we=new n,Se=new n,Te=new n,Ee=new n,xe={positions:new Array(7),indices:new Array(9)},Pe=new n,Ae=new n,De=new n,Ie=new n,Oe=new i,Me=new i,Re=new i,Le=w.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,ke=new n,Fe=new i,Be=new i,Ue=new n,Ve=new n,ze=new n,Ge=new n,He=new n,We=new n,je=new o,qe=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,i=t.boundingSphere;if(u(i)){if(i.center.x-i.radius>0||r.intersectPlane(i,w.ORIGIN_ZX_PLANE)!==v.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:K(e);break;case m.LINES:J(e)}else z(t),t.primitiveType===S.TRIANGLES?K(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,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;J<Q;J+=3){var $=J+1,ee=J+2,te=r.fromArray(e,J,L);if(a.st){var re=y.multiplyByVector(R,te,N),ie=D.project(h.cartesianToCartographic(re,W),k);r.subtract(ie,I,ie),B.x=(ie.x+l)/(2*l),B.y=(ie.y+c)/(2*c),F.x=Math.min(B.x,F.x),F.y=Math.min(B.y,F.y),X.x=Math.max(B.x,X.x),X.y=Math.max(B.y,X.y),o&&(_[E+K]=B.x,_[E+1+K]=B.y),_[E++]=B.x,_[E++]=B.y}(a.normal||a.tangent||a.bitangent||v)&&(x=h.geodeticSurfaceNormal(te,x),v&&(T[J+Z]=-x.x,T[$+Z]=-x.y,T[ee+Z]=-x.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(P=r.normalize(r.cross(r.UNIT_Z,x,P),P),y.multiplyByVector(R,P,P)),a.normal&&(b[J]=x.x,b[$]=x.y,b[ee]=x.z,o&&(b[J+Z]=-x.x,b[$+Z]=-x.y,b[ee+Z]=-x.z)),a.tangent&&(C[J]=P.x,C[$]=P.y,C[ee]=P.z,o&&(C[J+Z]=-P.x,C[$+Z]=-P.y,C[ee+Z]=-P.z)),a.bitangent&&(A=r.normalize(r.cross(x,P,A),A),S[J]=A.x,S[$]=A.y,S[ee]=A.z,o&&(S[J+Z]=A.x,S[$+Z]=A.y,S[ee+Z]=A.z))))}if(a.st){Q=_.length;for(var ne=0;ne<Q;ne+=2)_[ne]=(_[ne]-F.x)/(X.x-F.x),_[ne+1]=(_[ne+1]-F.y)/(X.y-F.y)}var oe=new f;if(a.position){var ae=u.raisePositionsToHeight(e,i,o);oe.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ae})}return a.st&&(oe.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:_})),a.normal&&(oe.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),a.tangent&&(oe.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.bitangent&&(oe.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),v&&(oe.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),oe}function P(e){var t,r,i,n,o,a=new Array(e*(e+1)*12-6),s=0;for(t=0,i=1,n=0;n<3;n++)a[s++]=i++,a[s++]=t,a[s++]=i;for(n=2;n<e+1;++n){for(i=n*(n+1)-1,t=(n-1)*n-1,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;n<r-1;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=i;return a}function A(t){var i=t.center;X=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,X),t.height,X),X=r.add(i,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=x(a,t,!1),c=P(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function D(e,i){var o=i.vertexFormat,a=i.center,s=i.semiMajorAxis,l=i.semiMinorAxis,u=i.ellipsoid,c=i.height,h=i.extrudedHeight,m=i.stRotation,g=e.length/3*2,v=new Float64Array(3*g),_=o.st?new Float32Array(2*g):void 0,b=o.normal?new Float32Array(3*g):void 0,C=o.tangent?new Float32Array(3*g):void 0,S=o.bitangent?new Float32Array(3*g):void 0,T=i.shadowVolume,E=T?new Float32Array(3*g):void 0,x=0,P=z,A=G,D=H,I=new d(u),O=I.project(u.cartesianToCartographic(a,W),j),M=u.scaleToGeodeticSurface(a,L);u.geodeticSurfaceNormal(M,M);for(var R=w.fromAxisAngle(M,m,V),X=y.fromQuaternion(R,U),Q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),Z=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),K=e.length,J=K/3*2,$=0;$<K;$+=3){var ee,te=$+1,re=$+2,ie=r.fromArray(e,$,L);if(o.st){var ne=y.multiplyByVector(X,ie,N),oe=I.project(u.cartesianToCartographic(ne,W),k);r.subtract(oe,O,oe),B.x=(oe.x+s)/(2*s),B.y=(oe.y+l)/(2*l),Q.x=Math.min(B.x,Q.x),Q.y=Math.min(B.y,Q.y),Z.x=Math.max(B.x,Z.x),Z.y=Math.max(B.y,Z.y),_[x+J]=B.x,_[x+1+J]=B.y,_[x++]=B.x,_[x++]=B.y}ie=u.scaleToGeodeticSurface(ie,ie),ee=r.clone(ie,N),P=u.geodeticSurfaceNormal(ie,P),T&&(E[$+K]=-P.x,E[te+K]=-P.y,E[re+K]=-P.z);var ae=r.multiplyByScalar(P,c,F);if(ie=r.add(ie,ae,ie),ae=r.multiplyByScalar(P,h,ae),ee=r.add(ee,ae,ee),o.position&&(v[$+K]=ee.x,v[te+K]=ee.y,v[re+K]=ee.z,v[$]=ie.x,v[te]=ie.y,v[re]=ie.z),o.normal||o.tangent||o.bitangent){D=r.clone(P,D);var se=r.fromArray(e,($+3)%K,F);r.subtract(se,ie,se);var le=r.subtract(ee,ie,k);P=r.normalize(r.cross(le,se,P),P),o.normal&&(b[$]=P.x,b[te]=P.y,b[re]=P.z,b[$+K]=P.x,b[te+K]=P.y,b[re+K]=P.z),o.tangent&&(A=r.normalize(r.cross(D,P,A),A),C[$]=A.x,C[te]=A.y,C[re]=A.z,C[$+K]=A.x,C[$+1+K]=A.y,C[$+2+K]=A.z),o.bitangent&&(S[$]=D.x,S[te]=D.y,S[re]=D.z,S[$+K]=D.x,S[te+K]=D.y,S[re+K]=D.z)}}if(o.st){K=_.length;for(var ue=0;ue<K;ue+=2)_[ue]=(_[ue]-Q.x)/(Z.x-Q.x),_[ue+1]=(_[ue+1]-Q.y)/(Z.y-Q.y)}var ce=new f;return o.position&&(ce.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:v})),o.st&&(ce.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ce.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),o.tangent&&(ce.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.bitangent&&(ce.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),T&&(ce.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),ce}function I(e){for(var t=e.length/3,r=v.createTypedArray(t,6*t),i=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;r[i++]=o,r[i++]=a,r[i++]=s,r[i++]=s,r[i++]=a,r[i++]=l}return r}function O(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,L),t.height,L);Q.center=r.add(i,a,Q.center),Q.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),Z.center=r.add(i,a,Z.center),Z.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(Q,Z),f=x(l,t,!0),_=P(c),y=_.length;_.length=2*y;for(var b=l.length/3,w=0;w<y;w+=3)_[w+y]=_[w+2]+b,_[w+1+y]=_[w+1]+b,_[w+2+y]=_[w]+b;var S=v.createTypedArray(2*b/3,_),T=new h({attributes:f,indices:S,primitiveType:C.TRIANGLES}),E=D(d,t);_=I(d);var A=v.createTypedArray(2*d.length/3,_),O=new h({attributes:E,indices:A,primitiveType:C.TRIANGLES}),M=g.combineInstances([new m({geometry:T}),new m({geometry:O})]);return{boundingSphere:p,attributes:M[0].attributes,indices:M[0].indices}}function M(e,t,i,n,o){T.eastNorthUpToFixedFrame(e,t,K),b.inverseTransformation(K,J);var a;for(a=0;a<4;++a)r.clone(r.ZERO,ee[a]);for(ee[0].x+=i,ee[1].x-=i,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),b.multiplyByPoint(K,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return S.fromCartographicArray(te)}function R(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,_.RADIANS_PER_DEGREE),u=o(e.height,0),d=e.extrudedHeight,h=a(d)&&Math.abs(u-d)>1,p=o(e.vertexFormat,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;m<h;++m)p[f++]=m,p[f++]=(m+1)%h;return{boundingSphere:o,attributes:l,indices:p}}function m(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,v),n.height,v);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),b.center=t.add(o,p,b.center),b.radius=l;var f=a.computeEllipsePositions(n,!1,!0).outerPositions,m=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(f,n,!0)})});f=m.position.values;var g=e.union(y,b),_=f.length/3,C=i(n.numberOfVerticalLines,16);C=h.clamp(C,0,_/2);var w=d.createTypedArray(_,2*_+2*C);_/=2;var S,T=0;for(S=0;S<_;++S)w[T++]=S,w[T++]=(S+1)%_,w[T++]=S+_,w[T++]=(S+1)%_+_;var E;if(C>0){var x=Math.min(C,_);E=Math.round(_/x);var P=Math.min(E*C,_);for(S=0;S<P;S+=E)w[T++]=S,w[T++]=S+_}return{boundingSphere:g,attributes:m,indices:w}}function g(e){e=i(e,i.EMPTY_OBJECT);var r=e.center,o=i(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=i(e.granularity,h.RADIANS_PER_DEGREE),c=i(e.height,0),d=e.extrudedHeight,p=n(d)&&Math.abs(c-d)>1;this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var v=new t,_=new t,y=new e,b=new e;g.packedLength=t.packedLength+s.packedLength+9,g.pack=function(e,r,o){return o=i(o,0),t.pack(e._center,r,o),o+=t.packedLength,s.pack(e._ellipsoid,r,o),o+=s.packedLength,r[o++]=e._semiMajorAxis,r[o++]=e._semiMinorAxis,r[o++]=e._rotation,r[o++]=e._height,r[o++]=e._granularity,r[o++]=n(e._extrudedHeight)?1:0,r[o++]=i(e._extrudedHeight,0),r[o++]=e._extrude?1:0,r[o]=e._numberOfVerticalLines,r};var C=new t,w=new s,S={center:C,ellipsoid:w,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return g.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,C);r+=t.packedLength;var l=s.unpack(e,r,w);r+=s.packedLength;var u=e[r++],c=e[r++],d=e[r++],h=e[r++],p=e[r++],f=e[r++],m=e[r++],v=1===e[r++],_=e[r];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=v,o._numberOfVerticalLines=_,o):(S.height=h,S.extrudedHeight=f?m:void 0,S.granularity=p,S.rotation=d,S.semiMajorAxis=u,S.semiMinorAxis=c,S.numberOfVerticalLines=_,new g(S))},g.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=m(r)):t=f(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},g}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";function a(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(i),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipseGeometry,t,r)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";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)},
  439. 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;n<e;n++)i[n]=t;return i}var o=r-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;i[n]=s}return i}function p(t,r,i,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,A),c=n.scaleToGeodeticSurface(r,D),d=f.numberOfPoints(t,r,i),p=n.cartesianToCartographic(u,E),m=n.cartesianToCartographic(c,x),g=h(d,o,a);I.setEndPoints(p,m);var v=I.surfaceDistance/d,_=l;p.height=o;var y=n.cartographicToCartesian(p,P);e.pack(y,s,_),_+=3;for(var b=1;b<d;b++){var C=I.interpolateUsingSurfaceDistance(b*v,x);C.height=g[b],y=n.cartographicToCartesian(C,P),e.pack(y,s,_),_+=3}return _}var f={};f.numberOfPoints=function(t,r,i){var n=e.distance(t,r);return Math.ceil(n/i)};var m=new t;f.extractHeights=function(e,t){for(var r=e.length,i=new Array(r),n=0;n<r;n++){var o=e[n];i[n]=t.cartesianToCartographic(o,m).height}return i};var g=new c,v=new e,_=new e,y=new d(e.UNIT_X,0),b=new e,C=new d(e.UNIT_X,0),w=new e,S=new e,T=[],E=new t,x=new t,P=new e,A=new e,D=new e,I=new a;return f.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,g),u=c.multiplyByPoint(l,e.ZERO,v),h=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_Y,_),_),p=d.fromPointNormal(u,h,y),f=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_X,b),b),m=d.fromPointNormal(u,f,C),T=1;o.push(e.clone(t[0]));for(var E=o[0],x=t.length,P=1;P<x;++P){var A=t[P];if(d.getPointDistance(m,E)<0||d.getPointDistance(m,A)<0){var D=s.lineSegmentPlane(E,A,p,w);if(i(D)){var I=e.multiplyByScalar(h,5e-9,S);d.getPointDistance(p,E)<0&&e.negate(I,I),o.push(e.add(D,I,new e)),a.push(T+1),e.negate(I,I),o.push(e.add(D,I,new e)),T=1}}o.push(e.clone(t[P])),T++,E=A}a.push(T)}return{positions:o,lengths:a}},f.generateArc=function(t){i(t)||(t={});var n=t.positions,a=n.length,s=r(t.ellipsoid,o.WGS84),c=r(t.height,0),d=l(c);if(a<1)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],A);if(0!==(c=d?c[0]:c)){var m=s.geodeticSurfaceNormal(h,P);e.multiplyByScalar(m,c,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var g=t.minDistance;if(!i(g)){var v=r(t.granularity,u.RADIANS_PER_DEGREE);g=u.chordLength(v,s.maximumRadius)}var _,y=0;for(_=0;_<a-1;_++)y+=f.numberOfPoints(n[_],n[_+1],g);var b=3*(y+1),C=new Array(b),w=0;for(_=0;_<a-1;_++){w=p(n[_],n[_+1],g,s,d?c[_]:c,d?c[_+1]:c,C,w)}T.length=0;var S=n[a-1],x=s.cartesianToCartographic(S,E);x.height=d?c[a-1]:c;var D=s.cartographicToCartesian(x,P);return e.pack(D,C,b-3),C},f.generateCartesianArc=function(t){for(var r=f.generateArc(t),i=r.length/3,n=new Array(i),o=0;o<i;o++)n[o]=e.unpack(r,3*o);return n},f}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++){var n=e[i];R=t.cartesianToCartographic(n,R),r[i]=R.height,e[i]=t.scaleToGeodeticSurface(n,n)}return r}function p(e,r,i,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(r===i){for(o=0;o<u;o++)c[o]=r;return c.push(i),c}var d=i-r,h=d/u;for(o=1;o<u;o++){var p=r+o*h;c[o]=p}return c[0]=r,c.push(i),c}function f(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,L),L),u=s.projectPointOntoPlane(t.add(n,i,N),N),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function m(e,r,i,n,o,a,u,c){var h=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;v<c;v++)for(var _=0;_<i.length;_+=3)p=t.fromArray(i,_,p),p=s.multiplyByVector(g,p,p),p=l.multiplyByPoint(F,p,p),n.push(p.x,p.y,p.z);return n}function g(e,r,i,n,o,a,s){for(var l=0;l<e.length;l+=3){n=m(t.fromArray(e,l,W),r,i,n,o,a[l/3],s,1)}return n}function v(e,t){var r=e.length,i=new Array(6*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a;for(var l=1;l<r;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function _(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<r;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,d,h,p,f){var g,v=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,O)),_=o===n.BEVELED?0:Math.ceil(v/a.toRadians(5));g=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),v/(_+1),j),Y):s.fromQuaternion(c.fromAxisAngle(e,v/(_+1),j),Y);var y,b;if(r=t.clone(r,q),_>0)for(var C=f?2:1,w=0;w<_;w++)r=s.multiplyByVector(g,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,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<r;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i},M.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,L),L),l=a.projectPointOntoPlane(t.add(i,r,N),N);return l.x*s.y-l.y*s.x>=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;re<k-1;re++){var ie=s?2:1;K=e[re+1],U=t.subtract(K,Z,U),U=t.normalize(U,U),z=t.add(U,V,z),z=t.normalize(z,z),G=l.geodeticSurfaceNormal(Z,G);var ne=t.multiplyByScalar(G,t.dot(U,G),X);t.subtract(U,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(V,G),Q);t.subtract(V,oe,oe),t.normalize(oe,oe);if(!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7)){z=t.cross(z,G,z),z=t.cross(G,z,z),z=t.normalize(z,z);var ae=1/Math.max(.25,t.magnitude(t.cross(z,V,I))),se=M.angleIsGreaterThanPi(U,V,Z,l);se?(H=t.add(Z,t.multiplyByScalar(z,ae*N,z),H),W=t.add(H,t.multiplyByScalar(q,N,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,N,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,se,l,F,O,$+L,s):(z=t.negate(z,z),F=m(Z,z,O,F,l,$+L,ae,ie)),Y=t.clone(j,Y)):(H=t.add(Z,t.multiplyByScalar(z,ae*N,z),H),W=t.add(H,t.multiplyByScalar(q,-N,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,-N,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,se,l,F,O,$+L,s):F=m(Z,z,O,F,l,$+L,ae,ie),Y=t.clone(j,Y)),V=t.negate(U,V)}else F=m(Y,q,O,F,l,J+L,1,1),Y=Z;J=$,$=c[re+1],Z=K}b[0]=t.clone(Y,b[0]),b[1]=t.clone(Z,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),s&&(B=m(Z,q,R,B,l,$+L,1,1)),k=F.length;var le=s?k+B.length:k,ue=new Float64Array(le);return ue.set(F),s&&ue.set(B,k),ue},M}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,o,a,l,u){var c=e.angleBetween(e.subtract(o,r,p),e.subtract(a,r,f)),d=l===t.BEVELED?1:Math.ceil(c/i.toRadians(5))+1,h=3*d,m=new Array(h);m[h-3]=a.x,m[h-2]=a.y,m[h-1]=a.z;var g;g=u?n.fromQuaternion(s.fromAxisAngle(e.negate(r,p),c/d,A),D):n.fromQuaternion(s.fromAxisAngle(r,c/d,A),D);var v=0;o=e.clone(o,p);for(var _=0;_<d;_++)o=n.multiplyByVector(g,o,o),m[v++]=o.x,m[v++]=o.y,m[v++]=o.z;return m}function u(r){var i=_,n=y,o=b,a=r[1];n=e.fromArray(r[1],a.length-3,n),o=e.fromArray(r[0],0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var s=l(i,n,o,t.ROUNDED,!1),u=r.length-1,c=r[u-1];return a=r[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i),[s,l(i,n,o,t.ROUNDED,!1)]}function c(t,r,i,n){var o=p;return n?o=e.add(t,r,o):(r=e.negate(r,r),o=e.add(t,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function d(t,r,i,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(r,i,p),l=e.negate(s,f),u=0,c=t.length-1,d=0;d<t.length;d+=3){var h=e.fromArray(t,d,m),v=e.add(h,l,g);o[u++]=v.x,o[u++]=v.y,o[u++]=v.z;var _=e.add(h,s,g);a[c--]=_.z,a[c--]=_.y,a[c--]=_.x}return n.push(o,a),n}var h={},p=new e,f=new e,m=new e,g=new e,v=[new e,new e],_=new e,y=new e,b=new e,C=new e,w=new e,S=new e,T=new e,E=new e,x=new e,P=new e,A=new s,D=new n;h.addAttribute=function(e,t,i,n){var o=t.x,a=t.y,s=t.z;r(i)&&(e[i]=o,e[i+1]=a,e[i+2]=s),r(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var I=new e,O=new e;return h.computePositions=function(r){var n=r.granularity,s=r.positions,h=r.ellipsoid,f=r.width/2,m=r.cornerType,g=r.saveAttributes,A=_,D=y,M=b,R=C,L=w,N=S,k=T,F=E,B=x,U=P,V=[],z=g?[]:void 0,G=g?[]:void 0,H=s[0],W=s[1];D=e.normalize(e.subtract(W,H,D),D),A=h.geodeticSurfaceNormal(H,A),R=e.normalize(e.cross(A,D,R),R),g&&(z.push(R.x,R.y,R.z),G.push(A.x,A.y,A.z)),k=e.clone(H,k),H=W,M=e.negate(D,M);var j,q,Y=[],X=s.length;for(q=1;q<X-1;q++){A=h.geodeticSurfaceNormal(H,A),W=s[q+1],D=e.normalize(e.subtract(W,H,D),D),L=e.normalize(e.add(D,M,L),L);var Q=e.multiplyByScalar(A,e.dot(D,A),I);e.subtract(D,Q,Q),e.normalize(Q,Q);var Z=e.multiplyByScalar(A,e.dot(M,A),O);e.subtract(M,Z,Z),e.normalize(Z,Z);if(!i.equalsEpsilon(Math.abs(e.dot(Q,Z)),1,i.EPSILON7)){L=e.cross(L,A,L),L=e.cross(A,L,L),L=e.normalize(L,L);var K=f/Math.max(.25,e.magnitude(e.cross(L,M,p))),J=a.angleIsGreaterThanPi(D,M,H,h);L=e.multiplyByScalar(L,K,L),J?(F=e.add(H,L,F),U=e.add(F,e.multiplyByScalar(R,f,U),U),B=e.add(F,e.multiplyByScalar(R,2*f,B),B),v[0]=e.clone(k,v[0]),v[1]=e.clone(U,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(A.x,A.y,A.z)),N=e.clone(B,N),R=e.normalize(e.cross(A,D,R),R),B=e.add(F,e.multiplyByScalar(R,2*f,B),B),k=e.add(F,e.multiplyByScalar(R,f,k),k),m===t.ROUNDED||m===t.BEVELED?Y.push({leftPositions:l(F,N,B,m,J)}):Y.push({leftPositions:c(H,e.negate(L,L),B,J)})):(B=e.add(H,L,B),U=e.add(B,e.negate(e.multiplyByScalar(R,f,U),U),U),F=e.add(B,e.negate(e.multiplyByScalar(R,2*f,F),F),F),v[0]=e.clone(k,v[0]),v[1]=e.clone(U,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(A.x,A.y,A.z)),N=e.clone(F,N),R=e.normalize(e.cross(A,D,R),R),F=e.add(B,e.negate(e.multiplyByScalar(R,2*f,F),F),F),k=e.add(B,e.negate(e.multiplyByScalar(R,f,k),k),k),m===t.ROUNDED||m===t.BEVELED?Y.push({rightPositions:l(B,N,F,m,J)}):Y.push({rightPositions:c(H,L,F,J)})),M=e.negate(D,M)}H=W}A=h.geodeticSurfaceNormal(H,A),v[0]=e.clone(k,v[0]),v[1]=e.clone(H,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(A.x,A.y,A.z));var $;return m===t.ROUNDED&&($=u(V)),{positions:V,corners:Y,lefts:z,normals:G,endPositions:$}},h}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,n){n=n||2;var o=r&&r.length,a=o?r[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,d,h,p,f,m,g;if(o&&(s=l(e,r,s,n)),e.length>80*n){c=h=e[0],d=p=e[1];for(var v=n;v<a;v+=n)f=e[v],m=e[v+1],f<c&&(c=f),m<d&&(d=m),f>h&&(h=f),m>p&&(p=m);g=Math.max(h-c,p-d)}return i(s,u,n,c,d,g),u}function t(e,t,r,i,n){var o,a;if(n===A(e,t,r,i)>0)for(o=t;o<r;o+=i)a=E(o,e[o],e[o+1],a);else for(o=r-i;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.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,d=f(s,l,t,r,i),h=f(u,c,t,r,i),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!y(n,o)&&b(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),x(i),x(i.next),i=e=o),i=i.next}while(i!==e);return i}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=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<s;a++)l=i[a]*o,d=a<s-1?i[a+1]*o:e.length,h=t(e,l,d,o,!1),h===h.next&&(h.steiner=!0),p.push(m(h));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=r(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=d(e,t)){var i=T(t,e);r(i,i.next)}}function d(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!r)return null;if(n===a)return r.prev;var l,u=r,c=r.x,d=r.y,h=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=c&&g(o<d?n:a,o,c,d,o<d?a:n,o,i.x,i.y)&&((l=Math.abs(o-i.y)/(n-i.x))<h||l===h&&i.x>r.x)&&w(i,e)&&(r=i,h=l),i=i.next;return r}function h(e,t,r,i){var n=e;do{null===n.z&&(n.z=f(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,r,i,n,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,i=r,s=0,t=0;t<u&&(s++,i=i.nextZ);t++);for(l=u;s>0||l>0&&i;)0===s?(n=i,i=i.nextZ,l--):0!==l&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,r,i,n){return e=32767*(e-r)/n,t=32767*(t-i)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,r=e;do{t.x<r.x&&(r=t),t=t.next}while(t!==e);return r}function g(e,t,r,i,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(i-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!C(e,t)&&w(e,t)&&w(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,i){return!!(y(e,t)&&y(r,i)||y(e,i)&&y(r,t))||_(e,t,r)>0!=_(e,t,i)>0&&_(r,i,e)>0!=_(r,i,t)>0}function C(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function w(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function 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;o<r;o+=i)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,r,i){var n=t&&t.length,o=n?t[0]*r:e.length,a=Math.abs(A(e,0,o,r));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(A(e,u,c,r))}var d=0;for(s=0;s<i.length;s+=3){var h=i[s]*r,p=i[s+1]*r,f=i[s+2]*r;d+=Math.abs((e[h]-e[f])*(e[p+1]-e[h+1])-(e[h]-e[p])*(e[f+1]-e[h+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[n][o][a]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),
  440. 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;n<t;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},m.computeWindingOrder2D=function(e){return m.computeArea2D(e)>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(r,i){var n=t.packArray(r);return e(n,i,2)};var g=new r,v=new r,_=new r,y=new r,b=new r,C=new r,w=new r;return m.computeSubdivision=function(e,t,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;h<f;h++){var T=t[h];m[S++]=T.x,m[S++]=T.y,m[S++]=T.z}for(var E=[],x={},P=e.maximumRadius,A=c.chordLength(s,P),D=A*A;p.length>0;){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;d<c;d+=3)r.fromArray(e,d,u),n&&(u=i.scaleToGeodeticSurface(u,u)),0!==t&&(l=i.geodeticSurfaceNormal(u,l),r.multiplyByScalar(l,t,l),r.add(u,l,u)),e[d]=u.x,e[d+1]=u.y,e[d+2]=u.z;return e},m}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}function w(e,t,i,n,o,s){var l=e.normals,u=e.tangents,c=e.bitangents,d=r.normalize(r.cross(i,t,k),k);s.normal&&a.addAttribute(l,t,n,o),s.tangent&&a.addAttribute(u,d,n,o),s.bitangent&&a.addAttribute(c,i,n,o)}function S(e,t,i){var o,s,u,c=e.positions,d=e.corners,h=e.endPositions,v=e.lefts,_=e.normals,y=new f,b=0,C=0,S=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,b+=u,S+=2*u,C+=c[s+1].length-3;for(b+=3,C+=3,s=0;s<d.length;s++){o=d[s];var T=d[s].leftPositions;l(T)?(u=T.length,b+=u,S+=u):(u=d[s].rightPositions.length,C+=u,S+=u)}var E,x=l(h);x&&(E=h[0].length-3,b+=E,C+=E,E/=3,S+=6*E);var P,A,D,L,B,U,V=b+C,z=new Float64Array(V),G=t.normal?new Float32Array(V):void 0,H=t.tangent?new Float32Array(V):void 0,W=t.bitangent?new Float32Array(V):void 0,j={normals:G,tangents:H,bitangents:W},q=0,Y=V-1,X=I,Q=O,Z=E/2,K=m.createTypedArray(V/3,S),J=0;if(x){U=M,B=R;var $=h[0];for(X=r.fromArray(_,0,X),Q=r.fromArray(v,0,Q),s=0;s<Z;s++)U=r.fromArray($,3*(Z-1-s),U),B=r.fromArray($,3*(Z+s),B),a.addAttribute(z,B,q),a.addAttribute(z,U,void 0,Y),w(j,X,Q,q,Y,t),A=q/3,L=A+1,P=(Y-2)/3,D=P-1,K[J++]=P,K[J++]=A,K[J++]=D,K[J++]=D,K[J++]=A,K[J++]=L,q+=3,Y-=3}var ee=0,te=0,re=c[ee++],ie=c[ee++];z.set(re,q),z.set(ie,Y-ie.length+1),Q=r.fromArray(v,te,Q);var ne,oe;for(u=ie.length-3,s=0;s<u;s+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,s,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-s,F),F),X=r.normalize(r.add(ne,oe,X),X),w(j,X,Q,q,Y,t),A=q/3,L=A+1,P=(Y-2)/3,D=P-1,K[J++]=P,K[J++]=A,K[J++]=D,K[J++]=D,K[J++]=A,K[J++]=L,q+=3,Y-=3;for(ne=i.geodeticSurfaceNormal(r.fromArray(re,u,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u,F),F),X=r.normalize(r.add(ne,oe,X),X),te+=3,s=0;s<d.length;s++){var ae;o=d[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,de=N,he=M,pe=R;if(X=r.fromArray(_,te,X),l(ue)){for(w(j,X,Q,void 0,Y,t),Y-=3,se=L,le=D,ae=0;ae<ue.length/3;ae++)de=r.fromArray(ue,3*ae,de),K[J++]=se,K[J++]=le-ae-1,K[J++]=le-ae,a.addAttribute(z,de,void 0,Y),he=r.fromArray(z,3*(le-ae-1),he),pe=r.fromArray(z,3*se,pe),Q=r.normalize(r.subtract(he,pe,Q),Q),w(j,X,Q,void 0,Y,t),Y-=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*le,he),de,he),pe=r.subtract(r.fromArray(z,3*(le-ae),pe),de,pe),Q=r.normalize(r.add(he,pe,Q),Q),w(j,X,Q,q,void 0,t),q+=3}else{for(w(j,X,Q,q,void 0,t),q+=3,se=D,le=L,ae=0;ae<ce.length/3;ae++)de=r.fromArray(ce,3*ae,de),K[J++]=se,K[J++]=le+ae,K[J++]=le+ae+1,a.addAttribute(z,de,q),he=r.fromArray(z,3*se,he),pe=r.fromArray(z,3*(le+ae),pe),Q=r.normalize(r.subtract(he,pe,Q),Q),w(j,X,Q,q,void 0,t),q+=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*(le+ae),he),de,he),pe=r.subtract(r.fromArray(z,3*le,pe),de,pe),Q=r.normalize(r.negate(r.add(pe,he,Q),Q),Q),w(j,X,Q,void 0,Y,t),Y-=3}for(re=c[ee++],ie=c[ee++],re.splice(0,3),ie.splice(ie.length-3,3),z.set(re,q),z.set(ie,Y-ie.length+1),u=ie.length-3,te+=3,Q=r.fromArray(v,te,Q),ae=0;ae<ie.length;ae+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,ae,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-ae,F),F),X=r.normalize(r.add(ne,oe,X),X),w(j,X,Q,q,Y,t),L=q/3,A=L-1,D=(Y-2)/3,P=D+1,K[J++]=P,K[J++]=A,K[J++]=D,K[J++]=D,K[J++]=A,K[J++]=L,q+=3,Y-=3;q-=3,Y+=3}if(X=r.fromArray(_,_.length-3,X),w(j,X,Q,q,Y,t),x){q+=3,Y-=3,U=M,B=R;var fe=h[1];for(s=0;s<Z;s++)U=r.fromArray(fe,3*(E-s-1),U),B=r.fromArray(fe,3*s,B),a.addAttribute(z,U,void 0,Y),a.addAttribute(z,B,q),w(j,X,Q,q,Y,t),L=q/3,A=L-1,D=(Y-2)/3,P=D+1,K[J++]=P,K[J++]=A,K[J++]=D,K[J++]=D,K[J++]=A,K[J++]=L,q+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:z}),t.st){var me,ge,ve=new Float32Array(V/3*2),_e=0;if(x){b/=3,C/=3;var ye=Math.PI/(E+1);ge=1/(b-E+1),me=1/(C-E+1);var be,Ce=E/2;for(s=Ce+1;s<E+1;s++)be=g.PI_OVER_TWO+ye*s,ve[_e++]=me*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=1;s<C-E+1;s++)ve[_e++]=s*me,ve[_e++]=0;for(s=E;s>Ce;s--)be=g.PI_OVER_TWO-s*ye,ve[_e++]=1-me*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=Ce;s>0;s--)be=g.PI_OVER_TWO-ye*s,ve[_e++]=1-ge*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=b-E;s>0;s--)ve[_e++]=s*ge,ve[_e++]=1;for(s=1;s<Ce+1;s++)be=g.PI_OVER_TWO+ye*s,ve[_e++]=ge*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be))}else{for(b/=3,C/=3,ge=1/(b-1),me=1/(C-1),s=0;s<C;s++)ve[_e++]=s*me,ve[_e++]=0;for(s=b;s>0;s--)ve[_e++]=(s-1)*ge,ve[_e++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ve})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.bitangents})),{attributes:y,indices:K}}function 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;s<u;s+=3){var w=C+d;m=r.fromArray(o,s,m),g=r.fromArray(o,s+u,g),v=r.fromArray(o,(s+3)%u,v),g=r.subtract(g,m,g),v=r.subtract(v,m,v),_=r.normalize(r.cross(g,v,_),_),t.normal&&(a.addAttribute(h,_,w),a.addAttribute(h,_,w+3),a.addAttribute(h,_,C),a.addAttribute(h,_,C+3)),(t.tangent||t.bitangent)&&(b=r.fromArray(i,s,b),t.bitangent&&(a.addAttribute(f,b,w),a.addAttribute(f,b,w+3),a.addAttribute(f,b,C),a.addAttribute(f,b,C+3)),t.tangent&&(y=r.normalize(r.cross(b,_,y),y),a.addAttribute(p,y,w),a.addAttribute(p,y,w+3),a.addAttribute(p,y,C),a.addAttribute(p,y,C+3))),C+=6}if(t.normal){for(h.set(i),s=0;s<u;s+=3)h[s+u]=-i[s],h[s+u+1]=-i[s+1],h[s+u+2]=-i[s+2];e.normal.values=h}else e.normal=void 0;if(t.bitangent?(f.set(n),f.set(n,u),e.bitangent.values=f):e.bitangent=void 0,t.tangent){var S=e.tangent.values;p.set(S),p.set(S,u),e.tangent.values=p}}if(t.st){var T=e.st.values,E=new Float32Array(6*c);E.set(T),E.set(T,c);for(var x=2*c,P=0;P<2;P++){for(E[x++]=T[0],E[x++]=T[1],s=2;s<c;s+=2){var A=T[s],D=T[s+1];E[x++]=A,E[x++]=D,E[x++]=A,E[x++]=D}E[x++]=T[0],E[x++]=T[1]}e.st.values=E}return e}function E(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;i<e.length;i+=3){var n=e[i],o=e[i+1],a=e[i+2];r[t++]=n,r[t++]=o,r[t++]=a,r[t++]=n,r[t++]=o,r[t++]=a}return r[t++]=e[0],r[t++]=e[1],r[t++]=e[2],r}function x(e,t){var r=new b({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=a.computePositions(e),s=S(o,r,i),l=e.height,u=e.extrudedHeight,c=s.attributes,d=s.indices,h=c.position.values,f=h.length,g=new Float64Array(6*f),_=new Float64Array(f);_.set(h);var y=new Float64Array(4*f);h=v.scaleToGeodeticHeight(h,l,i),y=E(h,0,y),_=v.scaleToGeodeticHeight(_,u,i),y=E(_,2*f,y),g.set(h),g.set(_,f),g.set(y,2*f),c.position.values=g,c=T(c,t);var C,w=f/3;if(e.shadowVolume){var x=c.normal.values;f=x.length;var P=new Float32Array(6*f);for(C=0;C<f;C++)x[C]=-x[C];P.set(x,f),P=E(x,4*f,P),c.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:P}),t.normal||(c.normal=void 0)}var A=d.length,D=w+w,I=m.createTypedArray(g.length/3,2*A+3*D);I.set(d);var O=A;for(C=0;C<A;C+=3){var M=d[C],R=d[C+1],L=d[C+2];I[O++]=L+w,I[O++]=R+w,I[O++]=M+w}var N,k,F,B;for(C=0;C<D;C+=2)N=C+D,k=N+D,F=N+1,B=k+1,I[O++]=N,I[O++]=k,I[O++]=F,I[O++]=F,I[O++]=k,I[O++]=B;return{attributes:c,indices:I}}function P(e,t,i,n,o,a){var s=r.subtract(t,e,B);r.normalize(s,s);var l=i.geodeticSurfaceNormal(e,U),u=r.cross(s,l,B);r.multiplyByScalar(u,n,u);var c=o.latitude,d=o.longitude,h=a.latitude,p=a.longitude;r.add(e,u,U),i.cartesianToCartographic(U,V);var f=V.latitude,m=V.longitude;c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),r.subtract(e,u,U),i.cartesianToCartographic(U,V),f=V.latitude,m=V.longitude,c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),o.latitude=c,o.longitude=d,a.latitude=h,a.longitude=p}function A(t,i,n,a){t=C(t,i);var s=e(t,r.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;H.latitude=Number.POSITIVE_INFINITY,H.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;var c,d;if(a===o.ROUNDED){var h=s[0];r.subtract(h,s[1],z),r.normalize(z,z),r.multiplyByScalar(z,u,z),r.add(h,z,G),i.cartesianToCartographic(G,V),c=V.latitude,d=V.longitude,H.latitude=Math.min(H.latitude,c),H.longitude=Math.min(H.longitude,d),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,d)}for(var p=0;p<l-1;++p)P(s[p],s[p+1],i,u,H,W);var f=s[l-1];r.subtract(f,s[l-2],z),r.normalize(z,z),r.multiplyByScalar(z,u,z),r.add(f,z,G),P(f,G,i,u,H,W),a===o.ROUNDED&&(i.cartesianToCartographic(G,V),c=V.latitude,d=V.longitude,H.latitude=Math.min(H.latitude,c),H.longitude=Math.min(H.longitude,d),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,d));var m=new y;return m.north=W.latitude,m.south=H.latitude,m.east=W.longitude,m.west=H.longitude,m}function D(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=d.clone(s(e.ellipsoid,d.WGS84)),this._vertexFormat=b.clone(s(e.vertexFormat,b.DEFAULT)),this._width=i,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,g.RADIANS_PER_DEGREE),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=A(t,this._ellipsoid,i,this._cornerType),this.packedLength=1+t.length*r.packedLength+d.packedLength+b.packedLength+y.packedLength+6}var I=new r,O=new r,M=new r,R=new r,L=new r,N=new r,k=new r,F=new r,B=new r,U=new r,V=new i,z=new r,G=new r,H=new i,W=new i;D.pack=function(e,t,i){i=s(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return d.pack(e._ellipsoid,t,i),i+=d.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,y.pack(e._rectangle,t,i),i+=y.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=e._shadowVolume?1:0,t};var j=d.clone(d.UNIT_SPHERE),q=new b,Y=new y,X={positions:void 0,ellipsoid:j,vertexFormat:q,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return D.unpack=function(e,t,i){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var u=d.unpack(e,t,j);t+=d.packedLength;var c=b.unpack(e,t,q);t+=b.packedLength;var h=y.unpack(e,t,Y);t+=y.packedLength;var p=e[t++],f=e[t++],m=e[t++],g=e[t++],v=e[t++],_=1===e[t];return l(i)?(i._positions=o,i._ellipsoid=d.clone(u,i._ellipsoid),i._vertexFormat=b.clone(c,i._vertexFormat),i._width=p,i._height=f,i._extrudedHeight=m,i._cornerType=g,i._granularity=v,i._rectangle=y.clone(h),i._shadowVolume=_,i):(X.positions=o,X.width=p,X.height=f,X.extrudedHeight=m,X.cornerType=g,X.granularity=v,X.shadowVolume=_,new D(X))},D.createGeometry=function(i){var n=i._positions,o=i._height,s=i._width,l=i._extrudedHeight,u=o!==l,c=i._ellipsoid;n=C(n,c);var d=e(n,r.equalsEpsilon);if(!(d.length<2||s<=0)){var p,f=i._vertexFormat,m={ellipsoid:c,positions:d,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};if(u){var g=Math.max(o,l);l=Math.min(o,l),o=g,m.height=o,m.extrudedHeight=l,m.shadowVolume=i._shadowVolume,p=x(m,f)}else{p=S(a.computePositions(m),f,c),p.attributes.position.values=v.scaleToGeodeticHeight(p.attributes.position.values,o,c)}var y=p.attributes,b=t.fromVertices(y.position.values,void 0,3);return f.position||(p.attributes.position.values=void 0),new h({attributes:y,indices:p.indices,primitiveType:_.TRIANGLES,boundingSphere:b})}},D.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new D({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:i,extrudedHeight:o,height:a,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}function _(e,t){var i,s,u,c=[],f=e.positions,m=e.corners,g=e.endPositions,v=new h,_=0,y=0,b=0;for(s=0;s<f.length;s+=2)u=f[s].length-3,_+=u,b+=u/3*4,y+=f[s+1].length-3;for(_+=3,y+=3,s=0;s<m.length;s++){i=m[s];var T=m[s].leftPositions;l(T)?(u=T.length,_+=u,b+=u/3*2):(u=m[s].rightPositions.length,y+=u,b+=u/3*2)}var E,x=l(g);x&&(E=g[0].length-3,_+=E,y+=E,E/=3,b+=4*E);var P,A,D,I,O,M,R=_+y,L=new Float64Array(R),N=0,k=R-1,F=E/2,B=p.createTypedArray(R/3,b+4),U=0;if(B[U++]=N/3,B[U++]=(k-2)/3,x){c.push(N/3),M=C,O=w;var V=g[0];for(s=0;s<F;s++)M=r.fromArray(V,3*(F-1-s),M),O=r.fromArray(V,3*(F+s),O),a.addAttribute(L,O,N),a.addAttribute(L,M,void 0,k),A=N/3,I=A+1,P=(k-2)/3,D=P-1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,N+=3,k-=3}var z=0,G=f[z++],H=f[z++];for(L.set(G,N),L.set(H,k-H.length+1),u=H.length-3,c.push(N/3,(k-2)/3),s=0;s<u;s+=3)A=N/3,I=A+1,P=(k-2)/3,D=P-1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,N+=3,k-=3;for(s=0;s<m.length;s++){var W;i=m[s];var j,q=i.leftPositions,Y=i.rightPositions,X=S;if(l(q)){for(k-=3,j=D,c.push(I),W=0;W<q.length/3;W++)X=r.fromArray(q,3*W,X),B[U++]=j-W-1,B[U++]=j-W,a.addAttribute(L,X,void 0,k),k-=3;c.push(j-Math.floor(q.length/6)),t===o.BEVELED&&c.push((k-2)/3+1),N+=3}else{for(N+=3,j=I,c.push(D),W=0;W<Y.length/3;W++)X=r.fromArray(Y,3*W,X),B[U++]=j+W,B[U++]=j+W+1,a.addAttribute(L,X,N),N+=3;c.push(j+Math.floor(Y.length/6)),t===o.BEVELED&&c.push(N/3-1),k-=3}for(G=f[z++],H=f[z++],G.splice(0,3),H.splice(H.length-3,3),L.set(G,N),L.set(H,k-H.length+1),u=H.length-3,W=0;W<H.length;W+=3)I=N/3,A=I-1,D=(k-2)/3,P=D+1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,N+=3,k-=3;N-=3,k+=3,c.push(N/3,(k-2)/3)}if(x){N+=3,k-=3,M=C,O=w;var Q=g[1];for(s=0;s<F;s++)M=r.fromArray(Q,3*(E-s-1),M),O=r.fromArray(Q,3*s,O),a.addAttribute(L,M,void 0,k),a.addAttribute(L,O,N),I=N/3,A=I-1,D=(k-2)/3,P=D+1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,N+=3,k-=3;c.push(N/3)}else c.push(N/3,(k-2)/3);return B[U++]=N/3,B[U++]=(k-2)/3,v.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:v,indices:B,wallIndices:c}}function y(e){var t=e.ellipsoid,r=a.computePositions(e),i=_(r,e.cornerType),n=i.wallIndices,o=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,d=c.length,h=new Float64Array(d);h.set(c);var f=new Float64Array(2*d);c=m.scaleToGeodeticHeight(c,o,t),h=m.scaleToGeodeticHeight(h,s,t),f.set(c),f.set(h,d),l.position.values=f,d/=3;var g,v=u.length,y=p.createTypedArray(f.length/3,2*(v+n.length));y.set(u);var b=v;for(g=0;g<v;g+=2){var C=u[g],w=u[g+1];y[b++]=C+d,y[b++]=w+d}var S,T;for(g=0;g<n.length;g++)S=n[g],T=S+d,y[b++]=S,y[b++]=T;return{attributes:l,indices:y}}function b(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=u.clone(s(e.ellipsoid,u.WGS84)),this._width=i,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.packedLength+u.packedLength+5}var C=new r,w=new r,S=new r;b.pack=function(e,t,i){i=s(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return u.pack(e._ellipsoid,t,i),i+=u.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i]=e._granularity,t};var T=u.clone(u.UNIT_SPHERE),E={positions:void 0,ellipsoid:T,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return b.unpack=function(e,t,i){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var c=u.unpack(e,t,T);t+=u.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t];return l(i)?(i._positions=o,i._ellipsoid=u.clone(c,i._ellipsoid),i._width=d,i._height=h,i._extrudedHeight=p,i._cornerType=f,i._granularity=m,i):(E.positions=o,E.width=d,E.height=h,E.extrudedHeight=p,E.cornerType=f,E.granularity=m,new b(E))},b.createGeometry=function(i){var n=i._positions,o=i._height,s=i._width,l=i._extrudedHeight,u=o!==l,d=i._ellipsoid;n=v(n,d);var h=e(n,r.equalsEpsilon);if(!(h.length<2||s<=0)){var p,f={ellipsoid:d,positions:h,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!1};if(u){var b=Math.max(o,l);l=Math.min(o,l),o=b,f.height=o,f.extrudedHeight=l,p=y(f)}else{p=_(a.computePositions(f),f.cornerType),p.attributes.position.values=m.scaleToGeodeticHeight(p.attributes.position.values,o,d)}var C=p.attributes,w=t.fromVertices(C.position.values,void 0,3);return new c({attributes:C,indices:p.indices,primitiveType:g.LINES,boundingSphere:w})}},b}),define("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}return e}),define("Core/CullingVolume",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./Intersect","./Plane"],function(e,t,r,i,n,o,a){"use strict";function s(e){this.planes=r(e,[])}var l=[new e,new e,new e];e.clone(e.UNIT_X,l[0]),e.clone(e.UNIT_Y,l[1]),e.clone(e.UNIT_Z,l[2]);var u=new e,c=new e,d=new a(new e(1,0,0),0);return s.fromBoundingSphere=function(r,n){i(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var d=r.center,h=r.radius,p=0,f=0;f<o;++f){var m=l[f],g=a[p],v=a[p+1];i(g)||(g=a[p]=new t),i(v)||(v=a[p+1]=new t),e.multiplyByScalar(m,-h,u),e.add(d,u,u),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-e.dot(m,u),e.multiplyByScalar(m,h,u),e.add(d,u,u),v.x=-m.x,v.y=-m.y,v.z=-m.z,v.w=-e.dot(e.negate(m,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,r=!1,i=0,n=t.length;i<n;++i){var s=e.intersectPlane(a.fromCartesian4(t[i],d));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(r=!0)}return r?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var r=s.MASK_INSIDE,i=this.planes,n=0,l=i.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0==(t&u))){var c=e.intersectPlane(a.fromCartesian4(i[n],d));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(r|=u)}}return r},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),define("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,r,i,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,d=new Float64Array(3*c),h=0,p=0,f=o?3*u:0,m=o?3*(u+n):3*n;for(a=0;a<n;a++){var g=a/n*e.TWO_PI,v=Math.cos(g),_=Math.sin(g),y=v*i,b=_*i,C=v*r,w=_*r;d[p+f]=y,d[p+f+1]=b,d[p+f+2]=l,d[p+m]=C,d[p+m+1]=w,d[p+m+2]=s,p+=3,o&&(d[h++]=y,d[h++]=b,d[h++]=l,d[h++]=C,d[h++]=w,d[h++]=s)}return d},t}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.vertexFormat,f.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=f.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var g=new t,v=new r,_=new r,y=new r,b=new r;m.packedLength=f.packedLength+4,m.pack=function(e,t,r){return r=o(r,0),f.pack(e._vertexFormat,t,r),r+=f.packedLength,t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r]=e._slices,t};var C=new f,w={vertexFormat:C,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return m.unpack=function(e,t,r){t=o(t,0);var i=f.unpack(e,t,C);t+=f.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._vertexFormat=f.clone(i,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=l,r._slices=u,r):(w.length=n,w.topRadius=s,w.bottomRadius=l,w.slices=u,new m(w))},m.createGeometry=function(o){var a=o._length,s=o._topRadius,f=o._bottomRadius,m=o._vertexFormat,C=o._slices;if(!(a<=0||s<0||f<0||0===s&&0===f)){var w,S=C+C,T=C+S,E=S+S,x=n.computePositions(a,s,f,C,!0),P=m.st?new Float32Array(2*E):void 0,A=m.normal?new Float32Array(3*E):void 0,D=m.tangent?new Float32Array(3*E):void 0,I=m.bitangent?new Float32Array(3*E):void 0,O=m.normal||m.tangent||m.bitangent;if(O){var M=m.tangent||m.bitangent,R=0,L=0,N=0,k=v;k.z=0;var F=y,B=_;for(w=0;w<C;w++){var U=w/C*h.TWO_PI,V=Math.cos(U),z=Math.sin(U);O&&(k.x=V,k.y=z,M&&(F=r.normalize(r.cross(r.UNIT_Z,k,F),F)),m.normal&&(A[R++]=V,A[R++]=z,A[R++]=0,A[R++]=V,A[R++]=z,A[R++]=0),m.tangent&&(D[L++]=F.x,D[L++]=F.y,D[L++]=F.z,D[L++]=F.x,D[L++]=F.y,D[L++]=F.z),m.bitangent&&(B=r.normalize(r.cross(k,F,B),B),I[N++]=B.x,I[N++]=B.y,I[N++]=B.z,I[N++]=B.x,I[N++]=B.y,I[N++]=B.z))}for(w=0;w<C;w++)m.normal&&(A[R++]=0,A[R++]=0,A[R++]=-1),m.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),m.bitangent&&(I[N++]=0,I[N++]=-1,I[N++]=0);for(w=0;w<C;w++)m.normal&&(A[R++]=0,A[R++]=0,A[R++]=1),m.tangent&&(D[L++]=1,D[L++]=0,D[L++]=0),m.bitangent&&(I[N++]=0,I[N++]=1,I[N++]=0)}var G=12*C-12,H=d.createTypedArray(E,G),W=0,j=0;for(w=0;w<C-1;w++)H[W++]=j,H[W++]=j+2,H[W++]=j+3,H[W++]=j,H[W++]=j+3,H[W++]=j+1,j+=2;for(H[W++]=S-2,H[W++]=0,H[W++]=1,H[W++]=S-2,H[W++]=1,H[W++]=S-1,w=1;w<C-1;w++)H[W++]=S+w+1,H[W++]=S+w,H[W++]=S;for(w=1;w<C-1;w++)H[W++]=T,H[W++]=T+w,H[W++]=T+w+1;var q=0;if(m.st){var Y=Math.max(s,f);for(w=0;w<E;w++){var X=r.fromArray(x,3*w,b);P[q++]=(X.x+Y)/(2*Y),P[q++]=(X.y+Y)/(2*Y)}}var Q=new c;m.position&&(Q.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})),m.normal&&(Q.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:A})),m.tangent&&(Q.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(Q.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),m.st&&(Q.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:P})),g.x=.5*a,g.y=Math.max(f,s);var Z=new e(r.ZERO,t.magnitude(g));return new l({attributes:Q,indices:H,primitiveType:p.TRIANGLES,boundingSphere:Z})}},m}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=a(e,a.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=a(e.slices,128),o=Math.max(a(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var f=new t;p.packedLength=5,p.pack=function(e,t,r){return r=a(r,0),t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r++]=e._slices,t[r]=e._numberOfVerticalLines,t};var m={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,r){t=a(t,0);var i=e[t++],n=e[t++],o=e[t++],l=e[t++],u=e[t];return s(r)?(r._length=i,r._topRadius=n,r._bottomRadius=o,r._slices=l,r._numberOfVerticalLines=u,r):(m.length=i,m.topRadius=n,m.bottomRadius=o,m.slices=l,m.numberOfVerticalLines=u,new p(m))},p.createGeometry=function(i){var a=i._length,s=i._topRadius,p=i._bottomRadius,m=i._slices,g=i._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var v,_=2*m,y=o.computePositions(a,s,p,m,!1),b=2*m;if(g>0){var C=Math.min(g,m);v=Math.round(m/C),b+=C}var w,S=d.createTypedArray(_,2*b),T=0;for(w=0;w<m-1;w++)S[T++]=w,S[T++]=w+1,S[T++]=w+m,S[T++]=w+1+m;if(S[T++]=m-1,S[T++]=0,S[T++]=m+m-1,S[T++]=m,g>0)for(w=0;w<m;w+=v)S[T++]=w,S[T++]=w+m;var E=new c;E.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y}),f.x=.5*a,f.y=Math.max(p,s);var x=new e(r.ZERO,t.magnitude(f));return new l({attributes:E,indices:S,primitiveType:h.LINES,boundingSphere:x})}},p}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./defined","./RuntimeError"],function(e,t,r){"use strict";function i(e,t){if(i.passThroughDataForTesting)return t;var a=e.byteLength;if(0===a||a%4!=0)throw new r("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(t),l=s.getUint32(0,!0);if(l===n||l===o)return t;for(var u,c=new DataView(e),d=0,h=t.byteLength,p=h-h%8,f=a,m=8;d<p;)for(m=(m+8)%24,u=m;d<p&&u<f;)s.setUint32(d,s.getUint32(d,!0)^c.getUint32(u,!0),!0),s.setUint32(d+4,s.getUint32(d+4,!0)^c.getUint32(u+4,!0),!0),d+=8,u+=24;if(d<h)for(u>=f&&(m=(m+8)%24,u=m);d<h;)s.setUint8(d,s.getUint8(d)^c.getUint8(u)),d++,u++}var n=1953029805,o=2917034100;return i.passThroughDataForTesting=!1,i}),define("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){t(n[r])||(n[r]=!0,console.warn(e(i,r)))}var n={};return i.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",i}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function i(e,t){r(e,t)}return i}),define("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties"],function(e,t,r){"use strict";function i(t,r){t=e(t,0),this._near=t,r=e(r,Number.MAX_VALUE),this._far=r}return r(i.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.far===r.far},i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.near=e.near,r.far=e.far,r},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,r){e=t(e,0),r=t(r,Number.MAX_VALUE),this.value=new Float32Array([e,r])}return i(o.prototype,{componentDatatype:{get:function(){return e.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),o.fromDistanceDisplayCondition=function(e){return new o(e.near,e.far)},o.toValue=function(e,t){return r(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),define("Core/DoublyLinkedList",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function r(){this.head=void 0,this.tail=void 0,this._length=0}function i(e,t,r){this.item=e,this.previous=t,this.next=r}function n(t,r){e(r.previous)&&e(r.next)?(r.previous.next=r.next,r.next.previous=r.previous):e(r.previous)?(r.previous.next=void 0,t.tail=r.previous):e(r.next)?(r.next.previous=void 0,t.head=r.next):(t.head=void 0,t.tail=void 0),r.next=void 0,r.previous=void 0}return t(r.prototype,{length:{get:function(){return this._length}}}),r.prototype.add=function(t){var r=new i(t,this.tail,void 0);return e(this.tail)?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),++this._length,r},r.prototype.remove=function(t){e(t)&&(n(this,t),--this._length)},r.prototype.splice=function(e,t){if(e!==t){n(this,t);var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e}},r}),define("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var r=e.indexOf(t);-1!==r&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();r<e.length;)e[r].update(t)?r++:e.splice(r,1);return!0}}}();return e.Tween=function(t){var r=t,i={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,d=0,h=null,p=e.Easing.Linear.None,f=e.Interpolation.Linear,m=[],g=null,v=!1,_=null,y=null,b=null;for(var C in t)i[C]=parseFloat(t[C],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,v=!1,
  441. h=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),h+=d;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[r[a]].concat(n[a])}i[a]=r[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==b&&b.call(r),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;e<t;e++)m[e].stop()},this.delay=function(e){return d=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return _=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return b=e,this},this.update=function(e){var t;if(e<h)return!0;!1===v&&(null!==g&&g.call(r),v=!0);var u=(e-h)/a;u=u>1?1:u;var b=p(u);for(t in n){var C=i[t]||0,w=n[t];w instanceof Array?r[t]=f(w,b):("string"==typeof w&&(w=C+parseFloat(w,10)),"number"==typeof w&&(r[t]=C+(w-C)*b))}if(null!==_&&_.call(r,b),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var S=o[t];o[t]=n[t],n[t]=S}i[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(r);for(var T=0,E=m.length;T<E;T++)m[T].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},Out:function(e){var t,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return r<0?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(r<0&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):r<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n;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;a<T;a++){var F=h.TWO_PI*a/(T-1);L[a]=w(F),N[a]=S(F),P[k++]=0,P[k++]=0,P[k++]=o.z}for(a=1;a<E-1;a++){var B=Math.PI*a/(E-1),U=S(B),V=o.x*U,z=o.y*U,G=o.z*w(B);for(f=0;f<T;f++)P[k++]=L[f]*V,P[k++]=N[f]*z,P[k++]=G}for(a=0;a<T;a++)P[k++]=0,P[k++]=0,P[k++]=-o.z;var H=new c;C.position&&(H.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:P}));var W=0,j=0,q=0,Y=0;if(C.st||C.normal||C.tangent||C.bitangent){for(a=0;a<x;a++){var X=r.fromArray(P,3*a,g),Q=m.geodeticSurfaceNormal(X,v);if(C.st){var Z=t.negate(Q,b);t.magnitude(Z)<h.EPSILON6&&(k=3*(a+T*Math.floor(.5*E)),k>P.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(a<T||a>x-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;f<T-1;f++)D[k++]=T+f,D[k++]=T+f+1,D[k++]=f+1;var $,ee;for(a=1;a<E-2;a++)for($=a*T,ee=(a+1)*T,f=0;f<T-1;f++)D[k++]=ee+f,D[k++]=ee+f+1,D[k++]=$+f+1,D[k++]=ee+f,D[k++]=$+f+1,D[k++]=$+f;for(a=E-2,$=a*T,ee=(a+1)*T,f=0;f<T-1;f++)D[k++]=ee+f,D[k++]=$+f+1,D[k++]=$+f;return new l({attributes:H,indices:D,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(m)})}},m}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,f),n=Math.round(i(e.stackPartitions,10)),o=Math.round(i(e.slicePartitions,8)),a=Math.round(i(e.subdivisions,128));this._radii=t.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var f=new t(1,1,1),m=Math.cos,g=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,r,n){return n=i(n,0),t.pack(e._radii,r,n),n+=t.packedLength,r[n++]=e._stackPartitions,r[n++]=e._slicePartitions,r[n]=e._subdivisions,r};var v=new t,_={radii:v,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,v);r+=t.packedLength;var s=e[r++],l=e[r++],u=e[r++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(_.stackPartitions=s,_.slicePartitions=l,_.subdivisions=u,new p(_))},p.createGeometry=function(t){var i=t._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var n,o,p,f,v,_,y=a.fromCartesian3(i),b=t._stackPartitions,C=t._slicePartitions,w=t._subdivisions,S=w*(b+C-1),T=S-C+2,E=new Float64Array(3*T),x=c.createTypedArray(T,2*S),P=0,A=new Array(w),D=new Array(w);for(n=0;n<w;n++)p=d.TWO_PI*n/w,A[n]=m(p),D[n]=g(p);for(n=1;n<b;n++)for(f=Math.PI*n/b,v=m(f),_=g(f),o=0;o<w;o++)E[P++]=i.x*A[o]*_,E[P++]=i.y*D[o]*_,E[P++]=i.z*v;for(A.length=C,D.length=C,n=0;n<C;n++)p=d.TWO_PI*n/C,A[n]=m(p),D[n]=g(p);for(E[P++]=0,E[P++]=0,E[P++]=i.z,n=1;n<w;n++)for(f=Math.PI*n/w,v=m(f),_=g(f),o=0;o<C;o++)E[P++]=i.x*A[o]*_,E[P++]=i.y*D[o]*_,E[P++]=i.z*v;for(E[P++]=0,E[P++]=0,E[P++]=-i.z,P=0,n=0;n<b-1;++n){var I=n*w;for(o=0;o<w-1;++o)x[P++]=I+o,x[P++]=I+o+1;x[P++]=I+w-1,x[P++]=I}var O=w*(b-1);for(o=1;o<C+1;++o)x[P++]=O,x[P++]=O+o;for(n=0;n<w-2;++n){var M=n*C+1+O,R=(n+1)*C+1+O;for(o=0;o<C-1;++o)x[P++]=R+o,x[P++]=M+o;x[P++]=R+C-1,x[P++]=M+C-1}var L=E.length/3-1;for(o=L-1;o>L-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<<e)},u.prototype.getTileDataAvailable=function(e,t,r){},u}),define("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function r(){this._removalFunctions=[]}return r.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},r.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;t<r;++t)e[t]();e.length=0},r}),define("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";return e({NONE:0,HOLD:1,EXTRAPOLATE:2})}),define("Core/OrthographicOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Matrix4"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=i(e.near,1),this._near=this.near,this.far=i(e.far,5e8),this._far=this.far,this._cullingVolume=new r,this._orthographicMatrix=new s}function u(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=s.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}o(l.prototype,{projectionMatrix:{get:function(){return u(this),this._orthographicMatrix}}});var c=new e,d=new e,h=new e,p=new e;return l.prototype.computeCullingVolume=function(r,i,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,f=this.left,m=this.near,g=this.far,v=e.cross(i,o,c);e.normalize(v,v);var _=d;e.multiplyByScalar(i,m,_),e.add(r,_,_);var y=h;e.multiplyByScalar(v,f,y),e.add(_,y,y);var b=a[0];return n(b)||(b=a[0]=new t),b.x=v.x,b.y=v.y,b.z=v.z,b.w=-e.dot(v,y),e.multiplyByScalar(v,u,y),e.add(_,y,y),b=a[1],n(b)||(b=a[1]=new t),b.x=-v.x,b.y=-v.y,b.z=-v.z,b.w=-e.dot(e.negate(v,p),y),e.multiplyByScalar(o,l,y),e.add(_,y,y),b=a[2],n(b)||(b=a[2]=new t),b.x=o.x,b.y=o.y,b.z=o.z,b.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(_,y,y),b=a[3],n(b)||(b=a[3]=new t),b.x=-o.x,b.y=-o.y,b.z=-o.z,b.w=-e.dot(e.negate(o,p),y),b=a[4],n(b)||(b=a[4]=new t),b.x=i.x,b.y=i.y,b.z=i.z,b.w=-e.dot(i,_),e.multiplyByScalar(i,g,y),e.add(r,y,y),b=a[5],n(b)||(b=a[5]=new t),b.x=-i.x,b.y=-i.y,b.z=-i.z,b.w=-e.dot(e.negate(i,p),y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,r,i){u(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return i.x=a,i.y=s,i},l.prototype.clone=function(e){return n(e)||(e=new l),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l.prototype.equals=function(e){return n(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l}),define("Core/OrthographicFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./OrthographicOffCenterFrustum"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new o,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far}function s(e){var t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;var r=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=r*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}return a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.width,r[i++]=e.aspectRatio,r[i++]=e.near,r[i]=e.far,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.width=e[i++],n.aspectRatio=e[i++],n.near=e[i++],n.far=e[i],n},i(a.prototype,{projectionMatrix:{get:function(){return s(this),this._offCenterFrustum.projectionMatrix}}}),a.prototype.computeCullingVolume=function(e,t,r){return s(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},a.prototype.getPixelDimensions=function(e,t,r,i){return s(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},a.prototype.clone=function(e){return r(e)||(e=new a),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},a.prototype.equals=function(e){return!!r(e)&&(s(this),s(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))},a}),define("Core/PerspectiveOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Matrix4"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=i(e.near,1),this._near=this.near,this.far=i(e.far,5e8),this._far=this.far,this._cullingVolume=new r,this._perspectiveMatrix=new s,this._infinitePerspective=new s}function u(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,o=e.near,a=e.far;t===e._top&&r===e._bottom&&n===e._left&&i===e._right&&o===e._near&&a===e._far||(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,i,r,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,i,r,t,o,e._infinitePerspective))}o(l.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var c=new e,d=new e,h=new e,p=new e;return l.prototype.computeCullingVolume=function(r,i,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,f=this.left,m=this.near,g=this.far,v=e.cross(i,o,c),_=d;e.multiplyByScalar(i,m,_),e.add(r,_,_);var y=h;e.multiplyByScalar(i,g,y),e.add(r,y,y);var b=p;e.multiplyByScalar(v,f,b),e.add(_,b,b),e.subtract(b,r,b),e.normalize(b,b),e.cross(b,o,b),e.normalize(b,b);var C=a[0];return n(C)||(C=a[0]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(v,u,b),e.add(_,b,b),e.subtract(b,r,b),e.cross(o,b,b),e.normalize(b,b),C=a[1],n(C)||(C=a[1]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(o,l,b),e.add(_,b,b),e.subtract(b,r,b),e.cross(v,b,b),e.normalize(b,b),C=a[2],n(C)||(C=a[2]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(o,s,b),e.add(_,b,b),e.subtract(b,r,b),e.cross(b,v,b),e.normalize(b,b),C=a[3],n(C)||(C=a[3]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),C=a[4],n(C)||(C=a[4]=new t),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-e.dot(i,_),e.negate(i,b),C=a[5],n(C)||(C=a[5]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,r,i){u(this);var n=1/this.near,o=this.top*n,a=2*r*o/t;o=this.right*n;var s=2*r*o/e;return i.x=s,i.y=a,i},l.prototype.clone=function(e){return n(e)||(e=new l),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l.prototype.equals=function(e){return n(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l}),define("Core/PerspectiveFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new o,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far,this.xOffset=t(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=t(e.yOffset,0),this._yOffset=this.yOffset}function s(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return a.packedLength=6,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.fov,r[i++]=e.aspectRatio,r[i++]=e.near,r[i++]=e.far,r[i++]=e.xOffset,r[i]=e.yOffset,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.fov=e[i++],n.aspectRatio=e[i++],n.near=e[i++],n.far=e[i++],n.xOffset=e[i++],n.yOffset=e[i],n},i(a.prototype,{projectionMatrix:{get:function(){return s(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return s(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return s(this),this._fovy}},sseDenominator:{get:function(){return s(this),this._sseDenominator}}}),a.prototype.computeCullingVolume=function(e,t,r){return s(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},a.prototype.getPixelDimensions=function(e,t,r,i){return s(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},a.prototype.clone=function(e){return r(e)||(e=new a),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},a.prototype.equals=function(e){return!!r(e)&&(s(this),s(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))},a}),define("Core/FrustumGeometry",["./BoundingSphere","./Cartesian3","./Cartesian4","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./Matrix3","./Matrix4","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){var r,i,n=e.frustum,a=e.orientation,s=e.origin,l=o(e.vertexFormat,g.DEFAULT),u=o(e._drawNearPlane,!0);n instanceof p?(r=y,i=p.packedLength):n instanceof h&&(r=b,i=h.packedLength),this._frustumType=r,this._frustum=n.clone(),this._origin=t.clone(s),this._orientation=m.clone(a),this._drawNearPlane=u,this._vertexFormat=l,this._workerName="createFrustumGeometry",this.packedLength=2+i+t.packedLength+m.packedLength+g.packedLength}function _(e,t,r,i,n,o,s,l){for(var u=e/3*2,c=0;c<4;++c)a(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),a(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),a(i)&&(i[e]=l.x,i[e+1]=l.y,i[e+2]=l.z),e+=3;n[u]=0,n[u+1]=0,n[u+2]=1,n[u+3]=0,n[u+4]=1,n[u+5]=1,n[u+6]=0,n[u+7]=1}var y=0,b=1;v.pack=function(e,r,i){i=o(i,0);var n=e._frustumType,a=e._frustum;return r[i++]=n,n===y?(p.pack(a,r,i),i+=p.packedLength):(h.pack(a,r,i),i+=h.packedLength),t.pack(e._origin,r,i),i+=t.packedLength,m.pack(e._orientation,r,i),i+=m.packedLength,g.pack(e._vertexFormat,r,i),i+=g.packedLength,r[i]=e._drawNearPlane?1:0,r};var C=new p,w=new h,S=new m,T=new t,E=new g;v.unpack=function(e,r,i){r=o(r,0);var n,s=e[r++];s===y?(n=p.unpack(e,r,C),r+=p.packedLength):(n=h.unpack(e,r,w),r+=h.packedLength);var l=t.unpack(e,r,T);r+=t.packedLength;var u=m.unpack(e,r,S);r+=m.packedLength;var c=g.unpack(e,r,E);r+=g.packedLength;var d=1===e[r];if(!a(i))return new v({frustum:n,origin:l,orientation:u,vertexFormat:c,_drawNearPlane:d});var f=s===i._frustumType?i._frustum:void 0;return i._frustum=n.clone(f),i._frustumType=s,i._origin=t.clone(l,i._origin),i._orientation=m.clone(u,i._orientation),i._vertexFormat=g.clone(c,i._vertexFormat),i._drawNearPlane=d,i};var x=new c,P=new d,A=new d,D=new t,I=new t,O=new t,M=new t,R=new t,L=new t,N=new Array(3),k=new Array(4);k[0]=new r(-1,-1,1,1),k[1]=new r(1,-1,1,1),k[2]=new r(1,1,1,1),k[3]=new r(-1,1,1,1);for(var F=new Array(4),B=0;B<4;++B)F[B]=new r;return v._computeNearFarPlanes=function(e,i,n,s,l,u,h,p){var f=c.fromQuaternion(i,x),m=o(u,D),g=o(h,I),v=o(p,O);m=c.getColumn(f,0,m),g=c.getColumn(f,1,g),v=c.getColumn(f,2,v),t.normalize(m,m),t.normalize(g,g),t.normalize(v,v),t.negate(m,m);var _,b,C=d.computeView(e,v,g,m,P);if(n===y){var w=s.projectionMatrix,S=d.multiply(w,C,A);b=d.inverse(S,A)}else _=d.inverseTransformation(C,A);a(b)?(N[0]=s.near,N[1]=s.far):(N[0]=0,N[1]=s.near,N[2]=s.far);for(var T=0;T<2;++T)for(var E=0;E<4;++E){var M=r.clone(k[E],F[E]);if(a(b)){M=d.multiplyByVector(b,M,M);var R=1/M.w;t.multiplyByScalar(M,R,M),t.subtract(M,e,M),t.normalize(M,M);var L=t.dot(v,M);t.multiplyByScalar(M,N[T]/L,M),t.add(M,e,M)}else{a(s._offCenterFrustum)&&(s=s._offCenterFrustum);var B=N[T],U=N[T+1];M.x=.5*(M.x*(s.right-s.left)+s.left+s.right),M.y=.5*(M.y*(s.top-s.bottom)+s.bottom+s.top),M.z=.5*(M.z*(B-U)-B-U),M.w=1,d.multiplyByVector(_,M,M)}l[12*T+3*E]=M.x,l[12*T+3*E+1]=M.y,l[12*T+3*E+2]=M.z}},v.createGeometry=function(r){var i=r._frustumType,o=r._frustum,c=r._origin,d=r._orientation,h=r._drawNearPlane,p=r._vertexFormat,m=h?6:5,g=new Float64Array(72);v._computeNearFarPlanes(c,d,i,o,g);var y=24;g[y]=g[12],g[y+1]=g[13],g[y+2]=g[14],g[y+3]=g[0],g[y+4]=g[1],g[y+5]=g[2],g[y+6]=g[9],g[y+7]=g[10],g[y+8]=g[11],g[y+9]=g[21],g[y+10]=g[22],g[y+11]=g[23],y+=12,g[y]=g[15],g[y+1]=g[16],g[y+2]=g[17],g[y+3]=g[3],g[y+4]=g[4],g[y+5]=g[5],g[y+6]=g[0],g[y+7]=g[1],g[y+8]=g[2],g[y+9]=g[12],g[y+10]=g[13],g[y+11]=g[14],y+=12,g[y]=g[3],g[y+1]=g[4],g[y+2]=g[5],g[y+3]=g[15],g[y+4]=g[16],g[y+5]=g[17],g[y+6]=g[18],g[y+7]=g[19],g[y+8]=g[20],g[y+9]=g[6],g[y+10]=g[7],g[y+11]=g[8],y+=12,g[y]=g[6],g[y+1]=g[7],g[y+2]=g[8],g[y+3]=g[18],g[y+4]=g[19],g[y+5]=g[20],g[y+6]=g[21],g[y+7]=g[22],g[y+8]=g[23],g[y+9]=g[9],g[y+10]=g[10],g[y+11]=g[11],h||(g=g.subarray(12));var b=new u({position:new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){var C=a(p.normal)?new Float32Array(12*m):void 0,w=a(p.tangent)?new Float32Array(12*m):void 0,S=a(p.bitangent)?new Float32Array(12*m):void 0,T=a(p.st)?new Float32Array(8*m):void 0,E=D,x=I,P=O,A=t.negate(E,M),N=t.negate(x,R),k=t.negate(P,L);y=0,h&&(_(y,C,w,S,T,k,E,x),y+=12),_(y,C,w,S,T,P,A,x),y+=12,_(y,C,w,S,T,A,k,x),y+=12,_(y,C,w,S,T,N,k,A),y+=12,_(y,C,w,S,T,E,P,x),y+=12,_(y,C,w,S,T,x,P,A),a(C)&&(b.normal=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a(w)&&(b.tangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),a(S)&&(b.bitangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),a(T)&&(b.st=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:T}))}for(var F=new Uint16Array(6*m),B=0;B<m;++B){var U=6*B,V=4*B;F[U]=V,F[U+1]=V+1,F[U+2]=V+2,F[U+3]=V,F[U+4]=V+2,F[U+5]=V+3}return new s({attributes:b,indices:F,primitiveType:f.TRIANGLES,boundingSphere:e.fromVertices(g)})},v}),define("Core/FrustumOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartesian4","./Check","./ComponentDatatype","./defaultValue","./defined","./FrustumGeometry","./Geometry","./GeometryAttribute","./GeometryAttributes","./Matrix3","./Matrix4","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){var r,i,n=e.frustum,a=e.orientation,s=e.origin,l=o(e._drawNearPlane,!0);n instanceof f?(r=_,i=f.packedLength):n instanceof p&&(r=y,i=p.packedLength),this._frustumType=r,this._frustum=n.clone(),this._origin=t.clone(s),this._orientation=g.clone(a),this._drawNearPlane=l,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+t.packedLength+g.packedLength}var _=0,y=1;v.pack=function(e,r,i){i=o(i,0);var n=e._frustumType,a=e._frustum;return r[i++]=n,n===_?(f.pack(a,r,i),i+=f.packedLength):(p.pack(a,r,i),i+=p.packedLength),t.pack(e._origin,r,i),i+=t.packedLength,g.pack(e._orientation,r,i),i+=g.packedLength,r[i]=e._drawNearPlane?1:0,r};var b=new f,C=new p,w=new g,S=new t;return v.unpack=function(e,r,i){r=o(r,0);var n,s=e[r++];s===_?(n=f.unpack(e,r,b),r+=f.packedLength):(n=p.unpack(e,r,C),r+=p.packedLength);var l=t.unpack(e,r,S);r+=t.packedLength;var u=g.unpack(e,r,w);r+=g.packedLength;var c=1===e[r];if(!a(i))return new v({frustum:n,origin:l,orientation:u,_drawNearPlane:c});var d=s===i._frustumType?i._frustum:void 0;return i._frustum=n.clone(d),i._frustumType=s,i._origin=t.clone(l,i._origin),i._orientation=g.clone(u,i._orientation),i._drawNearPlane=c,i},v.createGeometry=function(t){var r=t._frustumType,i=t._frustum,o=t._origin,a=t._orientation,d=t._drawNearPlane,h=new Float64Array(24);s._computeNearFarPlanes(o,a,r,i,h);for(var p,f,g=new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:h})}),v=d?2:1,_=new Uint16Array(8*(v+1)),y=d?0:1;y<2;++y)p=d?8*y:0,f=4*y,_[p]=f,_[p+1]=f+1,_[p+2]=f+1,_[p+3]=f+2,_[p+4]=f+2,_[p+5]=f+3,_[p+6]=f+3,_[p+7]=f;for(y=0;y<2;++y)p=8*(v+y),f=4*y,_[p]=f,_[p+1]=f+4,_[p+2]=f+1,_[p+3]=f+5,_[p+4]=f+2,_[p+5]=f+6,_[p+6]=f+3,_[p+7]=f+7;return new l({attributes:g,indices:_,primitiveType:m.LINES,boundingSphere:e.fromVertices(h)})},v}),define("Core/GeocoderService",["./DeveloperError"],function(e){"use strict";function t(){}return t.prototype.geocode=e.throwInstantiationError,t}),define("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return i}),define("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){var n="",o=r.lastIndexOf("/");return-1!==o&&(n=r.substring(0,o+1)),i?(r=new e(r),t(r.query)&&(n+="?"+r.query),t(r.fragment)&&(n+="#"+r.fragment),n):n}return i}),define("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),n=i.lastIndexOf("."),i=-1===n?"":i.substr(n+1)}return i}),define("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/")
  442. ;return-1!==n&&(i=i.substr(n+1)),i}return i}),define("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,i,n){e(i)||(i=t.width),e(n)||(n=t.height);var o=r[i];e(o)||(o={},r[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,i,n),a.getImageData(0,0,i,n).data}var r={};return t}),define("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError","./RuntimeError"],function(e,t,r,i){"use strict";function n(t,r,i){return r=e(r,0),i=e(i,t.byteLength-r),t=t.subarray(r,r+i),n.decode(t)}function o(e,t,r){return t<=e&&e<=r}function a(e){for(var t=0,r=0,n=0,a=128,s=191,l=[],u=e.length,c=0;c<u;++c){var d=e[c];if(0===n){if(o(d,0,127)){l.push(d);continue}if(o(d,194,223)){n=1,t=31&d;continue}if(o(d,224,239)){224===d&&(a=160),237===d&&(s=159),n=2,t=15&d;continue}if(o(d,240,244)){240===d&&(a=144),244===d&&(s=143),n=3,t=7&d;continue}throw new i("String decoding failed.")}o(d,a,s)?(a=128,s=191,t=t<<6|63&d,++r===n&&(l.push(t),t=n=r=0)):(t=n=r=0,a=128,s=191,--c)}return l}return n.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},n.decodeWithFromCharCode=function(e){for(var t="",r=a(e),i=r.length,n=0;n<i;++n){var o=r[n];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>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;i<arguments.length;)r.push(arguments[i++]);var n=!0;return new Promise(function(i,o){r.push(function(e){if(n)if(n=!1,e)o(e);else{for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);i.apply(null,t)}});try{e.apply(t||this,r)}catch(e){n&&(n=!1,o(e))}})}t.exports=i},{}],2:[function(e,t,r){var i=r;i.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(e,t,r){for(var i,o=[],a=0,s=0;t<r;){var l=e[t++];switch(s){case 0:o[a++]=n[l>>2],i=(3&l)<<4,s=1;break;case 1:o[a++]=n[i|l>>4],i=(15&l)<<2,s=2;break;case 2:o[a++]=n[i|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[i],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};i.decode=function(e,t,r){for(var i,n=r,a=0,s=0;s<e.length;){var l=e.charCodeAt(s++);if(61===l&&a>1)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<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},i.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},{}],4:[function(require,module,exports){function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},{}],5:[function(e,t,r){function i(e,t,r){var i=r||8192,n=i>>>1,o=null,a=i;return function(r){if(r<1||r>n)return e(r);a+r>i&&(o=e(i),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=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;i<e.length;++i)r=e.charCodeAt(i),r<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},i.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,o=[],a=0;t<r;)i=e[t++],i<128?o[a++]=i:i>191&&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<e.length;++a)i=e.charCodeAt(a),i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(a+1)))?(i=65536+((1023&i)<<10)+(1023&n),++a,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}},{}],7:[function(e,t,r){function i(){n.Reader._configure(n.BufferReader),n.util._configure()}var n=r;n.build="minimal",n.roots={},n.Writer=e(14),n.BufferWriter=e(15),n.Reader=e(8),n.BufferReader=e(9),n.util=e(13),n.rpc=e(10),n.configure=i,n.Writer._configure(n.BufferWriter),i()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,r){function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new c(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw i(this,8);return new c(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}t.exports=n;var l,u=e(13),c=u.LongBits,d=u.utf8,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")};n.create=u.Buffer?function(e){return(n.create=function(e){return u.Buffer.isBuffer(e)?new l(e):h(e)})(e)}:h,n.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return a(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|a(this.buf,this.pos+=4)};var p="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],e[0]}:function(r,i){return t[0]=r[i+3],t[1]=r[i+2],t[2]=r[i+1],t[3]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=2*(r>>31)+1,n=r>>>23&255,o=8388607&r;return 255===n?o?NaN:i*(1/0):0===n?1.401298464324817e-45*i*o:i*Math.pow(2,n-150)*(o+8388608)};n.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=p(this.buf,this.pos);return this.pos+=4,e};var f="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],t[4]=r[i+4],t[5]=r[i+5],t[6]=r[i+6],t[7]=r[i+7],e[0]}:function(r,i){return t[0]=r[i+7],t[1]=r[i+6],t[2]=r[i+5],t[3]=r[i+4],t[4]=r[i+3],t[5]=r[i+2],t[6]=r[i+1],t[7]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=a(e,t+8),n=2*(i>>31)+1,o=i>>>20&2047,s=4294967296*(1048575&i)+r;return 2047===o?s?NaN:n*(1/0):0===o?5e-324*n*s:n*Math.pow(2,o-1075)*(s+4503599627370496)};n.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=f(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},n.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},n.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n._configure=function(e){l=e;var t=u.Long?"toLong":"toNumber";u.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,r){function i(e){n.call(this,e)}t.exports=i;var n=e(8);(i.prototype=Object.create(n.prototype)).constructor=i;var o=e(13);o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice),i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,r){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<i.length;++n)e[i[n]]!==undefined&&r||(e[i[n]]=t[i[n]]);return e}function n(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}var o=r;o.asPromise=e(1),o.base64=e(2),o.EventEmitter=e(3),o.inquire=e(4),o.utf8=e(6),o.pool=e(5),o.LongBits=e(12),o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=global.dcodeIO&&global.dcodeIO.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=i,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=n,o.ProtocolError=n("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&this[e[r]]!==undefined&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.lazyResolve=function(e,t){for(var r=0;r<t.length;++r)for(var i=Object.keys(t[r]),n=0;n<i.length;++n){for(var o=t[r][i[n]].split("."),a=e;o.length;)a=a[o.shift()];t[r][i[n]]=a}},o.toJSONOptions={longs:String,enums:String,bytes:String},o._configure=function(){var e=o.Buffer;if(!e)return void(o._Buffer_from=o._Buffer_allocUnsafe=null);o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,r){function i(e,t,r){this.fn=e,this.len=t,this.next=undefined,this.val=r}function n(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function a(){this.len=0,this.head=new i(n,0,0),this.tail=this.head,this.states=null}function s(e,t,r){t[r]=255&e}function l(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function u(e,t){this.len=e,this.next=undefined,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r++]=255&e,t[r++]=e>>>8&255,t[r++]=e>>>16&255,t[r]=e>>>24}t.exports=a;var h,p=e(13),f=p.LongBits,m=p.base64,g=p.utf8;a.create=p.Buffer?function(){return(a.create=function(){return new h})()}:function(){return new a},a.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(a.alloc=p.pool(a.alloc,p.Array.prototype.subarray)),a.prototype.push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=l,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this.push(c,10,f.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=f.from(e);return this.push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=f.from(e).zzEncode();return this.push(c,t.length(),t)},a.prototype.bool=function(e){return this.push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this.push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=f.from(e);return this.push(d,4,t.lo).push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64;var v="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n]=t[3]}:function(r,i,n){e[0]=r,i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(1/e>0?0:2147483648,t,r);else if(isNaN(e))d(2147483647,t,r);else if(e>3.4028234663852886e38)d((i<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)d((i<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var n=Math.floor(Math.log(e)/Math.LN2),o=8388607&Math.round(e*Math.pow(2,-n)*8388608);d((i<<31|n+127<<23|o)>>>0,t,r)}};a.prototype.float=function(e){return this.push(v,4,e)};var _="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n++]=t[3],i[n++]=t[4],i[n++]=t[5],i[n++]=t[6],i[n]=t[7]}:function(r,i,n){e[0]=r,i[n++]=t[7],i[n++]=t[6],i[n++]=t[5],i[n++]=t[4],i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(0,t,r),d(1/e>0?0:2147483648,t,r+4);else if(isNaN(e))d(4294967295,t,r),d(2147483647,t,r+4);else if(e>1.7976931348623157e308)d(0,t,r),d((i<<31|2146435072)>>>0,t,r+4);else{var n;if(e<2.2250738585072014e-308)n=e/5e-324,d(n>>>0,t,r),d((i<<31|n/4294967296)>>>0,t,r+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),n=e*Math.pow(2,-o),d(4503599627370496*n>>>0,t,r),d((i<<31|o+1023<<20|1048576*n&1048575)>>>0,t,r+4)}}};a.prototype.double=function(e){return this.push(_,8,e)};var y=p.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};a.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(s,1,0);if(p.isString(e)){var r=a.alloc(t=m.length(e));m.decode(e,r,0),e=r}return this.uint32(t).push(y,t,e)},a.prototype.string=function(e){var t=g.length(e);return t?this.uint32(t).push(g.write,t,e):this.push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new i(n,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(n,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(e){h=e}},{13:13}],15:[function(e,t,r){function i(){o.call(this)}function n(e,t,r){e.length<40?a.utf8.write(e,t,r):t.utf8Write(e,r)}t.exports=i;var o=e(14);(i.prototype=Object.create(o.prototype)).constructor=i;var a=e(13),s=a.Buffer;i.alloc=function(e){return(i.alloc=a._Buffer_allocUnsafe)(e)};var l=s&&s.prototype instanceof Uint8Array&&"set"===s.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]};i.prototype.bytes=function(e){a.isString(e)&&(e=a._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(l,t,e),this},i.prototype.string=function(e){var t=s.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{13:13,14:14}]},{},[7])}("object"==typeof window&&window||"object"==typeof self&&self||this),define("ThirdParty/google-earth-dbroot-parser",["./protobuf-minimal"],function(e){"use strict";var t=e.Reader,r=(e.Writer,e.util),i=[],n=e.roots.default||(e.roots.default={});return n.keyhole=function(){var o={};return o.dbroot=function(){var o={};return o.StringEntryProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.stringValue="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringEntryProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.stringValue=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.stringId)?r.isString(e.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringEntryProto)return e;var t=new n.keyhole.dbroot.StringEntryProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.stringValue&&null!==e.stringValue&&(t.stringValue=String(e.stringValue)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.stringValue=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.stringValue&&null!==e.stringValue&&e.hasOwnProperty("stringValue")&&(r.stringValue=e.stringValue),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.StringIdOrValueProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.value="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringIdOrValueProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.value=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.stringId||r.isInteger(e.stringId)?void 0===e.value||r.isString(e.value)?null:"value: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringIdOrValueProto)return e;var t=new n.keyhole.dbroot.StringIdOrValueProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.value&&null!==e.value&&(t.value=String(e.value)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.value=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.PlanetModelProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.radius=6378.137,i.prototype.flattening=.00335281066474748,i.prototype.elevationBias=0,i.prototype.negativeAltitudeExponentBias=0,i.prototype.compressedNegativeAltitudeThreshold=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PlanetModelProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.radius=e.double();break;case 2:o.flattening=e.double();break;case 4:o.elevationBias=e.double();break;case 5:o.negativeAltitudeExponentBias=e.int32();break;case 6:o.compressedNegativeAltitudeThreshold=e.double();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.radius&&"number"!=typeof e.radius?"radius: number expected":void 0!==e.flattening&&"number"!=typeof e.flattening?"flattening: number expected":void 0!==e.elevationBias&&"number"!=typeof e.elevationBias?"elevationBias: number expected":void 0===e.negativeAltitudeExponentBias||r.isInteger(e.negativeAltitudeExponentBias)?void 0!==e.compressedNegativeAltitudeThreshold&&"number"!=typeof e.compressedNegativeAltitudeThreshold?"compressedNegativeAltitudeThreshold: number expected":null:"negativeAltitudeExponentBias: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetModelProto)return e;var t=new n.keyhole.dbroot.PlanetModelProto;return void 0!==e.radius&&null!==e.radius&&(t.radius=Number(e.radius)),void 0!==e.flattening&&null!==e.flattening&&(t.flattening=Number(e.flattening)),void 0!==e.elevationBias&&null!==e.elevationBias&&(t.elevationBias=Number(e.elevationBias)),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&(t.negativeAltitudeExponentBias=0|e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&(t.compressedNegativeAltitudeThreshold=Number(e.compressedNegativeAltitudeThreshold)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.radius=6378.137,r.flattening=.00335281066474748,r.elevationBias=0,r.negativeAltitudeExponentBias=0,r.compressedNegativeAltitudeThreshold=0),void 0!==e.radius&&null!==e.radius&&e.hasOwnProperty("radius")&&(r.radius=e.radius),void 0!==e.flattening&&null!==e.flattening&&e.hasOwnProperty("flattening")&&(r.flattening=e.flattening),void 0!==e.elevationBias&&null!==e.elevationBias&&e.hasOwnProperty("elevationBias")&&(r.elevationBias=e.elevationBias),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&e.hasOwnProperty("negativeAltitudeExponentBias")&&(r.negativeAltitudeExponentBias=e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&e.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(r.compressedNegativeAltitudeThreshold=e.compressedNegativeAltitudeThreshold),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ProviderInfoProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.providerId=0,o.prototype.copyrightString=null,o.prototype.verticalPixelOffset=-1;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ProviderInfoProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.providerId=e.int32();break;case 2:o.copyrightString=a[1].decode(e,e.uint32());break;case 3:o.verticalPixelOffset=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.copyrightString&&null!==e.copyrightString){var t=a[1].verify(e.copyrightString);if(t)return"copyrightString."+t}return void 0===e.verticalPixelOffset||r.isInteger(e.verticalPixelOffset)?null:"verticalPixelOffset: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ProviderInfoProto)return e;var t=new n.keyhole.dbroot.ProviderInfoProto;if(void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString){if("object"!=typeof e.copyrightString)throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=a[1].fromObject(e.copyrightString)}return void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&(t.verticalPixelOffset=0|e.verticalPixelOffset),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.providerId=0,r.copyrightString=null,r.verticalPixelOffset=-1),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString&&e.hasOwnProperty("copyrightString")&&(r.copyrightString=a[1].toObject(e.copyrightString,t)),void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&e.hasOwnProperty("verticalPixelOffset")&&(r.verticalPixelOffset=e.verticalPixelOffset),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.PopUpProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isBalloonStyle=!1,o.prototype.text=null,o.prototype.backgroundColorAbgr=4294967295,o.prototype.textColorAbgr=4278190080;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PopUpProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isBalloonStyle=e.bool();break;case 2:o.text=a[1].decode(e,e.uint32());break;case 3:o.backgroundColorAbgr=e.fixed32();break;case 4:o.textColorAbgr=e.fixed32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.isBalloonStyle&&"boolean"!=typeof e.isBalloonStyle)return"isBalloonStyle: boolean expected";if(void 0!==e.text&&null!==e.text){var t=a[1].verify(e.text);if(t)return"text."+t}return void 0===e.backgroundColorAbgr||r.isInteger(e.backgroundColorAbgr)?void 0===e.textColorAbgr||r.isInteger(e.textColorAbgr)?null:"textColorAbgr: integer expected":"backgroundColorAbgr: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PopUpProto)return e;var t=new n.keyhole.dbroot.PopUpProto;if(void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&(t.isBalloonStyle=Boolean(e.isBalloonStyle)),void 0!==e.text&&null!==e.text){
  443. if("object"!=typeof e.text)throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=a[1].fromObject(e.text)}return void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&(t.backgroundColorAbgr=e.backgroundColorAbgr>>>0),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&(t.textColorAbgr=e.textColorAbgr>>>0),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isBalloonStyle=!1,r.text=null,r.backgroundColorAbgr=4294967295,r.textColorAbgr=4278190080),void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&e.hasOwnProperty("isBalloonStyle")&&(r.isBalloonStyle=e.isBalloonStyle),void 0!==e.text&&null!==e.text&&e.hasOwnProperty("text")&&(r.text=a[1].toObject(e.text,t)),void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&e.hasOwnProperty("backgroundColorAbgr")&&(r.backgroundColorAbgr=e.backgroundColorAbgr),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&e.hasOwnProperty("textColorAbgr")&&(r.textColorAbgr=e.textColorAbgr),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleAttributeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.styleId="",o.prototype.providerId=0,o.prototype.polyColorAbgr=4294967295,o.prototype.lineColorAbgr=4294967295,o.prototype.lineWidth=1,o.prototype.labelColorAbgr=4294967295,o.prototype.labelScale=1,o.prototype.placemarkIconColorAbgr=4294967295,o.prototype.placemarkIconScale=1,o.prototype.placemarkIconPath=null,o.prototype.placemarkIconX=0,o.prototype.placemarkIconY=0,o.prototype.placemarkIconWidth=32,o.prototype.placemarkIconHeight=32,o.prototype.popUp=null,o.prototype.drawFlag=r.emptyArray;var a={9:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.PopUpProto",15:"keyhole.dbroot.DrawFlagProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleAttributeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.styleId=e.string();break;case 3:o.providerId=e.int32();break;case 4:o.polyColorAbgr=e.fixed32();break;case 5:o.lineColorAbgr=e.fixed32();break;case 6:o.lineWidth=e.float();break;case 7:o.labelColorAbgr=e.fixed32();break;case 8:o.labelScale=e.float();break;case 9:o.placemarkIconColorAbgr=e.fixed32();break;case 10:o.placemarkIconScale=e.float();break;case 11:o.placemarkIconPath=a[9].decode(e,e.uint32());break;case 12:o.placemarkIconX=e.int32();break;case 13:o.placemarkIconY=e.int32();break;case 14:o.placemarkIconWidth=e.int32();break;case 15:o.placemarkIconHeight=e.int32();break;case 16:o.popUp=a[14].decode(e,e.uint32());break;case 17:o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(a[15].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.styleId))return"styleId: string expected";if(void 0!==e.providerId&&!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.polyColorAbgr&&!r.isInteger(e.polyColorAbgr))return"polyColorAbgr: integer expected";if(void 0!==e.lineColorAbgr&&!r.isInteger(e.lineColorAbgr))return"lineColorAbgr: integer expected";if(void 0!==e.lineWidth&&"number"!=typeof e.lineWidth)return"lineWidth: number expected";if(void 0!==e.labelColorAbgr&&!r.isInteger(e.labelColorAbgr))return"labelColorAbgr: integer expected";if(void 0!==e.labelScale&&"number"!=typeof e.labelScale)return"labelScale: number expected";if(void 0!==e.placemarkIconColorAbgr&&!r.isInteger(e.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(void 0!==e.placemarkIconScale&&"number"!=typeof e.placemarkIconScale)return"placemarkIconScale: number expected";if(void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){var t=a[9].verify(e.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(void 0!==e.placemarkIconX&&!r.isInteger(e.placemarkIconX))return"placemarkIconX: integer expected";if(void 0!==e.placemarkIconY&&!r.isInteger(e.placemarkIconY))return"placemarkIconY: integer expected";if(void 0!==e.placemarkIconWidth&&!r.isInteger(e.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(void 0!==e.placemarkIconHeight&&!r.isInteger(e.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(void 0!==e.popUp&&null!==e.popUp){var t=a[14].verify(e.popUp);if(t)return"popUp."+t}if(void 0!==e.drawFlag){if(!Array.isArray(e.drawFlag))return"drawFlag: array expected";for(var i=0;i<e.drawFlag.length;++i){var t=a[15].verify(e.drawFlag[i]);if(t)return"drawFlag."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleAttributeProto)return e;var t=new n.keyhole.dbroot.StyleAttributeProto;if(void 0!==e.styleId&&null!==e.styleId&&(t.styleId=String(e.styleId)),void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&(t.polyColorAbgr=e.polyColorAbgr>>>0),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&(t.lineColorAbgr=e.lineColorAbgr>>>0),void 0!==e.lineWidth&&null!==e.lineWidth&&(t.lineWidth=Number(e.lineWidth)),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&(t.labelColorAbgr=e.labelColorAbgr>>>0),void 0!==e.labelScale&&null!==e.labelScale&&(t.labelScale=Number(e.labelScale)),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&(t.placemarkIconColorAbgr=e.placemarkIconColorAbgr>>>0),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&(t.placemarkIconScale=Number(e.placemarkIconScale)),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){if("object"!=typeof e.placemarkIconPath)throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=a[9].fromObject(e.placemarkIconPath)}if(void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&(t.placemarkIconX=0|e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&(t.placemarkIconY=0|e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&(t.placemarkIconWidth=0|e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&(t.placemarkIconHeight=0|e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp){if("object"!=typeof e.popUp)throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=a[14].fromObject(e.popUp)}if(e.drawFlag){if(!Array.isArray(e.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var r=0;r<e.drawFlag.length;++r){if("object"!=typeof e.drawFlag[r])throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");t.drawFlag[r]=a[15].fromObject(e.drawFlag[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.drawFlag=[]),t.defaults&&(r.styleId="",r.providerId=0,r.polyColorAbgr=4294967295,r.lineColorAbgr=4294967295,r.lineWidth=1,r.labelColorAbgr=4294967295,r.labelScale=1,r.placemarkIconColorAbgr=4294967295,r.placemarkIconScale=1,r.placemarkIconPath=null,r.placemarkIconX=0,r.placemarkIconY=0,r.placemarkIconWidth=32,r.placemarkIconHeight=32,r.popUp=null),void 0!==e.styleId&&null!==e.styleId&&e.hasOwnProperty("styleId")&&(r.styleId=e.styleId),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&e.hasOwnProperty("polyColorAbgr")&&(r.polyColorAbgr=e.polyColorAbgr),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&e.hasOwnProperty("lineColorAbgr")&&(r.lineColorAbgr=e.lineColorAbgr),void 0!==e.lineWidth&&null!==e.lineWidth&&e.hasOwnProperty("lineWidth")&&(r.lineWidth=e.lineWidth),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&e.hasOwnProperty("labelColorAbgr")&&(r.labelColorAbgr=e.labelColorAbgr),void 0!==e.labelScale&&null!==e.labelScale&&e.hasOwnProperty("labelScale")&&(r.labelScale=e.labelScale),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&e.hasOwnProperty("placemarkIconColorAbgr")&&(r.placemarkIconColorAbgr=e.placemarkIconColorAbgr),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&e.hasOwnProperty("placemarkIconScale")&&(r.placemarkIconScale=e.placemarkIconScale),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath&&e.hasOwnProperty("placemarkIconPath")&&(r.placemarkIconPath=a[9].toObject(e.placemarkIconPath,t)),void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&e.hasOwnProperty("placemarkIconX")&&(r.placemarkIconX=e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&e.hasOwnProperty("placemarkIconY")&&(r.placemarkIconY=e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&e.hasOwnProperty("placemarkIconWidth")&&(r.placemarkIconWidth=e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&e.hasOwnProperty("placemarkIconHeight")&&(r.placemarkIconHeight=e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp&&e.hasOwnProperty("popUp")&&(r.popUp=a[14].toObject(e.popUp,t)),void 0!==e.drawFlag&&null!==e.drawFlag&&e.hasOwnProperty("drawFlag")){r.drawFlag=[];for(var i=0;i<e.drawFlag.length;++i)r.drawFlag[i]=a[15].toObject(e.drawFlag[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleMapProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.styleMapId=0,i.prototype.channelId=r.emptyArray,i.prototype.normalStyleAttribute=0,i.prototype.highlightStyleAttribute=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleMapProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.styleMapId=e.int32();break;case 2:if(o.channelId&&o.channelId.length||(o.channelId=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.channelId.push(e.int32());else o.channelId.push(e.int32());break;case 3:o.normalStyleAttribute=e.int32();break;case 4:o.highlightStyleAttribute=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.styleMapId))return"styleMapId: integer expected";if(void 0!==e.channelId){if(!Array.isArray(e.channelId))return"channelId: array expected";for(var t=0;t<e.channelId.length;++t)if(!r.isInteger(e.channelId[t]))return"channelId: integer[] expected"}return void 0===e.normalStyleAttribute||r.isInteger(e.normalStyleAttribute)?void 0===e.highlightStyleAttribute||r.isInteger(e.highlightStyleAttribute)?null:"highlightStyleAttribute: integer expected":"normalStyleAttribute: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleMapProto)return e;var t=new n.keyhole.dbroot.StyleMapProto;if(void 0!==e.styleMapId&&null!==e.styleMapId&&(t.styleMapId=0|e.styleMapId),e.channelId){if(!Array.isArray(e.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");t.channelId=[];for(var r=0;r<e.channelId.length;++r)t.channelId[r]=0|e.channelId[r]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&(t.normalStyleAttribute=0|e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&(t.highlightStyleAttribute=0|e.highlightStyleAttribute),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.channelId=[]),t.defaults&&(r.styleMapId=0,r.normalStyleAttribute=0,r.highlightStyleAttribute=0),void 0!==e.styleMapId&&null!==e.styleMapId&&e.hasOwnProperty("styleMapId")&&(r.styleMapId=e.styleMapId),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")){r.channelId=[];for(var i=0;i<e.channelId.length;++i)r.channelId[i]=e.channelId[i]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&e.hasOwnProperty("normalStyleAttribute")&&(r.normalStyleAttribute=e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&e.hasOwnProperty("highlightStyleAttribute")&&(r.highlightStyleAttribute=e.highlightStyleAttribute),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ZoomRangeProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.minZoom=0,i.prototype.maxZoom=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ZoomRangeProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.minZoom=e.int32();break;case 2:o.maxZoom=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.minZoom)?r.isInteger(e.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ZoomRangeProto)return e;var t=new n.keyhole.dbroot.ZoomRangeProto;return void 0!==e.minZoom&&null!==e.minZoom&&(t.minZoom=0|e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&(t.maxZoom=0|e.maxZoom),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.minZoom=0,r.maxZoom=0),void 0!==e.minZoom&&null!==e.minZoom&&e.hasOwnProperty("minZoom")&&(r.minZoom=e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&e.hasOwnProperty("maxZoom")&&(r.maxZoom=e.maxZoom),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DrawFlagProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.drawFlagType=1;var o={0:"keyhole.dbroot.DrawFlagProto.DrawFlagType"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DrawFlagProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.drawFlagType=e.uint32();break;default:e.skipType(7&a)}}return o},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";switch(e.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DrawFlagProto)return e;var t=new n.keyhole.dbroot.DrawFlagProto;switch(e.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),void 0!==e.drawFlagType&&null!==e.drawFlagType&&e.hasOwnProperty("drawFlagType")&&(r.drawFlagType=t.enums===String?o[0][e.drawFlagType]:e.drawFlagType),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.DrawFlagType=function(){var e={},t=Object.create(e);return t.TYPE_FILL_ONLY=1,t.TYPE_OUTLINE_ONLY=2,t.TYPE_FILL_AND_OUTLINE=3,t.TYPE_ANTIALIASING=4,t.TYPE_CENTER_LABEL=5,t}(),r}(),o.LayerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.zoomRange=r.emptyArray,o.prototype.preserveTextLevel=30,o.prototype.lodBeginTransition=!1,o.prototype.lodEndTransition=!1;var a={0:"keyhole.dbroot.ZoomRangeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LayerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(a[0].decode(e,e.uint32()));break;case 2:o.preserveTextLevel=e.int32();break;case 4:o.lodBeginTransition=e.bool();break;case 5:o.lodEndTransition=e.bool();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.zoomRange){if(!Array.isArray(e.zoomRange))return"zoomRange: array expected";for(var t=0;t<e.zoomRange.length;++t){var i=a[0].verify(e.zoomRange[t]);if(i)return"zoomRange."+i}}return void 0===e.preserveTextLevel||r.isInteger(e.preserveTextLevel)?void 0!==e.lodBeginTransition&&"boolean"!=typeof e.lodBeginTransition?"lodBeginTransition: boolean expected":void 0!==e.lodEndTransition&&"boolean"!=typeof e.lodEndTransition?"lodEndTransition: boolean expected":null:"preserveTextLevel: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LayerProto)return e;var t=new n.keyhole.dbroot.LayerProto;if(e.zoomRange){if(!Array.isArray(e.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");t.zoomRange=[];for(var r=0;r<e.zoomRange.length;++r){if("object"!=typeof e.zoomRange[r])throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");t.zoomRange[r]=a[0].fromObject(e.zoomRange[r])}}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&(t.preserveTextLevel=0|e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&(t.lodBeginTransition=Boolean(e.lodBeginTransition)),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&(t.lodEndTransition=Boolean(e.lodEndTransition)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.zoomRange=[]),t.defaults&&(r.preserveTextLevel=30,r.lodBeginTransition=!1,r.lodEndTransition=!1),void 0!==e.zoomRange&&null!==e.zoomRange&&e.hasOwnProperty("zoomRange")){r.zoomRange=[];for(var i=0;i<e.zoomRange.length;++i)r.zoomRange[i]=a[0].toObject(e.zoomRange[i],t)}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&e.hasOwnProperty("preserveTextLevel")&&(r.preserveTextLevel=e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&e.hasOwnProperty("lodBeginTransition")&&(r.lodBeginTransition=e.lodBeginTransition),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&e.hasOwnProperty("lodEndTransition")&&(r.lodEndTransition=e.lodEndTransition),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.FolderProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.isExpandable=!0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FolderProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.isExpandable=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.isExpandable&&"boolean"!=typeof e.isExpandable?"isExpandable: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FolderProto)return e;var t=new n.keyhole.dbroot.FolderProto;return void 0!==e.isExpandable&&null!==e.isExpandable&&(t.isExpandable=Boolean(e.isExpandable)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isExpandable=!0),void 0!==e.isExpandable&&null!==e.isExpandable&&e.hasOwnProperty("isExpandable")&&(r.isExpandable=e.isExpandable),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.RequirementProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.requiredVram="",i.prototype.requiredClientVer="",i.prototype.probability="",i.prototype.requiredUserAgent="",i.prototype.requiredClientCapabilities="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.RequirementProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 3:o.requiredVram=e.string();break;case 4:o.requiredClientVer=e.string();break;case 5:o.probability=e.string();break;case 6:o.requiredUserAgent=e.string();break;case 7:o.requiredClientCapabilities=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.requiredVram||r.isString(e.requiredVram)?void 0===e.requiredClientVer||r.isString(e.requiredClientVer)?void 0===e.probability||r.isString(e.probability)?void 0===e.requiredUserAgent||r.isString(e.requiredUserAgent)?void 0===e.requiredClientCapabilities||r.isString(e.requiredClientCapabilities)?null:"requiredClientCapabilities: string expected":"requiredUserAgent: string expected":"probability: string expected":"requiredClientVer: string expected":"requiredVram: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.RequirementProto)return e;var t=new n.keyhole.dbroot.RequirementProto;return void 0!==e.requiredVram&&null!==e.requiredVram&&(t.requiredVram=String(e.requiredVram)),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&(t.requiredClientVer=String(e.requiredClientVer)),void 0!==e.probability&&null!==e.probability&&(t.probability=String(e.probability)),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&(t.requiredUserAgent=String(e.requiredUserAgent)),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&(t.requiredClientCapabilities=String(e.requiredClientCapabilities)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.requiredVram="",r.requiredClientVer="",r.probability="",r.requiredUserAgent="",r.requiredClientCapabilities=""),void 0!==e.requiredVram&&null!==e.requiredVram&&e.hasOwnProperty("requiredVram")&&(r.requiredVram=e.requiredVram),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&e.hasOwnProperty("requiredClientVer")&&(r.requiredClientVer=e.requiredClientVer),void 0!==e.probability&&null!==e.probability&&e.hasOwnProperty("probability")&&(r.probability=e.probability),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&e.hasOwnProperty("requiredUserAgent")&&(r.requiredUserAgent=e.requiredUserAgent),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&e.hasOwnProperty("requiredClientCapabilities")&&(r.requiredClientCapabilities=e.requiredClientCapabilities),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.LookAtProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.longitude=0,r.prototype.latitude=0,r.prototype.range=0,r.prototype.tilt=0,r.prototype.heading=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LookAtProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.longitude=e.float();break;case 2:o.latitude=e.float();break;case 3:o.range=e.float();break;case 4:o.tilt=e.float();break;case 5:o.heading=e.float();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.longitude?"longitude: number expected":"number"!=typeof e.latitude?"latitude: number expected":void 0!==e.range&&"number"!=typeof e.range?"range: number expected":void 0!==e.tilt&&"number"!=typeof e.tilt?"tilt: number expected":void 0!==e.heading&&"number"!=typeof e.heading?"heading: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LookAtProto)return e;var t=new n.keyhole.dbroot.LookAtProto;return void 0!==e.longitude&&null!==e.longitude&&(t.longitude=Number(e.longitude)),void 0!==e.latitude&&null!==e.latitude&&(t.latitude=Number(e.latitude)),void 0!==e.range&&null!==e.range&&(t.range=Number(e.range)),void 0!==e.tilt&&null!==e.tilt&&(t.tilt=Number(e.tilt)),void 0!==e.heading&&null!==e.heading&&(t.heading=Number(e.heading)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.longitude=0,r.latitude=0,r.range=0,r.tilt=0,r.heading=0),void 0!==e.longitude&&null!==e.longitude&&e.hasOwnProperty("longitude")&&(r.longitude=e.longitude),void 0!==e.latitude&&null!==e.latitude&&e.hasOwnProperty("latitude")&&(r.latitude=e.latitude),void 0!==e.range&&null!==e.range&&e.hasOwnProperty("range")&&(r.range=e.range),void 0!==e.tilt&&null!==e.tilt&&e.hasOwnProperty("tilt")&&(r.tilt=e.tilt),void 0!==e.heading&&null!==e.heading&&e.hasOwnProperty("heading")&&(r.heading=e.heading),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.NestedFeatureProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.featureType=1,o.prototype.kmlUrl=null,o.prototype.databaseUrl="",o.prototype.layer=null,o.prototype.folder=null,o.prototype.requirement=null,o.prototype.channelId=0,o.prototype.displayName=null,o.prototype.isVisible=!0,o.prototype.isEnabled=!0,o.prototype.isChecked=!1,o.prototype.layerMenuIconPath="icons/773_l.png",o.prototype.description=null,o.prototype.lookAt=null,o.prototype.assetUuid="",o.prototype.isSaveLocked=!0,o.prototype.children=r.emptyArray,o.prototype.clientConfigScriptName="",o.prototype.dioramaDataChannelBase=-1,o.prototype.replicaDataChannelBase=-1;var a={0:"keyhole.dbroot.NestedFeatureProto.FeatureType",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.LayerProto",4:"keyhole.dbroot.FolderProto",5:"keyhole.dbroot.RequirementProto",7:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",13:"keyhole.dbroot.LookAtProto",16:"keyhole.dbroot.NestedFeatureProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.NestedFeatureProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.featureType=e.uint32();break;case 2:o.kmlUrl=a[1].decode(e,e.uint32());break;case 21:o.databaseUrl=e.string();break;case 3:o.layer=a[3].decode(e,e.uint32());break;case 4:o.folder=a[4].decode(e,e.uint32());break;case 5:o.requirement=a[5].decode(e,e.uint32());break;case 6:o.channelId=e.int32();break;case 7:o.displayName=a[7].decode(e,e.uint32());break;case 8:o.isVisible=e.bool();break;case 9:o.isEnabled=e.bool();break;case 10:o.isChecked=e.bool();break;case 11:o.layerMenuIconPath=e.string();break;case 12:o.description=a[12].decode(e,e.uint32());break;case 13:o.lookAt=a[13].decode(e,e.uint32());break;case 15:o.assetUuid=e.string();break;case 16:o.isSaveLocked=e.bool();break;case 17:o.children&&o.children.length||(o.children=[]),o.children.push(a[16].decode(e,e.uint32()));break;case 18:o.clientConfigScriptName=e.string();break;case 19:o.dioramaDataChannelBase=e.int32();break;case 20:o.replicaDataChannelBase=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.featureType)switch(e.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){var t=a[1].verify(e.kmlUrl);if(t)return"kmlUrl."+t}if(void 0!==e.databaseUrl&&!r.isString(e.databaseUrl))return"databaseUrl: string expected";if(void 0!==e.layer&&null!==e.layer){var t=a[3].verify(e.layer);if(t)return"layer."+t}if(void 0!==e.folder&&null!==e.folder){var t=a[4].verify(e.folder);if(t)return"folder."+t}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}if(!r.isInteger(e.channelId))return"channelId: integer expected";if(void 0!==e.displayName&&null!==e.displayName){var t=a[7].verify(e.displayName);if(t)return"displayName."+t}if(void 0!==e.isVisible&&"boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.isEnabled&&"boolean"!=typeof e.isEnabled)return"isEnabled: boolean expected";if(void 0!==e.isChecked&&"boolean"!=typeof e.isChecked)return"isChecked: boolean expected";if(void 0!==e.layerMenuIconPath&&!r.isString(e.layerMenuIconPath))return"layerMenuIconPath: string expected";if(void 0!==e.description&&null!==e.description){var t=a[12].verify(e.description);if(t)return"description."+t}if(void 0!==e.lookAt&&null!==e.lookAt){var t=a[13].verify(e.lookAt);if(t)return"lookAt."+t}if(void 0!==e.assetUuid&&!r.isString(e.assetUuid))return"assetUuid: string expected";if(void 0!==e.isSaveLocked&&"boolean"!=typeof e.isSaveLocked)return"isSaveLocked: boolean expected";if(void 0!==e.children){if(!Array.isArray(e.children))return"children: array expected";for(var i=0;i<e.children.length;++i){var t=a[16].verify(e.children[i]);if(t)return"children."+t}}return void 0===e.clientConfigScriptName||r.isString(e.clientConfigScriptName)?void 0===e.dioramaDataChannelBase||r.isInteger(e.dioramaDataChannelBase)?void 0===e.replicaDataChannelBase||r.isInteger(e.replicaDataChannelBase)?null:"replicaDataChannelBase: integer expected":"dioramaDataChannelBase: integer expected":"clientConfigScriptName: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.NestedFeatureProto)return e;var t=new n.keyhole.dbroot.NestedFeatureProto;switch(e.featureType){case"TYPE_POINT_Z":case 1:t.featureType=1;break;case"TYPE_POLYGON_Z":case 2:t.featureType=2;break;case"TYPE_LINE_Z":case 3:t.featureType=3;break;case"TYPE_TERRAIN":case 4:t.featureType=4}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){if("object"!=typeof e.kmlUrl)throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");t.kmlUrl=a[1].fromObject(e.kmlUrl)}if(void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),void 0!==e.layer&&null!==e.layer){if("object"!=typeof e.layer)throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");t.layer=a[3].fromObject(e.layer)}if(void 0!==e.folder&&null!==e.folder){if("object"!=typeof e.folder)throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");t.folder=a[4].fromObject(e.folder)}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}if(void 0!==e.channelId&&null!==e.channelId&&(t.channelId=0|e.channelId),void 0!==e.displayName&&null!==e.displayName){if("object"!=typeof e.displayName)throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");t.displayName=a[7].fromObject(e.displayName)}if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.isEnabled&&null!==e.isEnabled&&(t.isEnabled=Boolean(e.isEnabled)),void 0!==e.isChecked&&null!==e.isChecked&&(t.isChecked=Boolean(e.isChecked)),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&(t.layerMenuIconPath=String(e.layerMenuIconPath)),void 0!==e.description&&null!==e.description){if("object"!=typeof e.description)throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");t.description=a[12].fromObject(e.description)}if(void 0!==e.lookAt&&null!==e.lookAt){if("object"!=typeof e.lookAt)throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");t.lookAt=a[13].fromObject(e.lookAt)}if(void 0!==e.assetUuid&&null!==e.assetUuid&&(t.assetUuid=String(e.assetUuid)),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&(t.isSaveLocked=Boolean(e.isSaveLocked)),e.children){if(!Array.isArray(e.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");t.children=[];for(var r=0;r<e.children.length;++r){if("object"!=typeof e.children[r])throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");t.children[r]=a[16].fromObject(e.children[r])}}
  444. return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&(t.clientConfigScriptName=String(e.clientConfigScriptName)),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&(t.dioramaDataChannelBase=0|e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&(t.replicaDataChannelBase=0|e.replicaDataChannelBase),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.children=[]),t.defaults&&(r.featureType=t.enums===String?"TYPE_POINT_Z":1,r.kmlUrl=null,r.databaseUrl="",r.layer=null,r.folder=null,r.requirement=null,r.channelId=0,r.displayName=null,r.isVisible=!0,r.isEnabled=!0,r.isChecked=!1,r.layerMenuIconPath="icons/773_l.png",r.description=null,r.lookAt=null,r.assetUuid="",r.isSaveLocked=!0,r.clientConfigScriptName="",r.dioramaDataChannelBase=-1,r.replicaDataChannelBase=-1),void 0!==e.featureType&&null!==e.featureType&&e.hasOwnProperty("featureType")&&(r.featureType=t.enums===String?a[0][e.featureType]:e.featureType),void 0!==e.kmlUrl&&null!==e.kmlUrl&&e.hasOwnProperty("kmlUrl")&&(r.kmlUrl=a[1].toObject(e.kmlUrl,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),void 0!==e.layer&&null!==e.layer&&e.hasOwnProperty("layer")&&(r.layer=a[3].toObject(e.layer,t)),void 0!==e.folder&&null!==e.folder&&e.hasOwnProperty("folder")&&(r.folder=a[4].toObject(e.folder,t)),void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")&&(r.channelId=e.channelId),void 0!==e.displayName&&null!==e.displayName&&e.hasOwnProperty("displayName")&&(r.displayName=a[7].toObject(e.displayName,t)),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.isEnabled&&null!==e.isEnabled&&e.hasOwnProperty("isEnabled")&&(r.isEnabled=e.isEnabled),void 0!==e.isChecked&&null!==e.isChecked&&e.hasOwnProperty("isChecked")&&(r.isChecked=e.isChecked),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&e.hasOwnProperty("layerMenuIconPath")&&(r.layerMenuIconPath=e.layerMenuIconPath),void 0!==e.description&&null!==e.description&&e.hasOwnProperty("description")&&(r.description=a[12].toObject(e.description,t)),void 0!==e.lookAt&&null!==e.lookAt&&e.hasOwnProperty("lookAt")&&(r.lookAt=a[13].toObject(e.lookAt,t)),void 0!==e.assetUuid&&null!==e.assetUuid&&e.hasOwnProperty("assetUuid")&&(r.assetUuid=e.assetUuid),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&e.hasOwnProperty("isSaveLocked")&&(r.isSaveLocked=e.isSaveLocked),void 0!==e.children&&null!==e.children&&e.hasOwnProperty("children")){r.children=[];for(var i=0;i<e.children.length;++i)r.children[i]=a[16].toObject(e.children[i],t)}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&e.hasOwnProperty("clientConfigScriptName")&&(r.clientConfigScriptName=e.clientConfigScriptName),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&e.hasOwnProperty("dioramaDataChannelBase")&&(r.dioramaDataChannelBase=e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&e.hasOwnProperty("replicaDataChannelBase")&&(r.replicaDataChannelBase=e.replicaDataChannelBase),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.FeatureType=function(){var e={},t=Object.create(e);return t.TYPE_POINT_Z=1,t.TYPE_POLYGON_Z=2,t.TYPE_LINE_Z=3,t.TYPE_TERRAIN=4,t}(),o}(),o.MfeDomainFeaturesProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.countryCode="",o.prototype.domainName="",o.prototype.supportedFeatures=r.emptyArray;var a={2:"keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.MfeDomainFeaturesProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.countryCode=e.string();break;case 2:o.domainName=e.string();break;case 3:if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.supportedFeatures.push(e.uint32());else o.supportedFeatures.push(e.uint32());break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.countryCode))return"countryCode: string expected";if(!r.isString(e.domainName))return"domainName: string expected";if(void 0!==e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))return"supportedFeatures: array expected";for(var t=0;t<e.supportedFeatures.length;++t)switch(e.supportedFeatures[t]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.MfeDomainFeaturesProto)return e;var t=new n.keyhole.dbroot.MfeDomainFeaturesProto;if(void 0!==e.countryCode&&null!==e.countryCode&&(t.countryCode=String(e.countryCode)),void 0!==e.domainName&&null!==e.domainName&&(t.domainName=String(e.domainName)),e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");t.supportedFeatures=[];for(var r=0;r<e.supportedFeatures.length;++r)switch(e.supportedFeatures[r]){default:case"GEOCODING":case 0:t.supportedFeatures[r]=0;break;case"LOCAL_SEARCH":case 1:t.supportedFeatures[r]=1;break;case"DRIVING_DIRECTIONS":case 2:t.supportedFeatures[r]=2}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.supportedFeatures=[]),t.defaults&&(r.countryCode="",r.domainName=""),void 0!==e.countryCode&&null!==e.countryCode&&e.hasOwnProperty("countryCode")&&(r.countryCode=e.countryCode),void 0!==e.domainName&&null!==e.domainName&&e.hasOwnProperty("domainName")&&(r.domainName=e.domainName),void 0!==e.supportedFeatures&&null!==e.supportedFeatures&&e.hasOwnProperty("supportedFeatures")){r.supportedFeatures=[];for(var i=0;i<e.supportedFeatures.length;++i)r.supportedFeatures[i]=t.enums===String?a[2][e.supportedFeatures[i]]:e.supportedFeatures[i]}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SupportedFeature=function(){var e={},t=Object.create(e);return t.GEOCODING=0,t.LOCAL_SEARCH=1,t.DRIVING_DIRECTIONS=2,t}(),o}(),o.ClientOptionsProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.disableDiskCache=!1,o.prototype.disableEmbeddedBrowserVista=!1,o.prototype.drawAtmosphere=!0,o.prototype.drawStars=!0,o.prototype.shaderFilePrefix="",o.prototype.useProtobufQuadtreePackets=!1,o.prototype.useExtendedCopyrightIds=!0,o.prototype.precipitationsOptions=null,o.prototype.captureOptions=null,o.prototype.show_2dMapsIcon=!0,o.prototype.disableInternalBrowser=!1,o.prototype.internalBrowserBlacklist="",o.prototype.internalBrowserOriginWhitelist="*",o.prototype.polarTileMergingLevel=0,o.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",o.prototype.mapsOptions=null;var a={7:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions",8:"keyhole.dbroot.ClientOptionsProto.CaptureOptions",15:"keyhole.dbroot.ClientOptionsProto.MapsOptions"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.disableDiskCache=e.bool();break;case 2:o.disableEmbeddedBrowserVista=e.bool();break;case 3:o.drawAtmosphere=e.bool();break;case 4:o.drawStars=e.bool();break;case 5:o.shaderFilePrefix=e.string();break;case 6:o.useProtobufQuadtreePackets=e.bool();break;case 7:o.useExtendedCopyrightIds=e.bool();break;case 8:o.precipitationsOptions=a[7].decode(e,e.uint32());break;case 9:o.captureOptions=a[8].decode(e,e.uint32());break;case 10:o.show_2dMapsIcon=e.bool();break;case 11:o.disableInternalBrowser=e.bool();break;case 12:o.internalBrowserBlacklist=e.string();break;case 13:o.internalBrowserOriginWhitelist=e.string();break;case 14:o.polarTileMergingLevel=e.int32();break;case 15:o.jsBridgeRequestWhitelist=e.string();break;case 16:o.mapsOptions=a[15].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.disableDiskCache&&"boolean"!=typeof e.disableDiskCache)return"disableDiskCache: boolean expected";if(void 0!==e.disableEmbeddedBrowserVista&&"boolean"!=typeof e.disableEmbeddedBrowserVista)return"disableEmbeddedBrowserVista: boolean expected";if(void 0!==e.drawAtmosphere&&"boolean"!=typeof e.drawAtmosphere)return"drawAtmosphere: boolean expected";if(void 0!==e.drawStars&&"boolean"!=typeof e.drawStars)return"drawStars: boolean expected";if(void 0!==e.shaderFilePrefix&&!r.isString(e.shaderFilePrefix))return"shaderFilePrefix: string expected";if(void 0!==e.useProtobufQuadtreePackets&&"boolean"!=typeof e.useProtobufQuadtreePackets)return"useProtobufQuadtreePackets: boolean expected";if(void 0!==e.useExtendedCopyrightIds&&"boolean"!=typeof e.useExtendedCopyrightIds)return"useExtendedCopyrightIds: boolean expected";if(void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){var t=a[7].verify(e.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(void 0!==e.captureOptions&&null!==e.captureOptions){var t=a[8].verify(e.captureOptions);if(t)return"captureOptions."+t}if(void 0!==e.show_2dMapsIcon&&"boolean"!=typeof e.show_2dMapsIcon)return"show_2dMapsIcon: boolean expected";if(void 0!==e.disableInternalBrowser&&"boolean"!=typeof e.disableInternalBrowser)return"disableInternalBrowser: boolean expected";if(void 0!==e.internalBrowserBlacklist&&!r.isString(e.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(void 0!==e.internalBrowserOriginWhitelist&&!r.isString(e.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(void 0!==e.polarTileMergingLevel&&!r.isInteger(e.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(void 0!==e.jsBridgeRequestWhitelist&&!r.isString(e.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(void 0!==e.mapsOptions&&null!==e.mapsOptions){var t=a[15].verify(e.mapsOptions);if(t)return"mapsOptions."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto)return e;var t=new n.keyhole.dbroot.ClientOptionsProto;if(void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&(t.disableDiskCache=Boolean(e.disableDiskCache)),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&(t.disableEmbeddedBrowserVista=Boolean(e.disableEmbeddedBrowserVista)),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&(t.drawAtmosphere=Boolean(e.drawAtmosphere)),void 0!==e.drawStars&&null!==e.drawStars&&(t.drawStars=Boolean(e.drawStars)),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&(t.shaderFilePrefix=String(e.shaderFilePrefix)),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&(t.useProtobufQuadtreePackets=Boolean(e.useProtobufQuadtreePackets)),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&(t.useExtendedCopyrightIds=Boolean(e.useExtendedCopyrightIds)),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){if("object"!=typeof e.precipitationsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=a[7].fromObject(e.precipitationsOptions)}if(void 0!==e.captureOptions&&null!==e.captureOptions){if("object"!=typeof e.captureOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=a[8].fromObject(e.captureOptions)}if(void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&(t.show_2dMapsIcon=Boolean(e.show_2dMapsIcon)),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&(t.disableInternalBrowser=Boolean(e.disableInternalBrowser)),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&(t.internalBrowserBlacklist=String(e.internalBrowserBlacklist)),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&(t.internalBrowserOriginWhitelist=String(e.internalBrowserOriginWhitelist)),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&(t.polarTileMergingLevel=0|e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&(t.jsBridgeRequestWhitelist=String(e.jsBridgeRequestWhitelist)),void 0!==e.mapsOptions&&null!==e.mapsOptions){if("object"!=typeof e.mapsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=a[15].fromObject(e.mapsOptions)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.disableDiskCache=!1,r.disableEmbeddedBrowserVista=!1,r.drawAtmosphere=!0,r.drawStars=!0,r.shaderFilePrefix="",r.useProtobufQuadtreePackets=!1,r.useExtendedCopyrightIds=!0,r.precipitationsOptions=null,r.captureOptions=null,r.show_2dMapsIcon=!0,r.disableInternalBrowser=!1,r.internalBrowserBlacklist="",r.internalBrowserOriginWhitelist="*",r.polarTileMergingLevel=0,r.jsBridgeRequestWhitelist="http://*.google.com/*",r.mapsOptions=null),void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&e.hasOwnProperty("disableDiskCache")&&(r.disableDiskCache=e.disableDiskCache),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&e.hasOwnProperty("disableEmbeddedBrowserVista")&&(r.disableEmbeddedBrowserVista=e.disableEmbeddedBrowserVista),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&e.hasOwnProperty("drawAtmosphere")&&(r.drawAtmosphere=e.drawAtmosphere),void 0!==e.drawStars&&null!==e.drawStars&&e.hasOwnProperty("drawStars")&&(r.drawStars=e.drawStars),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&e.hasOwnProperty("shaderFilePrefix")&&(r.shaderFilePrefix=e.shaderFilePrefix),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&e.hasOwnProperty("useProtobufQuadtreePackets")&&(r.useProtobufQuadtreePackets=e.useProtobufQuadtreePackets),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&e.hasOwnProperty("useExtendedCopyrightIds")&&(r.useExtendedCopyrightIds=e.useExtendedCopyrightIds),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions&&e.hasOwnProperty("precipitationsOptions")&&(r.precipitationsOptions=a[7].toObject(e.precipitationsOptions,t)),void 0!==e.captureOptions&&null!==e.captureOptions&&e.hasOwnProperty("captureOptions")&&(r.captureOptions=a[8].toObject(e.captureOptions,t)),void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&e.hasOwnProperty("show_2dMapsIcon")&&(r.show_2dMapsIcon=e.show_2dMapsIcon),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&e.hasOwnProperty("disableInternalBrowser")&&(r.disableInternalBrowser=e.disableInternalBrowser),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&e.hasOwnProperty("internalBrowserBlacklist")&&(r.internalBrowserBlacklist=e.internalBrowserBlacklist),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&e.hasOwnProperty("internalBrowserOriginWhitelist")&&(r.internalBrowserOriginWhitelist=e.internalBrowserOriginWhitelist),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&e.hasOwnProperty("polarTileMergingLevel")&&(r.polarTileMergingLevel=e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&e.hasOwnProperty("jsBridgeRequestWhitelist")&&(r.jsBridgeRequestWhitelist=e.jsBridgeRequestWhitelist),void 0!==e.mapsOptions&&null!==e.mapsOptions&&e.hasOwnProperty("mapsOptions")&&(r.mapsOptions=a[15].toObject(e.mapsOptions,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.PrecipitationsOptions=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageUrl="",o.prototype.imageExpireTime=900,o.prototype.maxColorDistance=20,o.prototype.imageLevel=5,o.prototype.weatherMapping=r.emptyArray,o.prototype.cloudsLayerUrl="",o.prototype.animationDecelerationDelay=20;var a={4:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageUrl=e.string();break;case 2:o.imageExpireTime=e.int32();break;case 3:o.maxColorDistance=e.int32();break;case 4:o.imageLevel=e.int32();break;case 5:o.weatherMapping&&o.weatherMapping.length||(o.weatherMapping=[]),o.weatherMapping.push(a[4].decode(e,e.uint32()));break;case 6:o.cloudsLayerUrl=e.string();break;case 7:o.animationDecelerationDelay=e.float();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageUrl&&!r.isString(e.imageUrl))return"imageUrl: string expected";if(void 0!==e.imageExpireTime&&!r.isInteger(e.imageExpireTime))return"imageExpireTime: integer expected";if(void 0!==e.maxColorDistance&&!r.isInteger(e.maxColorDistance))return"maxColorDistance: integer expected";if(void 0!==e.imageLevel&&!r.isInteger(e.imageLevel))return"imageLevel: integer expected";if(void 0!==e.weatherMapping){if(!Array.isArray(e.weatherMapping))return"weatherMapping: array expected";for(var t=0;t<e.weatherMapping.length;++t){var i=a[4].verify(e.weatherMapping[t]);if(i)return"weatherMapping."+i}}return void 0===e.cloudsLayerUrl||r.isString(e.cloudsLayerUrl)?void 0!==e.animationDecelerationDelay&&"number"!=typeof e.animationDecelerationDelay?"animationDecelerationDelay: number expected":null:"cloudsLayerUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;if(void 0!==e.imageUrl&&null!==e.imageUrl&&(t.imageUrl=String(e.imageUrl)),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&(t.imageExpireTime=0|e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&(t.maxColorDistance=0|e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&(t.imageLevel=0|e.imageLevel),e.weatherMapping){if(!Array.isArray(e.weatherMapping))throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected");t.weatherMapping=[];for(var r=0;r<e.weatherMapping.length;++r){if("object"!=typeof e.weatherMapping[r])throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected");t.weatherMapping[r]=a[4].fromObject(e.weatherMapping[r])}}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&(t.cloudsLayerUrl=String(e.cloudsLayerUrl)),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&(t.animationDecelerationDelay=Number(e.animationDecelerationDelay)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.weatherMapping=[]),t.defaults&&(r.imageUrl="",r.imageExpireTime=900,r.maxColorDistance=20,r.imageLevel=5,r.cloudsLayerUrl="",r.animationDecelerationDelay=20),void 0!==e.imageUrl&&null!==e.imageUrl&&e.hasOwnProperty("imageUrl")&&(r.imageUrl=e.imageUrl),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&e.hasOwnProperty("imageExpireTime")&&(r.imageExpireTime=e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&e.hasOwnProperty("maxColorDistance")&&(r.maxColorDistance=e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&e.hasOwnProperty("imageLevel")&&(r.imageLevel=e.imageLevel),void 0!==e.weatherMapping&&null!==e.weatherMapping&&e.hasOwnProperty("weatherMapping")){r.weatherMapping=[];for(var i=0;i<e.weatherMapping.length;++i)r.weatherMapping[i]=a[4].toObject(e.weatherMapping[i],t)}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&e.hasOwnProperty("cloudsLayerUrl")&&(r.cloudsLayerUrl=e.cloudsLayerUrl),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&e.hasOwnProperty("animationDecelerationDelay")&&(r.animationDecelerationDelay=e.animationDecelerationDelay),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherMapping=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.colorAbgr=0,o.prototype.weatherType=0,o.prototype.elongation=1,o.prototype.opacity=0,o.prototype.fogDensity=0,o.prototype.speed0=0,o.prototype.speed1=0,o.prototype.speed2=0,o.prototype.speed3=0;var a={1:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.colorAbgr=e.uint32();break;case 2:o.weatherType=e.uint32();break;case 3:o.elongation=e.float();break;case 4:o.opacity=e.float();break;case 5:o.fogDensity=e.float();break;case 6:o.speed0=e.float();break;case 7:o.speed1=e.float();break;case 8:o.speed2=e.float();break;case 9:o.speed3=e.float();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:}return void 0!==e.elongation&&"number"!=typeof e.elongation?"elongation: number expected":void 0!==e.opacity&&"number"!=typeof e.opacity?"opacity: number expected":void 0!==e.fogDensity&&"number"!=typeof e.fogDensity?"fogDensity: number expected":void 0!==e.speed0&&"number"!=typeof e.speed0?"speed0: number expected":void 0!==e.speed1&&"number"!=typeof e.speed1?"speed1: number expected":void 0!==e.speed2&&"number"!=typeof e.speed2?"speed2: number expected":void 0!==e.speed3&&"number"!=typeof e.speed3?"speed3: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(void 0!==e.colorAbgr&&null!==e.colorAbgr&&(t.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:t.weatherType=0;break;case"RAIN":case 1:t.weatherType=1;break;case"SNOW":case 2:t.weatherType=2}return void 0!==e.elongation&&null!==e.elongation&&(t.elongation=Number(e.elongation)),void 0!==e.opacity&&null!==e.opacity&&(t.opacity=Number(e.opacity)),void 0!==e.fogDensity&&null!==e.fogDensity&&(t.fogDensity=Number(e.fogDensity)),void 0!==e.speed0&&null!==e.speed0&&(t.speed0=Number(e.speed0)),void 0!==e.speed1&&null!==e.speed1&&(t.speed1=Number(e.speed1)),void 0!==e.speed2&&null!==e.speed2&&(t.speed2=Number(e.speed2)),void 0!==e.speed3&&null!==e.speed3&&(t.speed3=Number(e.speed3)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.colorAbgr=0,r.weatherType=t.enums===String?"NO_PRECIPITATION":0,r.elongation=1,r.opacity=0,r.fogDensity=0,r.speed0=0,r.speed1=0,r.speed2=0,r.speed3=0),void 0!==e.colorAbgr&&null!==e.colorAbgr&&e.hasOwnProperty("colorAbgr")&&(r.colorAbgr=e.colorAbgr),void 0!==e.weatherType&&null!==e.weatherType&&e.hasOwnProperty("weatherType")&&(r.weatherType=t.enums===String?a[1][e.weatherType]:e.weatherType),void 0!==e.elongation&&null!==e.elongation&&e.hasOwnProperty("elongation")&&(r.elongation=e.elongation),void 0!==e.opacity&&null!==e.opacity&&e.hasOwnProperty("opacity")&&(r.opacity=e.opacity),void 0!==e.fogDensity&&null!==e.fogDensity&&e.hasOwnProperty("fogDensity")&&(r.fogDensity=e.fogDensity),void 0!==e.speed0&&null!==e.speed0&&e.hasOwnProperty("speed0")&&(r.speed0=e.speed0),void 0!==e.speed1&&null!==e.speed1&&e.hasOwnProperty("speed1")&&(r.speed1=e.speed1),void 0!==e.speed2&&null!==e.speed2&&e.hasOwnProperty("speed2")&&(r.speed2=e.speed2),void 0!==e.speed3&&null!==e.speed3&&e.hasOwnProperty("speed3")&&(r.speed3=e.speed3),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherType=function(){var e={},t=Object.create(e);return t.NO_PRECIPITATION=0,t.RAIN=1,t.SNOW=2,t}(),o}(),o}(),o.CaptureOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.allowSaveAsImage=!0,i.prototype.maxFreeCaptureRes=2400,i.prototype.maxPremiumCaptureRes=4800,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.allowSaveAsImage=e.bool();break;case 2:o.maxFreeCaptureRes=e.int32();break;case 3:o.maxPremiumCaptureRes=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.allowSaveAsImage&&"boolean"!=typeof e.allowSaveAsImage?"allowSaveAsImage: boolean expected":void 0===e.maxFreeCaptureRes||r.isInteger(e.maxFreeCaptureRes)?void 0===e.maxPremiumCaptureRes||r.isInteger(e.maxPremiumCaptureRes)?null:"maxPremiumCaptureRes: integer expected":"maxFreeCaptureRes: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&(t.allowSaveAsImage=Boolean(e.allowSaveAsImage)),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&(t.maxFreeCaptureRes=0|e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&(t.maxPremiumCaptureRes=0|e.maxPremiumCaptureRes),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.allowSaveAsImage=!0,r.maxFreeCaptureRes=2400,r.maxPremiumCaptureRes=4800),void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&e.hasOwnProperty("allowSaveAsImage")&&(r.allowSaveAsImage=e.allowSaveAsImage),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&e.hasOwnProperty("maxFreeCaptureRes")&&(r.maxFreeCaptureRes=e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&e.hasOwnProperty("maxPremiumCaptureRes")&&(r.maxPremiumCaptureRes=e.maxPremiumCaptureRes),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.MapsOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.enableMaps=!1,i.prototype.docsAutoDownloadEnabled=!1,i.prototype.docsAutoDownloadInterval=0,i.prototype.docsAutoUploadEnabled=!1,i.prototype.docsAutoUploadDelay=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.enableMaps=e.bool();break;case 2:o.docsAutoDownloadEnabled=e.bool();break;case 3:o.docsAutoDownloadInterval=e.int32();break;case 4:o.docsAutoUploadEnabled=e.bool();break;case 5:o.docsAutoUploadDelay=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.enableMaps&&"boolean"!=typeof e.enableMaps?"enableMaps: boolean expected":void 0!==e.docsAutoDownloadEnabled&&"boolean"!=typeof e.docsAutoDownloadEnabled?"docsAutoDownloadEnabled: boolean expected":void 0===e.docsAutoDownloadInterval||r.isInteger(e.docsAutoDownloadInterval)?void 0!==e.docsAutoUploadEnabled&&"boolean"!=typeof e.docsAutoUploadEnabled?"docsAutoUploadEnabled: boolean expected":void 0===e.docsAutoUploadDelay||r.isInteger(e.docsAutoUploadDelay)?null:"docsAutoUploadDelay: integer expected":"docsAutoDownloadInterval: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return void 0!==e.enableMaps&&null!==e.enableMaps&&(t.enableMaps=Boolean(e.enableMaps)),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&(t.docsAutoDownloadEnabled=Boolean(e.docsAutoDownloadEnabled)),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&(t.docsAutoDownloadInterval=0|e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&(t.docsAutoUploadEnabled=Boolean(e.docsAutoUploadEnabled)),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&(t.docsAutoUploadDelay=0|e.docsAutoUploadDelay),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.enableMaps=!1,r.docsAutoDownloadEnabled=!1,r.docsAutoDownloadInterval=0,r.docsAutoUploadEnabled=!1,r.docsAutoUploadDelay=0),void 0!==e.enableMaps&&null!==e.enableMaps&&e.hasOwnProperty("enableMaps")&&(r.enableMaps=e.enableMaps),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&e.hasOwnProperty("docsAutoDownloadEnabled")&&(r.docsAutoDownloadEnabled=e.docsAutoDownloadEnabled),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&e.hasOwnProperty("docsAutoDownloadInterval")&&(r.docsAutoDownloadInterval=e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&e.hasOwnProperty("docsAutoUploadEnabled")&&(r.docsAutoUploadEnabled=e.docsAutoUploadEnabled),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&e.hasOwnProperty("docsAutoUploadDelay")&&(r.docsAutoUploadDelay=e.docsAutoUploadDelay),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o}(),o.FetchingOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.maxRequestsPerQuery=1,i.prototype.forceMaxRequestsPerQuery=!1,i.prototype.sortBatches=!1,i.prototype.maxDrawable=2,i.prototype.maxImagery=2,i.prototype.maxTerrain=5,i.prototype.maxQuadtree=5,i.prototype.maxDioramaMetadata=1,i.prototype.maxDioramaData=0,i.prototype.maxConsumerFetchRatio=1,i.prototype.maxProEcFetchRatio=0,i.prototype.safeOverallQps=0,i.prototype.safeImageryQps=0,i.prototype.domainsForHttps="google.com gstatic.com",i.prototype.hostsForHttp="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FetchingOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.maxRequestsPerQuery=e.int32();break;case 12:o.forceMaxRequestsPerQuery=e.bool();break;case 13:o.sortBatches=e.bool();break;case 2:o.maxDrawable=e.int32();break;case 3:o.maxImagery=e.int32();break;case 4:o.maxTerrain=e.int32();break;case 5:o.maxQuadtree=e.int32();break;case 6:o.maxDioramaMetadata=e.int32();break;case 7:o.maxDioramaData=e.int32();break;case 8:o.maxConsumerFetchRatio=e.float();break;case 9:o.maxProEcFetchRatio=e.float();break;case 10:o.safeOverallQps=e.float();break;case 11:o.safeImageryQps=e.float();break;case 14:o.domainsForHttps=e.string();break;case 15:o.hostsForHttp=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){
  445. return"object"!=typeof e||null===e?"object expected":void 0===e.maxRequestsPerQuery||r.isInteger(e.maxRequestsPerQuery)?void 0!==e.forceMaxRequestsPerQuery&&"boolean"!=typeof e.forceMaxRequestsPerQuery?"forceMaxRequestsPerQuery: boolean expected":void 0!==e.sortBatches&&"boolean"!=typeof e.sortBatches?"sortBatches: boolean expected":void 0===e.maxDrawable||r.isInteger(e.maxDrawable)?void 0===e.maxImagery||r.isInteger(e.maxImagery)?void 0===e.maxTerrain||r.isInteger(e.maxTerrain)?void 0===e.maxQuadtree||r.isInteger(e.maxQuadtree)?void 0===e.maxDioramaMetadata||r.isInteger(e.maxDioramaMetadata)?void 0===e.maxDioramaData||r.isInteger(e.maxDioramaData)?void 0!==e.maxConsumerFetchRatio&&"number"!=typeof e.maxConsumerFetchRatio?"maxConsumerFetchRatio: number expected":void 0!==e.maxProEcFetchRatio&&"number"!=typeof e.maxProEcFetchRatio?"maxProEcFetchRatio: number expected":void 0!==e.safeOverallQps&&"number"!=typeof e.safeOverallQps?"safeOverallQps: number expected":void 0!==e.safeImageryQps&&"number"!=typeof e.safeImageryQps?"safeImageryQps: number expected":void 0===e.domainsForHttps||r.isString(e.domainsForHttps)?void 0===e.hostsForHttp||r.isString(e.hostsForHttp)?null:"hostsForHttp: string expected":"domainsForHttps: string expected":"maxDioramaData: integer expected":"maxDioramaMetadata: integer expected":"maxQuadtree: integer expected":"maxTerrain: integer expected":"maxImagery: integer expected":"maxDrawable: integer expected":"maxRequestsPerQuery: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FetchingOptionsProto)return e;var t=new n.keyhole.dbroot.FetchingOptionsProto;return void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&(t.maxRequestsPerQuery=0|e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&(t.forceMaxRequestsPerQuery=Boolean(e.forceMaxRequestsPerQuery)),void 0!==e.sortBatches&&null!==e.sortBatches&&(t.sortBatches=Boolean(e.sortBatches)),void 0!==e.maxDrawable&&null!==e.maxDrawable&&(t.maxDrawable=0|e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&(t.maxImagery=0|e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&(t.maxTerrain=0|e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&(t.maxQuadtree=0|e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&(t.maxDioramaMetadata=0|e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&(t.maxDioramaData=0|e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&(t.maxConsumerFetchRatio=Number(e.maxConsumerFetchRatio)),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&(t.maxProEcFetchRatio=Number(e.maxProEcFetchRatio)),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&(t.safeOverallQps=Number(e.safeOverallQps)),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&(t.safeImageryQps=Number(e.safeImageryQps)),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&(t.domainsForHttps=String(e.domainsForHttps)),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&(t.hostsForHttp=String(e.hostsForHttp)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.maxRequestsPerQuery=1,r.forceMaxRequestsPerQuery=!1,r.sortBatches=!1,r.maxDrawable=2,r.maxImagery=2,r.maxTerrain=5,r.maxQuadtree=5,r.maxDioramaMetadata=1,r.maxDioramaData=0,r.maxConsumerFetchRatio=1,r.maxProEcFetchRatio=0,r.safeOverallQps=0,r.safeImageryQps=0,r.domainsForHttps="google.com gstatic.com",r.hostsForHttp=""),void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&e.hasOwnProperty("maxRequestsPerQuery")&&(r.maxRequestsPerQuery=e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&e.hasOwnProperty("forceMaxRequestsPerQuery")&&(r.forceMaxRequestsPerQuery=e.forceMaxRequestsPerQuery),void 0!==e.sortBatches&&null!==e.sortBatches&&e.hasOwnProperty("sortBatches")&&(r.sortBatches=e.sortBatches),void 0!==e.maxDrawable&&null!==e.maxDrawable&&e.hasOwnProperty("maxDrawable")&&(r.maxDrawable=e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&e.hasOwnProperty("maxImagery")&&(r.maxImagery=e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&e.hasOwnProperty("maxTerrain")&&(r.maxTerrain=e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&e.hasOwnProperty("maxQuadtree")&&(r.maxQuadtree=e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&e.hasOwnProperty("maxDioramaMetadata")&&(r.maxDioramaMetadata=e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&e.hasOwnProperty("maxDioramaData")&&(r.maxDioramaData=e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&e.hasOwnProperty("maxConsumerFetchRatio")&&(r.maxConsumerFetchRatio=e.maxConsumerFetchRatio),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&e.hasOwnProperty("maxProEcFetchRatio")&&(r.maxProEcFetchRatio=e.maxProEcFetchRatio),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&e.hasOwnProperty("safeOverallQps")&&(r.safeOverallQps=e.safeOverallQps),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&e.hasOwnProperty("safeImageryQps")&&(r.safeImageryQps=e.safeImageryQps),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&e.hasOwnProperty("domainsForHttps")&&(r.domainsForHttps=e.domainsForHttps),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&e.hasOwnProperty("hostsForHttp")&&(r.hostsForHttp=e.hostsForHttp),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.TimeMachineOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.serverUrl="",i.prototype.isTimemachine=!1,i.prototype.dwellTimeMs=500,i.prototype.discoverabilityAltitudeMeters=15e3,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.TimeMachineOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.serverUrl=e.string();break;case 2:o.isTimemachine=e.bool();break;case 3:o.dwellTimeMs=e.int32();break;case 4:o.discoverabilityAltitudeMeters=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.serverUrl||r.isString(e.serverUrl)?void 0!==e.isTimemachine&&"boolean"!=typeof e.isTimemachine?"isTimemachine: boolean expected":void 0===e.dwellTimeMs||r.isInteger(e.dwellTimeMs)?void 0===e.discoverabilityAltitudeMeters||r.isInteger(e.discoverabilityAltitudeMeters)?null:"discoverabilityAltitudeMeters: integer expected":"dwellTimeMs: integer expected":"serverUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return e;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return void 0!==e.serverUrl&&null!==e.serverUrl&&(t.serverUrl=String(e.serverUrl)),void 0!==e.isTimemachine&&null!==e.isTimemachine&&(t.isTimemachine=Boolean(e.isTimemachine)),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&(t.dwellTimeMs=0|e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&(t.discoverabilityAltitudeMeters=0|e.discoverabilityAltitudeMeters),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverUrl="",r.isTimemachine=!1,r.dwellTimeMs=500,r.discoverabilityAltitudeMeters=15e3),void 0!==e.serverUrl&&null!==e.serverUrl&&e.hasOwnProperty("serverUrl")&&(r.serverUrl=e.serverUrl),void 0!==e.isTimemachine&&null!==e.isTimemachine&&e.hasOwnProperty("isTimemachine")&&(r.isTimemachine=e.isTimemachine),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&e.hasOwnProperty("dwellTimeMs")&&(r.dwellTimeMs=e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&e.hasOwnProperty("discoverabilityAltitudeMeters")&&(r.discoverabilityAltitudeMeters=e.discoverabilityAltitudeMeters),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.AutopiaOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.metadataServerUrl="http://cbk0.google.com/cbk",i.prototype.depthmapServerUrl="http://cbk0.google.com/cbk",i.prototype.coverageOverlayUrl="",i.prototype.maxImageryQps=0,i.prototype.maxMetadataDepthmapQps=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.AutopiaOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.metadataServerUrl=e.string();break;case 2:o.depthmapServerUrl=e.string();break;case 3:o.coverageOverlayUrl=e.string();break;case 4:o.maxImageryQps=e.float();break;case 5:o.maxMetadataDepthmapQps=e.float();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.metadataServerUrl||r.isString(e.metadataServerUrl)?void 0===e.depthmapServerUrl||r.isString(e.depthmapServerUrl)?void 0===e.coverageOverlayUrl||r.isString(e.coverageOverlayUrl)?void 0!==e.maxImageryQps&&"number"!=typeof e.maxImageryQps?"maxImageryQps: number expected":void 0!==e.maxMetadataDepthmapQps&&"number"!=typeof e.maxMetadataDepthmapQps?"maxMetadataDepthmapQps: number expected":null:"coverageOverlayUrl: string expected":"depthmapServerUrl: string expected":"metadataServerUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.AutopiaOptionsProto)return e;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&(t.metadataServerUrl=String(e.metadataServerUrl)),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&(t.depthmapServerUrl=String(e.depthmapServerUrl)),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&(t.coverageOverlayUrl=String(e.coverageOverlayUrl)),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&(t.maxImageryQps=Number(e.maxImageryQps)),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&(t.maxMetadataDepthmapQps=Number(e.maxMetadataDepthmapQps)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.metadataServerUrl="http://cbk0.google.com/cbk",r.depthmapServerUrl="http://cbk0.google.com/cbk",r.coverageOverlayUrl="",r.maxImageryQps=0,r.maxMetadataDepthmapQps=0),void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&e.hasOwnProperty("metadataServerUrl")&&(r.metadataServerUrl=e.metadataServerUrl),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&e.hasOwnProperty("depthmapServerUrl")&&(r.depthmapServerUrl=e.depthmapServerUrl),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&e.hasOwnProperty("coverageOverlayUrl")&&(r.coverageOverlayUrl=e.coverageOverlayUrl),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&e.hasOwnProperty("maxImageryQps")&&(r.maxImageryQps=e.maxImageryQps),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&e.hasOwnProperty("maxMetadataDepthmapQps")&&(r.maxMetadataDepthmapQps=e.maxMetadataDepthmapQps),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.CSIOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.samplingPercentage=0,i.prototype.experimentId="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CSIOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.samplingPercentage=e.int32();break;case 2:o.experimentId=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.samplingPercentage||r.isInteger(e.samplingPercentage)?void 0===e.experimentId||r.isString(e.experimentId)?null:"experimentId: string expected":"samplingPercentage: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CSIOptionsProto)return e;var t=new n.keyhole.dbroot.CSIOptionsProto;return void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&(t.samplingPercentage=0|e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&(t.experimentId=String(e.experimentId)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.samplingPercentage=0,r.experimentId=""),void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&e.hasOwnProperty("samplingPercentage")&&(r.samplingPercentage=e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&e.hasOwnProperty("experimentId")&&(r.experimentId=e.experimentId),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SearchTabProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isVisible=!1,o.prototype.tabLabel=null,o.prototype.baseUrl="",o.prototype.viewportPrefix="",o.prototype.inputBox=r.emptyArray,o.prototype.requirement=null;var a={1:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.SearchTabProto.InputBoxInfo",5:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isVisible=e.bool();break;case 2:o.tabLabel=a[1].decode(e,e.uint32());break;case 3:o.baseUrl=e.string();break;case 4:o.viewportPrefix=e.string();break;case 5:o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(a[4].decode(e,e.uint32()));break;case 6:o.requirement=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if("boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.tabLabel&&null!==e.tabLabel){var t=a[1].verify(e.tabLabel);if(t)return"tabLabel."+t}if(void 0!==e.baseUrl&&!r.isString(e.baseUrl))return"baseUrl: string expected";if(void 0!==e.viewportPrefix&&!r.isString(e.viewportPrefix))return"viewportPrefix: string expected";if(void 0!==e.inputBox){if(!Array.isArray(e.inputBox))return"inputBox: array expected";for(var i=0;i<e.inputBox.length;++i){var t=a[4].verify(e.inputBox[i]);if(t)return"inputBox."+t}}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto)return e;var t=new n.keyhole.dbroot.SearchTabProto;if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.tabLabel&&null!==e.tabLabel){if("object"!=typeof e.tabLabel)throw TypeError(".keyhole.dbroot.SearchTabProto.tabLabel: object expected");t.tabLabel=a[1].fromObject(e.tabLabel)}if(void 0!==e.baseUrl&&null!==e.baseUrl&&(t.baseUrl=String(e.baseUrl)),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&(t.viewportPrefix=String(e.viewportPrefix)),e.inputBox){if(!Array.isArray(e.inputBox))throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: array expected");t.inputBox=[];for(var r=0;r<e.inputBox.length;++r){if("object"!=typeof e.inputBox[r])throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: object expected");t.inputBox[r]=a[4].fromObject(e.inputBox[r])}}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.SearchTabProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.inputBox=[]),t.defaults&&(r.isVisible=!1,r.tabLabel=null,r.baseUrl="",r.viewportPrefix="",r.requirement=null),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.tabLabel&&null!==e.tabLabel&&e.hasOwnProperty("tabLabel")&&(r.tabLabel=a[1].toObject(e.tabLabel,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=e.baseUrl),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&e.hasOwnProperty("viewportPrefix")&&(r.viewportPrefix=e.viewportPrefix),void 0!==e.inputBox&&null!==e.inputBox&&e.hasOwnProperty("inputBox")){r.inputBox=[];for(var i=0;i<e.inputBox.length;++i)r.inputBox[i]=a[4].toObject(e.inputBox[i],t)}return void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.InputBoxInfo=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.label=null,o.prototype.queryVerb="",o.prototype.queryPrepend="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.label=a[0].decode(e,e.uint32());break;case 2:o.queryVerb=e.string();break;case 3:o.queryPrepend=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=a[0].verify(e.label);return t?"label."+t:r.isString(e.queryVerb)?void 0===e.queryPrepend||r.isString(e.queryPrepend)?null:"queryPrepend: string expected":"queryVerb: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return e;var t=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");t.label=a[0].fromObject(e.label)}return void 0!==e.queryVerb&&null!==e.queryVerb&&(t.queryVerb=String(e.queryVerb)),void 0!==e.queryPrepend&&null!==e.queryPrepend&&(t.queryPrepend=String(e.queryPrepend)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.label=null,r.queryVerb="",r.queryPrepend=""),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[0].toObject(e.label,t)),void 0!==e.queryVerb&&null!==e.queryVerb&&e.hasOwnProperty("queryVerb")&&(r.queryVerb=e.queryVerb),void 0!==e.queryPrepend&&null!==e.queryPrepend&&e.hasOwnProperty("queryPrepend")&&(r.queryPrepend=e.queryPrepend),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.CobrandProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.logoUrl="",o.prototype.xCoord=null,o.prototype.yCoord=null,o.prototype.tiePoint=6,o.prototype.screenSize=0;var a={1:"keyhole.dbroot.CobrandProto.Coord",2:"keyhole.dbroot.CobrandProto.Coord",3:"keyhole.dbroot.CobrandProto.TiePoint"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.logoUrl=e.string();break;case 2:o.xCoord=a[1].decode(e,e.uint32());break;case 3:o.yCoord=a[2].decode(e,e.uint32());break;case 4:o.tiePoint=e.uint32();break;case 5:o.screenSize=e.double();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.logoUrl))return"logoUrl: string expected";if(void 0!==e.xCoord&&null!==e.xCoord){var t=a[1].verify(e.xCoord);if(t)return"xCoord."+t}if(void 0!==e.yCoord&&null!==e.yCoord){var t=a[2].verify(e.yCoord);if(t)return"yCoord."+t}if(void 0!==e.tiePoint)switch(e.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return void 0!==e.screenSize&&"number"!=typeof e.screenSize?"screenSize: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto)return e;var t=new n.keyhole.dbroot.CobrandProto;if(void 0!==e.logoUrl&&null!==e.logoUrl&&(t.logoUrl=String(e.logoUrl)),void 0!==e.xCoord&&null!==e.xCoord){if("object"!=typeof e.xCoord)throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=a[1].fromObject(e.xCoord)}if(void 0!==e.yCoord&&null!==e.yCoord){if("object"!=typeof e.yCoord)throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=a[2].fromObject(e.yCoord)}switch(e.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8}return void 0!==e.screenSize&&null!==e.screenSize&&(t.screenSize=Number(e.screenSize)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.logoUrl="",r.xCoord=null,r.yCoord=null,r.tiePoint=t.enums===String?"BOTTOM_LEFT":6,r.screenSize=0),void 0!==e.logoUrl&&null!==e.logoUrl&&e.hasOwnProperty("logoUrl")&&(r.logoUrl=e.logoUrl),void 0!==e.xCoord&&null!==e.xCoord&&e.hasOwnProperty("xCoord")&&(r.xCoord=a[1].toObject(e.xCoord,t)),void 0!==e.yCoord&&null!==e.yCoord&&e.hasOwnProperty("yCoord")&&(r.yCoord=a[2].toObject(e.yCoord,t)),void 0!==e.tiePoint&&null!==e.tiePoint&&e.hasOwnProperty("tiePoint")&&(r.tiePoint=t.enums===String?a[3][e.tiePoint]:e.tiePoint),void 0!==e.screenSize&&null!==e.screenSize&&e.hasOwnProperty("screenSize")&&(r.screenSize=e.screenSize),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Coord=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.value=0,r.prototype.isRelative=!1,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto.Coord;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.value=e.double();break;case 2:o.isRelative=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.value?"value: number expected":void 0!==e.isRelative&&"boolean"!=typeof e.isRelative?"isRelative: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto.Coord)return e;var t=new n.keyhole.dbroot.CobrandProto.Coord;return void 0!==e.value&&null!==e.value&&(t.value=Number(e.value)),void 0!==e.isRelative&&null!==e.isRelative&&(t.isRelative=Boolean(e.isRelative)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.value=0,r.isRelative=!1),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),void 0!==e.isRelative&&null!==e.isRelative&&e.hasOwnProperty("isRelative")&&(r.isRelative=e.isRelative),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.TiePoint=function(){var e={},t=Object.create(e);return t.TOP_LEFT=0,t.TOP_CENTER=1,t.TOP_RIGHT=2,t.MID_LEFT=3,t.MID_CENTER=4,t.MID_RIGHT=5,t.BOTTOM_LEFT=6,t.BOTTOM_CENTER=7,t.BOTTOM_RIGHT=8,t}(),o}(),o.DatabaseDescriptionProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.databaseUrl="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseDescriptionProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.databaseName=a[0].decode(e,e.uint32());break;case 2:o.databaseUrl=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}return r.isString(e.databaseUrl)?null:"databaseUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return e;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}return void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.databaseName=null,r.databaseUrl=""),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ConfigScriptProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.scriptName="",i.prototype.scriptData="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ConfigScriptProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.scriptName=e.string();break;case 2:o.scriptData=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isString(e.scriptName)?r.isString(e.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ConfigScriptProto)return e;var t=new n.keyhole.dbroot.ConfigScriptProto;return void 0!==e.scriptName&&null!==e.scriptName&&(t.scriptName=String(e.scriptName)),void 0!==e.scriptData&&null!==e.scriptData&&(t.scriptData=String(e.scriptData)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.scriptName="",r.scriptData=""),void 0!==e.scriptName&&null!==e.scriptName&&e.hasOwnProperty("scriptName")&&(r.scriptName=e.scriptName),void 0!==e.scriptData&&null!==e.scriptData&&e.hasOwnProperty("scriptData")&&(r.scriptData=e.scriptData),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SwoopParamsProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.startDistInMeters=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SwoopParamsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.startDistInMeters=e.double();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.startDistInMeters&&"number"!=typeof e.startDistInMeters?"startDistInMeters: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SwoopParamsProto)return e;var t=new n.keyhole.dbroot.SwoopParamsProto;return void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&(t.startDistInMeters=Number(e.startDistInMeters)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startDistInMeters=0),void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&e.hasOwnProperty("startDistInMeters")&&(r.startDistInMeters=e.startDistInMeters),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PostingServerProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.name=null,r.prototype.baseUrl=null,r.prototype.postWizardPath=null,r.prototype.fileSubmitPath=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PostingServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.name=o[0].decode(e,e.uint32());break;case 2:a.baseUrl=o[1].decode(e,e.uint32());break;case 3:a.postWizardPath=o[2].decode(e,e.uint32());break;case 4:a.fileSubmitPath=o[3].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=o[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.baseUrl&&null!==e.baseUrl){var t=o[1].verify(e.baseUrl);if(t)return"baseUrl."+t}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){var t=o[2].verify(e.postWizardPath);if(t)return"postWizardPath."+t}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){var t=o[3].verify(e.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PostingServerProto)return e;var t=new n.keyhole.dbroot.PostingServerProto;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=o[0].fromObject(e.name)}if(void 0!==e.baseUrl&&null!==e.baseUrl){if("object"!=typeof e.baseUrl)throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=o[1].fromObject(e.baseUrl)}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){if("object"!=typeof e.postWizardPath)throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=o[2].fromObject(e.postWizardPath)}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){if("object"!=typeof e.fileSubmitPath)throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=o[3].fromObject(e.fileSubmitPath)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name=null,r.baseUrl=null,r.postWizardPath=null,r.fileSubmitPath=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[0].toObject(e.name,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=o[1].toObject(e.baseUrl,t)),void 0!==e.postWizardPath&&null!==e.postWizardPath&&e.hasOwnProperty("postWizardPath")&&(r.postWizardPath=o[2].toObject(e.postWizardPath,t)),void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath&&e.hasOwnProperty("fileSubmitPath")&&(r.fileSubmitPath=o[3].toObject(e.fileSubmitPath,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PlanetaryDatabaseProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PlanetaryDatabaseProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=o[0].verify(e.url);if(t)return"url."+t;var t=o[1].verify(e.name);return t?"name."+t:null},r.fromObject=function(e){
  446. if(e instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return e;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=o[1].fromObject(e.name)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.LogServerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.enable=!1,o.prototype.throttlingFactor=1;var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LogServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.enable=e.bool();break;case 3:o.throttlingFactor=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}return void 0!==e.enable&&"boolean"!=typeof e.enable?"enable: boolean expected":void 0===e.throttlingFactor||r.isInteger(e.throttlingFactor)?null:"throttlingFactor: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LogServerProto)return e;var t=new n.keyhole.dbroot.LogServerProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=a[0].fromObject(e.url)}return void 0!==e.enable&&null!==e.enable&&(t.enable=Boolean(e.enable)),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&(t.throttlingFactor=0|e.throttlingFactor),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.enable=!1,r.throttlingFactor=1),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.enable&&null!==e.enable&&e.hasOwnProperty("enable")&&(r.enable=e.enable),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&e.hasOwnProperty("throttlingFactor")&&(r.throttlingFactor=e.throttlingFactor),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EndSnippetProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.model=null,o.prototype.authServerUrl=null,o.prototype.disableAuthentication=!1,o.prototype.mfeDomains=r.emptyArray,o.prototype.mfeLangParam="hl=$5Bhl5D",o.prototype.adsUrlPatterns="",o.prototype.reverseGeocoderUrl=null,o.prototype.reverseGeocoderProtocolVersion=3,o.prototype.skyDatabaseIsAvailable=!0,o.prototype.skyDatabaseUrl=null,o.prototype.defaultWebPageIntlUrl=null,o.prototype.numStartUpTips=17,o.prototype.startUpTipsUrl=null,o.prototype.numProStartUpTips=0,o.prototype.proStartUpTipsUrl=null,o.prototype.startupTipsIntlUrl=null,o.prototype.userGuideIntlUrl=null,o.prototype.supportCenterIntlUrl=null,o.prototype.businessListingIntlUrl=null,o.prototype.supportAnswerIntlUrl=null,o.prototype.supportTopicIntlUrl=null,o.prototype.supportRequestIntlUrl=null,o.prototype.earthIntlUrl=null,o.prototype.addContentUrl=null,o.prototype.sketchupNotInstalledUrl=null,o.prototype.sketchupErrorUrl=null,o.prototype.freeLicenseUrl=null,o.prototype.proLicenseUrl=null,o.prototype.tutorialUrl=null,o.prototype.keyboardShortcutsUrl=null,o.prototype.releaseNotesUrl=null,o.prototype.hideUserData=!1,o.prototype.useGeLogo=!0,o.prototype.dioramaDescriptionUrlBase=null,o.prototype.dioramaDefaultColor=4291281607,o.prototype.dioramaBlacklistUrl=null,o.prototype.clientOptions=null,o.prototype.fetchingOptions=null,o.prototype.timeMachineOptions=null,o.prototype.csiOptions=null,o.prototype.searchTab=r.emptyArray,o.prototype.cobrandInfo=r.emptyArray,o.prototype.validDatabase=r.emptyArray,o.prototype.configScript=r.emptyArray,o.prototype.deauthServerUrl=null,o.prototype.swoopParameters=null,o.prototype.bbsServerInfo=null,o.prototype.dataErrorServerInfo=null,o.prototype.planetaryDatabase=r.emptyArray,o.prototype.logServer=null,o.prototype.autopiaOptions=null,o.prototype.searchConfig=null,o.prototype.searchInfo=null,o.prototype.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",o.prototype.elevationProfileQueryDelay=500,o.prototype.proUpgradeUrl=null,o.prototype.earthCommunityUrl=null,o.prototype.googleMapsUrl=null,o.prototype.sharingUrl=null,o.prototype.privacyPolicyUrl=null,o.prototype.doGplusUserCheck=!1,o.prototype.rocktreeDataProto=null,o.prototype.filmstripConfig=r.emptyArray,o.prototype.showSigninButton=!1,o.prototype.proMeasureUpsellUrl=null,o.prototype.proPrintUpsellUrl=null,o.prototype.starDataProto=null,o.prototype.feedbackUrl=null,o.prototype.oauth2LoginUrl=null;var a={0:"keyhole.dbroot.PlanetModelProto",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.MfeDomainFeaturesProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.StringIdOrValueProto",10:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.StringIdOrValueProto",15:"keyhole.dbroot.StringIdOrValueProto",16:"keyhole.dbroot.StringIdOrValueProto",17:"keyhole.dbroot.StringIdOrValueProto",18:"keyhole.dbroot.StringIdOrValueProto",19:"keyhole.dbroot.StringIdOrValueProto",20:"keyhole.dbroot.StringIdOrValueProto",21:"keyhole.dbroot.StringIdOrValueProto",22:"keyhole.dbroot.StringIdOrValueProto",23:"keyhole.dbroot.StringIdOrValueProto",24:"keyhole.dbroot.StringIdOrValueProto",25:"keyhole.dbroot.StringIdOrValueProto",26:"keyhole.dbroot.StringIdOrValueProto",27:"keyhole.dbroot.StringIdOrValueProto",28:"keyhole.dbroot.StringIdOrValueProto",29:"keyhole.dbroot.StringIdOrValueProto",30:"keyhole.dbroot.StringIdOrValueProto",33:"keyhole.dbroot.StringIdOrValueProto",35:"keyhole.dbroot.StringIdOrValueProto",36:"keyhole.dbroot.ClientOptionsProto",37:"keyhole.dbroot.FetchingOptionsProto",38:"keyhole.dbroot.TimeMachineOptionsProto",39:"keyhole.dbroot.CSIOptionsProto",40:"keyhole.dbroot.SearchTabProto",41:"keyhole.dbroot.CobrandProto",42:"keyhole.dbroot.DatabaseDescriptionProto",43:"keyhole.dbroot.ConfigScriptProto",44:"keyhole.dbroot.StringIdOrValueProto",45:"keyhole.dbroot.SwoopParamsProto",46:"keyhole.dbroot.PostingServerProto",47:"keyhole.dbroot.PostingServerProto",48:"keyhole.dbroot.PlanetaryDatabaseProto",49:"keyhole.dbroot.LogServerProto",50:"keyhole.dbroot.AutopiaOptionsProto",51:"keyhole.dbroot.EndSnippetProto.SearchConfigProto",52:"keyhole.dbroot.EndSnippetProto.SearchInfoProto",55:"keyhole.dbroot.StringIdOrValueProto",56:"keyhole.dbroot.StringIdOrValueProto",57:"keyhole.dbroot.StringIdOrValueProto",58:"keyhole.dbroot.StringIdOrValueProto",59:"keyhole.dbroot.StringIdOrValueProto",61:"keyhole.dbroot.EndSnippetProto.RockTreeDataProto",62:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto",64:"keyhole.dbroot.StringIdOrValueProto",65:"keyhole.dbroot.StringIdOrValueProto",66:"keyhole.dbroot.EndSnippetProto.StarDataProto",67:"keyhole.dbroot.StringIdOrValueProto",68:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.model=a[0].decode(e,e.uint32());break;case 2:o.authServerUrl=a[1].decode(e,e.uint32());break;case 3:o.disableAuthentication=e.bool();break;case 4:o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(a[3].decode(e,e.uint32()));break;case 5:o.mfeLangParam=e.string();break;case 6:o.adsUrlPatterns=e.string();break;case 7:o.reverseGeocoderUrl=a[6].decode(e,e.uint32());break;case 8:o.reverseGeocoderProtocolVersion=e.int32();break;case 9:o.skyDatabaseIsAvailable=e.bool();break;case 10:o.skyDatabaseUrl=a[9].decode(e,e.uint32());break;case 11:o.defaultWebPageIntlUrl=a[10].decode(e,e.uint32());break;case 12:o.numStartUpTips=e.int32();break;case 13:o.startUpTipsUrl=a[12].decode(e,e.uint32());break;case 51:o.numProStartUpTips=e.int32();break;case 52:o.proStartUpTipsUrl=a[14].decode(e,e.uint32());break;case 64:o.startupTipsIntlUrl=a[15].decode(e,e.uint32());break;case 14:o.userGuideIntlUrl=a[16].decode(e,e.uint32());break;case 15:o.supportCenterIntlUrl=a[17].decode(e,e.uint32());break;case 16:o.businessListingIntlUrl=a[18].decode(e,e.uint32());break;case 17:o.supportAnswerIntlUrl=a[19].decode(e,e.uint32());break;case 18:o.supportTopicIntlUrl=a[20].decode(e,e.uint32());break;case 19:o.supportRequestIntlUrl=a[21].decode(e,e.uint32());break;case 20:o.earthIntlUrl=a[22].decode(e,e.uint32());break;case 21:o.addContentUrl=a[23].decode(e,e.uint32());break;case 22:o.sketchupNotInstalledUrl=a[24].decode(e,e.uint32());break;case 23:o.sketchupErrorUrl=a[25].decode(e,e.uint32());break;case 24:o.freeLicenseUrl=a[26].decode(e,e.uint32());break;case 25:o.proLicenseUrl=a[27].decode(e,e.uint32());break;case 48:o.tutorialUrl=a[28].decode(e,e.uint32());break;case 49:o.keyboardShortcutsUrl=a[29].decode(e,e.uint32());break;case 50:o.releaseNotesUrl=a[30].decode(e,e.uint32());break;case 26:o.hideUserData=e.bool();break;case 27:o.useGeLogo=e.bool();break;case 28:o.dioramaDescriptionUrlBase=a[33].decode(e,e.uint32());break;case 29:o.dioramaDefaultColor=e.uint32();break;case 53:o.dioramaBlacklistUrl=a[35].decode(e,e.uint32());break;case 30:o.clientOptions=a[36].decode(e,e.uint32());break;case 31:o.fetchingOptions=a[37].decode(e,e.uint32());break;case 32:o.timeMachineOptions=a[38].decode(e,e.uint32());break;case 33:o.csiOptions=a[39].decode(e,e.uint32());break;case 34:o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(a[40].decode(e,e.uint32()));break;case 35:o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(a[41].decode(e,e.uint32()));break;case 36:o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(a[42].decode(e,e.uint32()));break;case 37:o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(a[43].decode(e,e.uint32()));break;case 38:o.deauthServerUrl=a[44].decode(e,e.uint32());break;case 39:o.swoopParameters=a[45].decode(e,e.uint32());break;case 40:o.bbsServerInfo=a[46].decode(e,e.uint32());break;case 41:o.dataErrorServerInfo=a[47].decode(e,e.uint32());break;case 42:o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(a[48].decode(e,e.uint32()));break;case 43:o.logServer=a[49].decode(e,e.uint32());break;case 44:o.autopiaOptions=a[50].decode(e,e.uint32());break;case 54:o.searchConfig=a[51].decode(e,e.uint32());break;case 45:o.searchInfo=a[52].decode(e,e.uint32());break;case 46:o.elevationServiceBaseUrl=e.string();break;case 47:o.elevationProfileQueryDelay=e.int32();break;case 55:o.proUpgradeUrl=a[55].decode(e,e.uint32());break;case 56:o.earthCommunityUrl=a[56].decode(e,e.uint32());break;case 57:o.googleMapsUrl=a[57].decode(e,e.uint32());break;case 58:o.sharingUrl=a[58].decode(e,e.uint32());break;case 59:o.privacyPolicyUrl=a[59].decode(e,e.uint32());break;case 60:o.doGplusUserCheck=e.bool();break;case 61:o.rocktreeDataProto=a[61].decode(e,e.uint32());break;case 62:o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(a[62].decode(e,e.uint32()));break;case 63:o.showSigninButton=e.bool();break;case 65:o.proMeasureUpsellUrl=a[64].decode(e,e.uint32());break;case 66:o.proPrintUpsellUrl=a[65].decode(e,e.uint32());break;case 67:o.starDataProto=a[66].decode(e,e.uint32());break;case 68:o.feedbackUrl=a[67].decode(e,e.uint32());break;case 69:o.oauth2LoginUrl=a[68].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.model&&null!==e.model){var t=a[0].verify(e.model);if(t)return"model."+t}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){var t=a[1].verify(e.authServerUrl);if(t)return"authServerUrl."+t}if(void 0!==e.disableAuthentication&&"boolean"!=typeof e.disableAuthentication)return"disableAuthentication: boolean expected";if(void 0!==e.mfeDomains){if(!Array.isArray(e.mfeDomains))return"mfeDomains: array expected";for(var i=0;i<e.mfeDomains.length;++i){var t=a[3].verify(e.mfeDomains[i]);if(t)return"mfeDomains."+t}}if(void 0!==e.mfeLangParam&&!r.isString(e.mfeLangParam))return"mfeLangParam: string expected";if(void 0!==e.adsUrlPatterns&&!r.isString(e.adsUrlPatterns))return"adsUrlPatterns: string expected";if(void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){var t=a[6].verify(e.reverseGeocoderUrl);if(t)return"reverseGeocoderUrl."+t}if(void 0!==e.reverseGeocoderProtocolVersion&&!r.isInteger(e.reverseGeocoderProtocolVersion))return"reverseGeocoderProtocolVersion: integer expected";if(void 0!==e.skyDatabaseIsAvailable&&"boolean"!=typeof e.skyDatabaseIsAvailable)return"skyDatabaseIsAvailable: boolean expected";if(void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){var t=a[9].verify(e.skyDatabaseUrl);if(t)return"skyDatabaseUrl."+t}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){var t=a[10].verify(e.defaultWebPageIntlUrl);if(t)return"defaultWebPageIntlUrl."+t}if(void 0!==e.numStartUpTips&&!r.isInteger(e.numStartUpTips))return"numStartUpTips: integer expected";if(void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){var t=a[12].verify(e.startUpTipsUrl);if(t)return"startUpTipsUrl."+t}if(void 0!==e.numProStartUpTips&&!r.isInteger(e.numProStartUpTips))return"numProStartUpTips: integer expected";if(void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){var t=a[14].verify(e.proStartUpTipsUrl);if(t)return"proStartUpTipsUrl."+t}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){var t=a[15].verify(e.startupTipsIntlUrl);if(t)return"startupTipsIntlUrl."+t}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){var t=a[16].verify(e.userGuideIntlUrl);if(t)return"userGuideIntlUrl."+t}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){var t=a[17].verify(e.supportCenterIntlUrl);if(t)return"supportCenterIntlUrl."+t}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){var t=a[18].verify(e.businessListingIntlUrl);if(t)return"businessListingIntlUrl."+t}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){var t=a[19].verify(e.supportAnswerIntlUrl);if(t)return"supportAnswerIntlUrl."+t}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){var t=a[20].verify(e.supportTopicIntlUrl);if(t)return"supportTopicIntlUrl."+t}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){var t=a[21].verify(e.supportRequestIntlUrl);if(t)return"supportRequestIntlUrl."+t}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){var t=a[22].verify(e.earthIntlUrl);if(t)return"earthIntlUrl."+t}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){var t=a[23].verify(e.addContentUrl);if(t)return"addContentUrl."+t}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){var t=a[24].verify(e.sketchupNotInstalledUrl);if(t)return"sketchupNotInstalledUrl."+t}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){var t=a[25].verify(e.sketchupErrorUrl);if(t)return"sketchupErrorUrl."+t}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){var t=a[26].verify(e.freeLicenseUrl);if(t)return"freeLicenseUrl."+t}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){var t=a[27].verify(e.proLicenseUrl);if(t)return"proLicenseUrl."+t}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){var t=a[28].verify(e.tutorialUrl);if(t)return"tutorialUrl."+t}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){var t=a[29].verify(e.keyboardShortcutsUrl);if(t)return"keyboardShortcutsUrl."+t}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){var t=a[30].verify(e.releaseNotesUrl);if(t)return"releaseNotesUrl."+t}if(void 0!==e.hideUserData&&"boolean"!=typeof e.hideUserData)return"hideUserData: boolean expected";if(void 0!==e.useGeLogo&&"boolean"!=typeof e.useGeLogo)return"useGeLogo: boolean expected";if(void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){var t=a[33].verify(e.dioramaDescriptionUrlBase);if(t)return"dioramaDescriptionUrlBase."+t}if(void 0!==e.dioramaDefaultColor&&!r.isInteger(e.dioramaDefaultColor))return"dioramaDefaultColor: integer expected";if(void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){var t=a[35].verify(e.dioramaBlacklistUrl);if(t)return"dioramaBlacklistUrl."+t}if(void 0!==e.clientOptions&&null!==e.clientOptions){var t=a[36].verify(e.clientOptions);if(t)return"clientOptions."+t}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){var t=a[37].verify(e.fetchingOptions);if(t)return"fetchingOptions."+t}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){var t=a[38].verify(e.timeMachineOptions);if(t)return"timeMachineOptions."+t}if(void 0!==e.csiOptions&&null!==e.csiOptions){var t=a[39].verify(e.csiOptions);if(t)return"csiOptions."+t}if(void 0!==e.searchTab){if(!Array.isArray(e.searchTab))return"searchTab: array expected";for(var i=0;i<e.searchTab.length;++i){var t=a[40].verify(e.searchTab[i]);if(t)return"searchTab."+t}}if(void 0!==e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))return"cobrandInfo: array expected";for(var i=0;i<e.cobrandInfo.length;++i){var t=a[41].verify(e.cobrandInfo[i]);if(t)return"cobrandInfo."+t}}if(void 0!==e.validDatabase){if(!Array.isArray(e.validDatabase))return"validDatabase: array expected";for(var i=0;i<e.validDatabase.length;++i){var t=a[42].verify(e.validDatabase[i]);if(t)return"validDatabase."+t}}if(void 0!==e.configScript){if(!Array.isArray(e.configScript))return"configScript: array expected";for(var i=0;i<e.configScript.length;++i){var t=a[43].verify(e.configScript[i]);if(t)return"configScript."+t}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){var t=a[44].verify(e.deauthServerUrl);if(t)return"deauthServerUrl."+t}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){var t=a[45].verify(e.swoopParameters);if(t)return"swoopParameters."+t}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){var t=a[46].verify(e.bbsServerInfo);if(t)return"bbsServerInfo."+t}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){var t=a[47].verify(e.dataErrorServerInfo);if(t)return"dataErrorServerInfo."+t}if(void 0!==e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))return"planetaryDatabase: array expected";for(var i=0;i<e.planetaryDatabase.length;++i){var t=a[48].verify(e.planetaryDatabase[i]);if(t)return"planetaryDatabase."+t}}if(void 0!==e.logServer&&null!==e.logServer){var t=a[49].verify(e.logServer);if(t)return"logServer."+t}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){var t=a[50].verify(e.autopiaOptions);if(t)return"autopiaOptions."+t}if(void 0!==e.searchConfig&&null!==e.searchConfig){var t=a[51].verify(e.searchConfig);if(t)return"searchConfig."+t}if(void 0!==e.searchInfo&&null!==e.searchInfo){var t=a[52].verify(e.searchInfo);if(t)return"searchInfo."+t}if(void 0!==e.elevationServiceBaseUrl&&!r.isString(e.elevationServiceBaseUrl))return"elevationServiceBaseUrl: string expected";if(void 0!==e.elevationProfileQueryDelay&&!r.isInteger(e.elevationProfileQueryDelay))return"elevationProfileQueryDelay: integer expected";if(void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){var t=a[55].verify(e.proUpgradeUrl);if(t)return"proUpgradeUrl."+t}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){var t=a[56].verify(e.earthCommunityUrl);if(t)return"earthCommunityUrl."+t}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){var t=a[57].verify(e.googleMapsUrl);if(t)return"googleMapsUrl."+t}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){var t=a[58].verify(e.sharingUrl);if(t)return"sharingUrl."+t}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){var t=a[59].verify(e.privacyPolicyUrl);if(t)return"privacyPolicyUrl."+t}if(void 0!==e.doGplusUserCheck&&"boolean"!=typeof e.doGplusUserCheck)return"doGplusUserCheck: boolean expected";if(void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){var t=a[61].verify(e.rocktreeDataProto);if(t)return"rocktreeDataProto."+t}if(void 0!==e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))return"filmstripConfig: array expected";for(var i=0;i<e.filmstripConfig.length;++i){var t=a[62].verify(e.filmstripConfig[i]);if(t)return"filmstripConfig."+t}}if(void 0!==e.showSigninButton&&"boolean"!=typeof e.showSigninButton)return"showSigninButton: boolean expected";if(void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){var t=a[64].verify(e.proMeasureUpsellUrl);if(t)return"proMeasureUpsellUrl."+t}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){var t=a[65].verify(e.proPrintUpsellUrl);if(t)return"proPrintUpsellUrl."+t}if(void 0!==e.starDataProto&&null!==e.starDataProto){var t=a[66].verify(e.starDataProto);if(t)return"starDataProto."+t}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){var t=a[67].verify(e.feedbackUrl);if(t)return"feedbackUrl."+t}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){var t=a[68].verify(e.oauth2LoginUrl);if(t)return"oauth2LoginUrl."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto;if(void 0!==e.model&&null!==e.model){if("object"!=typeof e.model)throw TypeError(".keyhole.dbroot.EndSnippetProto.model: object expected");t.model=a[0].fromObject(e.model)}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){if("object"!=typeof e.authServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected");t.authServerUrl=a[1].fromObject(e.authServerUrl)}if(void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&(t.disableAuthentication=Boolean(e.disableAuthentication)),e.mfeDomains){if(!Array.isArray(e.mfeDomains))throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected");t.mfeDomains=[];for(var r=0;r<e.mfeDomains.length;++r){if("object"!=typeof e.mfeDomains[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected");t.mfeDomains[r]=a[3].fromObject(e.mfeDomains[r])}}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&(t.mfeLangParam=String(e.mfeLangParam)),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&(t.adsUrlPatterns=String(e.adsUrlPatterns)),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){if("object"!=typeof e.reverseGeocoderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected");t.reverseGeocoderUrl=a[6].fromObject(e.reverseGeocoderUrl)}if(void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&(t.reverseGeocoderProtocolVersion=0|e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&(t.skyDatabaseIsAvailable=Boolean(e.skyDatabaseIsAvailable)),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){if("object"!=typeof e.skyDatabaseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected");t.skyDatabaseUrl=a[9].fromObject(e.skyDatabaseUrl)}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){if("object"!=typeof e.defaultWebPageIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected");t.defaultWebPageIntlUrl=a[10].fromObject(e.defaultWebPageIntlUrl)}if(void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&(t.numStartUpTips=0|e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){if("object"!=typeof e.startUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected");t.startUpTipsUrl=a[12].fromObject(e.startUpTipsUrl)}if(void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&(t.numProStartUpTips=0|e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){if("object"!=typeof e.proStartUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected");t.proStartUpTipsUrl=a[14].fromObject(e.proStartUpTipsUrl)}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){if("object"!=typeof e.startupTipsIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected");t.startupTipsIntlUrl=a[15].fromObject(e.startupTipsIntlUrl)}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){if("object"!=typeof e.userGuideIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected");t.userGuideIntlUrl=a[16].fromObject(e.userGuideIntlUrl)}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){if("object"!=typeof e.supportCenterIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected");t.supportCenterIntlUrl=a[17].fromObject(e.supportCenterIntlUrl)}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){if("object"!=typeof e.businessListingIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected");t.businessListingIntlUrl=a[18].fromObject(e.businessListingIntlUrl)}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){if("object"!=typeof e.supportAnswerIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected");t.supportAnswerIntlUrl=a[19].fromObject(e.supportAnswerIntlUrl)}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){if("object"!=typeof e.supportTopicIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected");t.supportTopicIntlUrl=a[20].fromObject(e.supportTopicIntlUrl)}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){if("object"!=typeof e.supportRequestIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected");t.supportRequestIntlUrl=a[21].fromObject(e.supportRequestIntlUrl)}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){if("object"!=typeof e.earthIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected");t.earthIntlUrl=a[22].fromObject(e.earthIntlUrl)}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){if("object"!=typeof e.addContentUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected");t.addContentUrl=a[23].fromObject(e.addContentUrl)}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){if("object"!=typeof e.sketchupNotInstalledUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected");t.sketchupNotInstalledUrl=a[24].fromObject(e.sketchupNotInstalledUrl)}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){if("object"!=typeof e.sketchupErrorUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected");t.sketchupErrorUrl=a[25].fromObject(e.sketchupErrorUrl)}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){if("object"!=typeof e.freeLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected");t.freeLicenseUrl=a[26].fromObject(e.freeLicenseUrl)}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){if("object"!=typeof e.proLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected");t.proLicenseUrl=a[27].fromObject(e.proLicenseUrl)}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){if("object"!=typeof e.tutorialUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected");t.tutorialUrl=a[28].fromObject(e.tutorialUrl)}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){if("object"!=typeof e.keyboardShortcutsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected");t.keyboardShortcutsUrl=a[29].fromObject(e.keyboardShortcutsUrl)}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){if("object"!=typeof e.releaseNotesUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected");t.releaseNotesUrl=a[30].fromObject(e.releaseNotesUrl)}if(void 0!==e.hideUserData&&null!==e.hideUserData&&(t.hideUserData=Boolean(e.hideUserData)),void 0!==e.useGeLogo&&null!==e.useGeLogo&&(t.useGeLogo=Boolean(e.useGeLogo)),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){if("object"!=typeof e.dioramaDescriptionUrlBase)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected");t.dioramaDescriptionUrlBase=a[33].fromObject(e.dioramaDescriptionUrlBase)}if(void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&(t.dioramaDefaultColor=e.dioramaDefaultColor>>>0),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){if("object"!=typeof e.dioramaBlacklistUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=a[35].fromObject(e.dioramaBlacklistUrl)}if(void 0!==e.clientOptions&&null!==e.clientOptions){if("object"!=typeof e.clientOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=a[36].fromObject(e.clientOptions)}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){if("object"!=typeof e.fetchingOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=a[37].fromObject(e.fetchingOptions)}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){if("object"!=typeof e.timeMachineOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=a[38].fromObject(e.timeMachineOptions)}if(void 0!==e.csiOptions&&null!==e.csiOptions){if("object"!=typeof e.csiOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=a[39].fromObject(e.csiOptions)}if(e.searchTab){if(!Array.isArray(e.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var r=0;r<e.searchTab.length;++r){if("object"!=typeof e.searchTab[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: object expected");t.searchTab[r]=a[40].fromObject(e.searchTab[r])}}if(e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected");t.cobrandInfo=[];for(var r=0;r<e.cobrandInfo.length;++r){if("object"!=typeof e.cobrandInfo[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected");t.cobrandInfo[r]=a[41].fromObject(e.cobrandInfo[r])}}if(e.validDatabase){if(!Array.isArray(e.validDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: array expected");t.validDatabase=[];for(var r=0;r<e.validDatabase.length;++r){if("object"!=typeof e.validDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: object expected");t.validDatabase[r]=a[42].fromObject(e.validDatabase[r])}}if(e.configScript){if(!Array.isArray(e.configScript))throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: array expected");t.configScript=[];for(var r=0;r<e.configScript.length;++r){if("object"!=typeof e.configScript[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: object expected");t.configScript[r]=a[43].fromObject(e.configScript[r])}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){if("object"!=typeof e.deauthServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected");t.deauthServerUrl=a[44].fromObject(e.deauthServerUrl)}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){if("object"!=typeof e.swoopParameters)throw TypeError(".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected")
  447. ;t.swoopParameters=a[45].fromObject(e.swoopParameters)}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){if("object"!=typeof e.bbsServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected");t.bbsServerInfo=a[46].fromObject(e.bbsServerInfo)}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){if("object"!=typeof e.dataErrorServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected");t.dataErrorServerInfo=a[47].fromObject(e.dataErrorServerInfo)}if(e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected");t.planetaryDatabase=[];for(var r=0;r<e.planetaryDatabase.length;++r){if("object"!=typeof e.planetaryDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected");t.planetaryDatabase[r]=a[48].fromObject(e.planetaryDatabase[r])}}if(void 0!==e.logServer&&null!==e.logServer){if("object"!=typeof e.logServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.logServer: object expected");t.logServer=a[49].fromObject(e.logServer)}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){if("object"!=typeof e.autopiaOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected");t.autopiaOptions=a[50].fromObject(e.autopiaOptions)}if(void 0!==e.searchConfig&&null!==e.searchConfig){if("object"!=typeof e.searchConfig)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchConfig: object expected");t.searchConfig=a[51].fromObject(e.searchConfig)}if(void 0!==e.searchInfo&&null!==e.searchInfo){if("object"!=typeof e.searchInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchInfo: object expected");t.searchInfo=a[52].fromObject(e.searchInfo)}if(void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&(t.elevationServiceBaseUrl=String(e.elevationServiceBaseUrl)),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&(t.elevationProfileQueryDelay=0|e.elevationProfileQueryDelay),void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){if("object"!=typeof e.proUpgradeUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected");t.proUpgradeUrl=a[55].fromObject(e.proUpgradeUrl)}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){if("object"!=typeof e.earthCommunityUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected");t.earthCommunityUrl=a[56].fromObject(e.earthCommunityUrl)}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){if("object"!=typeof e.googleMapsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected");t.googleMapsUrl=a[57].fromObject(e.googleMapsUrl)}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){if("object"!=typeof e.sharingUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected");t.sharingUrl=a[58].fromObject(e.sharingUrl)}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){if("object"!=typeof e.privacyPolicyUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected");t.privacyPolicyUrl=a[59].fromObject(e.privacyPolicyUrl)}if(void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&(t.doGplusUserCheck=Boolean(e.doGplusUserCheck)),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){if("object"!=typeof e.rocktreeDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected");t.rocktreeDataProto=a[61].fromObject(e.rocktreeDataProto)}if(e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected");t.filmstripConfig=[];for(var r=0;r<e.filmstripConfig.length;++r){if("object"!=typeof e.filmstripConfig[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected");t.filmstripConfig[r]=a[62].fromObject(e.filmstripConfig[r])}}if(void 0!==e.showSigninButton&&null!==e.showSigninButton&&(t.showSigninButton=Boolean(e.showSigninButton)),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){if("object"!=typeof e.proMeasureUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected");t.proMeasureUpsellUrl=a[64].fromObject(e.proMeasureUpsellUrl)}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){if("object"!=typeof e.proPrintUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected");t.proPrintUpsellUrl=a[65].fromObject(e.proPrintUpsellUrl)}if(void 0!==e.starDataProto&&null!==e.starDataProto){if("object"!=typeof e.starDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.starDataProto: object expected");t.starDataProto=a[66].fromObject(e.starDataProto)}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){if("object"!=typeof e.feedbackUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected");t.feedbackUrl=a[67].fromObject(e.feedbackUrl)}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){if("object"!=typeof e.oauth2LoginUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected");t.oauth2LoginUrl=a[68].fromObject(e.oauth2LoginUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.mfeDomains=[],r.searchTab=[],r.cobrandInfo=[],r.validDatabase=[],r.configScript=[],r.planetaryDatabase=[],r.filmstripConfig=[]),t.defaults&&(r.model=null,r.authServerUrl=null,r.disableAuthentication=!1,r.mfeLangParam="hl=$5Bhl5D",r.adsUrlPatterns="",r.reverseGeocoderUrl=null,r.reverseGeocoderProtocolVersion=3,r.skyDatabaseIsAvailable=!0,r.skyDatabaseUrl=null,r.defaultWebPageIntlUrl=null,r.numStartUpTips=17,r.startUpTipsUrl=null,r.numProStartUpTips=0,r.proStartUpTipsUrl=null,r.startupTipsIntlUrl=null,r.userGuideIntlUrl=null,r.supportCenterIntlUrl=null,r.businessListingIntlUrl=null,r.supportAnswerIntlUrl=null,r.supportTopicIntlUrl=null,r.supportRequestIntlUrl=null,r.earthIntlUrl=null,r.addContentUrl=null,r.sketchupNotInstalledUrl=null,r.sketchupErrorUrl=null,r.freeLicenseUrl=null,r.proLicenseUrl=null,r.tutorialUrl=null,r.keyboardShortcutsUrl=null,r.releaseNotesUrl=null,r.hideUserData=!1,r.useGeLogo=!0,r.dioramaDescriptionUrlBase=null,r.dioramaDefaultColor=4291281607,r.dioramaBlacklistUrl=null,r.clientOptions=null,r.fetchingOptions=null,r.timeMachineOptions=null,r.csiOptions=null,r.deauthServerUrl=null,r.swoopParameters=null,r.bbsServerInfo=null,r.dataErrorServerInfo=null,r.logServer=null,r.autopiaOptions=null,r.searchConfig=null,r.searchInfo=null,r.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",r.elevationProfileQueryDelay=500,r.proUpgradeUrl=null,r.earthCommunityUrl=null,r.googleMapsUrl=null,r.sharingUrl=null,r.privacyPolicyUrl=null,r.doGplusUserCheck=!1,r.rocktreeDataProto=null,r.showSigninButton=!1,r.proMeasureUpsellUrl=null,r.proPrintUpsellUrl=null,r.starDataProto=null,r.feedbackUrl=null,r.oauth2LoginUrl=null),void 0!==e.model&&null!==e.model&&e.hasOwnProperty("model")&&(r.model=a[0].toObject(e.model,t)),void 0!==e.authServerUrl&&null!==e.authServerUrl&&e.hasOwnProperty("authServerUrl")&&(r.authServerUrl=a[1].toObject(e.authServerUrl,t)),void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&e.hasOwnProperty("disableAuthentication")&&(r.disableAuthentication=e.disableAuthentication),void 0!==e.mfeDomains&&null!==e.mfeDomains&&e.hasOwnProperty("mfeDomains")){r.mfeDomains=[];for(var i=0;i<e.mfeDomains.length;++i)r.mfeDomains[i]=a[3].toObject(e.mfeDomains[i],t)}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&e.hasOwnProperty("mfeLangParam")&&(r.mfeLangParam=e.mfeLangParam),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&e.hasOwnProperty("adsUrlPatterns")&&(r.adsUrlPatterns=e.adsUrlPatterns),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl&&e.hasOwnProperty("reverseGeocoderUrl")&&(r.reverseGeocoderUrl=a[6].toObject(e.reverseGeocoderUrl,t)),void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&e.hasOwnProperty("reverseGeocoderProtocolVersion")&&(r.reverseGeocoderProtocolVersion=e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&e.hasOwnProperty("skyDatabaseIsAvailable")&&(r.skyDatabaseIsAvailable=e.skyDatabaseIsAvailable),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl&&e.hasOwnProperty("skyDatabaseUrl")&&(r.skyDatabaseUrl=a[9].toObject(e.skyDatabaseUrl,t)),void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl&&e.hasOwnProperty("defaultWebPageIntlUrl")&&(r.defaultWebPageIntlUrl=a[10].toObject(e.defaultWebPageIntlUrl,t)),void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&e.hasOwnProperty("numStartUpTips")&&(r.numStartUpTips=e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl&&e.hasOwnProperty("startUpTipsUrl")&&(r.startUpTipsUrl=a[12].toObject(e.startUpTipsUrl,t)),void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&e.hasOwnProperty("numProStartUpTips")&&(r.numProStartUpTips=e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl&&e.hasOwnProperty("proStartUpTipsUrl")&&(r.proStartUpTipsUrl=a[14].toObject(e.proStartUpTipsUrl,t)),void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl&&e.hasOwnProperty("startupTipsIntlUrl")&&(r.startupTipsIntlUrl=a[15].toObject(e.startupTipsIntlUrl,t)),void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl&&e.hasOwnProperty("userGuideIntlUrl")&&(r.userGuideIntlUrl=a[16].toObject(e.userGuideIntlUrl,t)),void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl&&e.hasOwnProperty("supportCenterIntlUrl")&&(r.supportCenterIntlUrl=a[17].toObject(e.supportCenterIntlUrl,t)),void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl&&e.hasOwnProperty("businessListingIntlUrl")&&(r.businessListingIntlUrl=a[18].toObject(e.businessListingIntlUrl,t)),void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl&&e.hasOwnProperty("supportAnswerIntlUrl")&&(r.supportAnswerIntlUrl=a[19].toObject(e.supportAnswerIntlUrl,t)),void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl&&e.hasOwnProperty("supportTopicIntlUrl")&&(r.supportTopicIntlUrl=a[20].toObject(e.supportTopicIntlUrl,t)),void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl&&e.hasOwnProperty("supportRequestIntlUrl")&&(r.supportRequestIntlUrl=a[21].toObject(e.supportRequestIntlUrl,t)),void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl&&e.hasOwnProperty("earthIntlUrl")&&(r.earthIntlUrl=a[22].toObject(e.earthIntlUrl,t)),void 0!==e.addContentUrl&&null!==e.addContentUrl&&e.hasOwnProperty("addContentUrl")&&(r.addContentUrl=a[23].toObject(e.addContentUrl,t)),void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl&&e.hasOwnProperty("sketchupNotInstalledUrl")&&(r.sketchupNotInstalledUrl=a[24].toObject(e.sketchupNotInstalledUrl,t)),void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl&&e.hasOwnProperty("sketchupErrorUrl")&&(r.sketchupErrorUrl=a[25].toObject(e.sketchupErrorUrl,t)),void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl&&e.hasOwnProperty("freeLicenseUrl")&&(r.freeLicenseUrl=a[26].toObject(e.freeLicenseUrl,t)),void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl&&e.hasOwnProperty("proLicenseUrl")&&(r.proLicenseUrl=a[27].toObject(e.proLicenseUrl,t)),void 0!==e.tutorialUrl&&null!==e.tutorialUrl&&e.hasOwnProperty("tutorialUrl")&&(r.tutorialUrl=a[28].toObject(e.tutorialUrl,t)),void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl&&e.hasOwnProperty("keyboardShortcutsUrl")&&(r.keyboardShortcutsUrl=a[29].toObject(e.keyboardShortcutsUrl,t)),void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl&&e.hasOwnProperty("releaseNotesUrl")&&(r.releaseNotesUrl=a[30].toObject(e.releaseNotesUrl,t)),void 0!==e.hideUserData&&null!==e.hideUserData&&e.hasOwnProperty("hideUserData")&&(r.hideUserData=e.hideUserData),void 0!==e.useGeLogo&&null!==e.useGeLogo&&e.hasOwnProperty("useGeLogo")&&(r.useGeLogo=e.useGeLogo),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase&&e.hasOwnProperty("dioramaDescriptionUrlBase")&&(r.dioramaDescriptionUrlBase=a[33].toObject(e.dioramaDescriptionUrlBase,t)),void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&e.hasOwnProperty("dioramaDefaultColor")&&(r.dioramaDefaultColor=e.dioramaDefaultColor),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl&&e.hasOwnProperty("dioramaBlacklistUrl")&&(r.dioramaBlacklistUrl=a[35].toObject(e.dioramaBlacklistUrl,t)),void 0!==e.clientOptions&&null!==e.clientOptions&&e.hasOwnProperty("clientOptions")&&(r.clientOptions=a[36].toObject(e.clientOptions,t)),void 0!==e.fetchingOptions&&null!==e.fetchingOptions&&e.hasOwnProperty("fetchingOptions")&&(r.fetchingOptions=a[37].toObject(e.fetchingOptions,t)),void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions&&e.hasOwnProperty("timeMachineOptions")&&(r.timeMachineOptions=a[38].toObject(e.timeMachineOptions,t)),void 0!==e.csiOptions&&null!==e.csiOptions&&e.hasOwnProperty("csiOptions")&&(r.csiOptions=a[39].toObject(e.csiOptions,t)),void 0!==e.searchTab&&null!==e.searchTab&&e.hasOwnProperty("searchTab")){r.searchTab=[];for(var i=0;i<e.searchTab.length;++i)r.searchTab[i]=a[40].toObject(e.searchTab[i],t)}if(void 0!==e.cobrandInfo&&null!==e.cobrandInfo&&e.hasOwnProperty("cobrandInfo")){r.cobrandInfo=[];for(var i=0;i<e.cobrandInfo.length;++i)r.cobrandInfo[i]=a[41].toObject(e.cobrandInfo[i],t)}if(void 0!==e.validDatabase&&null!==e.validDatabase&&e.hasOwnProperty("validDatabase")){r.validDatabase=[];for(var i=0;i<e.validDatabase.length;++i)r.validDatabase[i]=a[42].toObject(e.validDatabase[i],t)}if(void 0!==e.configScript&&null!==e.configScript&&e.hasOwnProperty("configScript")){r.configScript=[];for(var i=0;i<e.configScript.length;++i)r.configScript[i]=a[43].toObject(e.configScript[i],t)}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl&&e.hasOwnProperty("deauthServerUrl")&&(r.deauthServerUrl=a[44].toObject(e.deauthServerUrl,t)),void 0!==e.swoopParameters&&null!==e.swoopParameters&&e.hasOwnProperty("swoopParameters")&&(r.swoopParameters=a[45].toObject(e.swoopParameters,t)),void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo&&e.hasOwnProperty("bbsServerInfo")&&(r.bbsServerInfo=a[46].toObject(e.bbsServerInfo,t)),void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo&&e.hasOwnProperty("dataErrorServerInfo")&&(r.dataErrorServerInfo=a[47].toObject(e.dataErrorServerInfo,t)),void 0!==e.planetaryDatabase&&null!==e.planetaryDatabase&&e.hasOwnProperty("planetaryDatabase")){r.planetaryDatabase=[];for(var i=0;i<e.planetaryDatabase.length;++i)r.planetaryDatabase[i]=a[48].toObject(e.planetaryDatabase[i],t)}if(void 0!==e.logServer&&null!==e.logServer&&e.hasOwnProperty("logServer")&&(r.logServer=a[49].toObject(e.logServer,t)),void 0!==e.autopiaOptions&&null!==e.autopiaOptions&&e.hasOwnProperty("autopiaOptions")&&(r.autopiaOptions=a[50].toObject(e.autopiaOptions,t)),void 0!==e.searchConfig&&null!==e.searchConfig&&e.hasOwnProperty("searchConfig")&&(r.searchConfig=a[51].toObject(e.searchConfig,t)),void 0!==e.searchInfo&&null!==e.searchInfo&&e.hasOwnProperty("searchInfo")&&(r.searchInfo=a[52].toObject(e.searchInfo,t)),void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&e.hasOwnProperty("elevationServiceBaseUrl")&&(r.elevationServiceBaseUrl=e.elevationServiceBaseUrl),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&e.hasOwnProperty("elevationProfileQueryDelay")&&(r.elevationProfileQueryDelay=e.elevationProfileQueryDelay),void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl&&e.hasOwnProperty("proUpgradeUrl")&&(r.proUpgradeUrl=a[55].toObject(e.proUpgradeUrl,t)),void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl&&e.hasOwnProperty("earthCommunityUrl")&&(r.earthCommunityUrl=a[56].toObject(e.earthCommunityUrl,t)),void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl&&e.hasOwnProperty("googleMapsUrl")&&(r.googleMapsUrl=a[57].toObject(e.googleMapsUrl,t)),void 0!==e.sharingUrl&&null!==e.sharingUrl&&e.hasOwnProperty("sharingUrl")&&(r.sharingUrl=a[58].toObject(e.sharingUrl,t)),void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl&&e.hasOwnProperty("privacyPolicyUrl")&&(r.privacyPolicyUrl=a[59].toObject(e.privacyPolicyUrl,t)),void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&e.hasOwnProperty("doGplusUserCheck")&&(r.doGplusUserCheck=e.doGplusUserCheck),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto&&e.hasOwnProperty("rocktreeDataProto")&&(r.rocktreeDataProto=a[61].toObject(e.rocktreeDataProto,t)),void 0!==e.filmstripConfig&&null!==e.filmstripConfig&&e.hasOwnProperty("filmstripConfig")){r.filmstripConfig=[];for(var i=0;i<e.filmstripConfig.length;++i)r.filmstripConfig[i]=a[62].toObject(e.filmstripConfig[i],t)}return void 0!==e.showSigninButton&&null!==e.showSigninButton&&e.hasOwnProperty("showSigninButton")&&(r.showSigninButton=e.showSigninButton),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl&&e.hasOwnProperty("proMeasureUpsellUrl")&&(r.proMeasureUpsellUrl=a[64].toObject(e.proMeasureUpsellUrl,t)),void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl&&e.hasOwnProperty("proPrintUpsellUrl")&&(r.proPrintUpsellUrl=a[65].toObject(e.proPrintUpsellUrl,t)),void 0!==e.starDataProto&&null!==e.starDataProto&&e.hasOwnProperty("starDataProto")&&(r.starDataProto=a[66].toObject(e.starDataProto,t)),void 0!==e.feedbackUrl&&null!==e.feedbackUrl&&e.hasOwnProperty("feedbackUrl")&&(r.feedbackUrl=a[67].toObject(e.feedbackUrl,t)),void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl&&e.hasOwnProperty("oauth2LoginUrl")&&(r.oauth2LoginUrl=a[68].toObject(e.oauth2LoginUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.searchServer=r.emptyArray,o.prototype.oneboxService=r.emptyArray,o.prototype.kmlSearchUrl=null,o.prototype.kmlRenderUrl=null,o.prototype.searchHistoryUrl=null,o.prototype.errorPageUrl=null;var a={0:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer",1:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.searchServer&&o.searchServer.length||(o.searchServer=[]),o.searchServer.push(a[0].decode(e,e.uint32()));break;case 2:o.oneboxService&&o.oneboxService.length||(o.oneboxService=[]),o.oneboxService.push(a[1].decode(e,e.uint32()));break;case 3:o.kmlSearchUrl=a[2].decode(e,e.uint32());break;case 4:o.kmlRenderUrl=a[3].decode(e,e.uint32());break;case 6:o.searchHistoryUrl=a[4].decode(e,e.uint32());break;case 5:o.errorPageUrl=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.searchServer){if(!Array.isArray(e.searchServer))return"searchServer: array expected";for(var t=0;t<e.searchServer.length;++t){var r=a[0].verify(e.searchServer[t]);if(r)return"searchServer."+r}}if(void 0!==e.oneboxService){if(!Array.isArray(e.oneboxService))return"oneboxService: array expected";for(var t=0;t<e.oneboxService.length;++t){var r=a[1].verify(e.oneboxService[t]);if(r)return"oneboxService."+r}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){var r=a[2].verify(e.kmlSearchUrl);if(r)return"kmlSearchUrl."+r}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){var r=a[3].verify(e.kmlRenderUrl);if(r)return"kmlRenderUrl."+r}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){var r=a[4].verify(e.searchHistoryUrl);if(r)return"searchHistoryUrl."+r}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){var r=a[5].verify(e.errorPageUrl);if(r)return"errorPageUrl."+r}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;if(e.searchServer){if(!Array.isArray(e.searchServer))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected");t.searchServer=[];for(var r=0;r<e.searchServer.length;++r){if("object"!=typeof e.searchServer[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected");t.searchServer[r]=a[0].fromObject(e.searchServer[r])}}if(e.oneboxService){if(!Array.isArray(e.oneboxService))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected");t.oneboxService=[];for(var r=0;r<e.oneboxService.length;++r){if("object"!=typeof e.oneboxService[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected");t.oneboxService[r]=a[1].fromObject(e.oneboxService[r])}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){if("object"!=typeof e.kmlSearchUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected");t.kmlSearchUrl=a[2].fromObject(e.kmlSearchUrl)}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){if("object"!=typeof e.kmlRenderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected");t.kmlRenderUrl=a[3].fromObject(e.kmlRenderUrl)}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){if("object"!=typeof e.searchHistoryUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected");t.searchHistoryUrl=a[4].fromObject(e.searchHistoryUrl)}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){if("object"!=typeof e.errorPageUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected");t.errorPageUrl=a[5].fromObject(e.errorPageUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.searchServer=[],r.oneboxService=[]),t.defaults&&(r.kmlSearchUrl=null,r.kmlRenderUrl=null,r.searchHistoryUrl=null,r.errorPageUrl=null),void 0!==e.searchServer&&null!==e.searchServer&&e.hasOwnProperty("searchServer")){r.searchServer=[];for(var i=0;i<e.searchServer.length;++i)r.searchServer[i]=a[0].toObject(e.searchServer[i],t)}if(void 0!==e.oneboxService&&null!==e.oneboxService&&e.hasOwnProperty("oneboxService")){r.oneboxService=[];for(var i=0;i<e.oneboxService.length;++i)r.oneboxService[i]=a[1].toObject(e.oneboxService[i],t)}return void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl&&e.hasOwnProperty("kmlSearchUrl")&&(r.kmlSearchUrl=a[2].toObject(e.kmlSearchUrl,t)),void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl&&e.hasOwnProperty("kmlRenderUrl")&&(r.kmlRenderUrl=a[3].toObject(e.kmlRenderUrl,t)),void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl&&e.hasOwnProperty("searchHistoryUrl")&&(r.searchHistoryUrl=a[4].toObject(e.searchHistoryUrl,t)),void 0!==e.errorPageUrl&&null!==e.errorPageUrl&&e.hasOwnProperty("errorPageUrl")&&(r.errorPageUrl=a[5].toObject(e.errorPageUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchServer=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.name=null,o.prototype.url=null,o.prototype.type=0,o.prototype.htmlTransformUrl=null,o.prototype.kmlTransformUrl=null,o.prototype.supplementalUi=null,o.prototype.suggestion=r.emptyArray,o.prototype.searchlet=r.emptyArray,o.prototype.requirements=null,o.prototype.suggestServer=null;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi",6:"keyhole.dbroot.StringIdOrValueProto",7:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto",8:"keyhole.dbroot.RequirementProto",9:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.name=a[0].decode(e,e.uint32());break;case 2:o.url=a[1].decode(e,e.uint32());break;case 3:o.type=e.uint32();break;case 4:o.htmlTransformUrl=a[3].decode(e,e.uint32());break;case 5:o.kmlTransformUrl=a[4].decode(e,e.uint32());break;case 6:o.supplementalUi=a[5].decode(e,e.uint32());break;case 9:o.suggestion&&o.suggestion.length||(o.suggestion=[]),o.suggestion.push(a[6].decode(e,e.uint32()));break;case 7:o.searchlet&&o.searchlet.length||(o.searchlet=[]),o.searchlet.push(a[7].decode(e,e.uint32()));break;case 8:o.requirements=a[8].decode(e,e.uint32());break;case 10:o.suggestServer=a[9].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=a[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.url&&null!==e.url){var t=a[1].verify(e.url);if(t)return"url."+t}if(void 0!==e.type)switch(e.type){default:return"type: enum value expected";case 0:case 1:}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){var t=a[3].verify(e.htmlTransformUrl);if(t)return"htmlTransformUrl."+t}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){var t=a[4].verify(e.kmlTransformUrl);if(t)return"kmlTransformUrl."+t}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){var t=a[5].verify(e.supplementalUi);if(t)return"supplementalUi."+t}if(void 0!==e.suggestion){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var r=0;r<e.suggestion.length;++r){var t=a[6].verify(e.suggestion[r]);if(t)return"suggestion."+t}}if(void 0!==e.searchlet){if(!Array.isArray(e.searchlet))return"searchlet: array expected";for(var r=0;r<e.searchlet.length;++r){var t=a[7].verify(e.searchlet[r]);if(t)return"searchlet."+t}}if(void 0!==e.requirements&&null!==e.requirements){var t=a[8].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.suggestServer&&null!==e.suggestServer){var t=a[9].verify(e.suggestServer);if(t)return"suggestServer."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected");t.name=a[0].fromObject(e.name)}if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected");t.url=a[1].fromObject(e.url)}switch(e.type){case"RESULT_TYPE_KML":case 0:t.type=0;break;case"RESULT_TYPE_XML":case 1:t.type=1}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){if("object"!=typeof e.htmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected");t.htmlTransformUrl=a[3].fromObject(e.htmlTransformUrl)}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){if("object"!=typeof e.kmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected");t.kmlTransformUrl=a[4].fromObject(e.kmlTransformUrl)}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){if("object"!=typeof e.supplementalUi)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected");t.supplementalUi=a[5].fromObject(e.supplementalUi)}if(e.suggestion){if(!Array.isArray(e.suggestion))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected");t.suggestion=[];for(var r=0;r<e.suggestion.length;++r){if("object"!=typeof e.suggestion[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected");t.suggestion[r]=a[6].fromObject(e.suggestion[r])}}if(e.searchlet){if(!Array.isArray(e.searchlet))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected");t.searchlet=[];for(var r=0;r<e.searchlet.length;++r){if("object"!=typeof e.searchlet[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected");t.searchlet[r]=a[7].fromObject(e.searchlet[r])}}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected");t.requirements=a[8].fromObject(e.requirements)}if(void 0!==e.suggestServer&&null!==e.suggestServer){if("object"!=typeof e.suggestServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected");t.suggestServer=a[9].fromObject(e.suggestServer)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.suggestion=[],r.searchlet=[]),t.defaults&&(r.name=null,r.url=null,r.type=t.enums===String?"RESULT_TYPE_KML":0,r.htmlTransformUrl=null,r.kmlTransformUrl=null,r.supplementalUi=null,r.requirements=null,r.suggestServer=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=a[0].toObject(e.name,t)),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[1].toObject(e.url,t)),void 0!==e.type&&null!==e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?a[2][e.type]:e.type),void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl&&e.hasOwnProperty("htmlTransformUrl")&&(r.htmlTransformUrl=a[3].toObject(e.htmlTransformUrl,t)),void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl&&e.hasOwnProperty("kmlTransformUrl")&&(r.kmlTransformUrl=a[4].toObject(e.kmlTransformUrl,t)),void 0!==e.supplementalUi&&null!==e.supplementalUi&&e.hasOwnProperty("supplementalUi")&&(r.supplementalUi=a[5].toObject(e.supplementalUi,t)),void 0!==e.suggestion&&null!==e.suggestion&&e.hasOwnProperty("suggestion")){r.suggestion=[];for(var i=0;i<e.suggestion.length;++i)r.suggestion[i]=a[6].toObject(e.suggestion[i],t)}if(void 0!==e.searchlet&&null!==e.searchlet&&e.hasOwnProperty("searchlet")){r.searchlet=[];for(var i=0;i<e.searchlet.length;++i)r.searchlet[i]=a[7].toObject(e.searchlet[i],t)}return void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[8].toObject(e.requirements,t)),void 0!==e.suggestServer&&null!==e.suggestServer&&e.hasOwnProperty("suggestServer")&&(r.suggestServer=a[9].toObject(e.suggestServer,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.ResultType=function(){var e={},t=Object.create(e);return t.RESULT_TYPE_KML=0,t.RESULT_TYPE_XML=1,t}(),o.SupplementalUi=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.label=null,o.prototype.height=160;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.label=a[1].decode(e,e.uint32());break;case 3:o.height=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.label&&null!==e.label){
  448. var t=a[1].verify(e.label);if(t)return"label."+t}return void 0===e.height||r.isInteger(e.height)?null:"height: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");t.url=a[0].fromObject(e.url)}if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");t.label=a[1].fromObject(e.label)}return void 0!==e.height&&null!==e.height&&(t.height=0|e.height),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.label=null,r.height=160),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[1].toObject(e.label,t)),void 0!==e.height&&null!==e.height&&e.hasOwnProperty("height")&&(r.height=e.height),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.SearchletProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;case 3:a.requirements=o[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.name&&null!==e.name){var t=o[1].verify(e.name);if(t)return"name."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[2].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");t.name=o[1].fromObject(e.name)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");t.requirements=o[2].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[2].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.OneboxServiceProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.serviceUrl=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.serviceUrl=o[0].decode(e,e.uint32());break;case 2:a.requirements=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.serviceUrl&&null!==e.serviceUrl){var t=o[0].verify(e.serviceUrl);if(t)return"serviceUrl."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[1].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(void 0!==e.serviceUrl&&null!==e.serviceUrl){if("object"!=typeof e.serviceUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");t.serviceUrl=o[0].fromObject(e.serviceUrl)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");t.requirements=o[1].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serviceUrl=null,r.requirements=null),void 0!==e.serviceUrl&&null!==e.serviceUrl&&e.hasOwnProperty("serviceUrl")&&(r.serviceUrl=o[0].toObject(e.serviceUrl,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[1].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.SearchInfoProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.defaultUrl="http://maps.google.com/maps",i.prototype.geocodeParam="q",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.defaultUrl=e.string();break;case 2:o.geocodeParam=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.defaultUrl||r.isString(e.defaultUrl)?void 0===e.geocodeParam||r.isString(e.geocodeParam)?null:"geocodeParam: string expected":"defaultUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return void 0!==e.defaultUrl&&null!==e.defaultUrl&&(t.defaultUrl=String(e.defaultUrl)),void 0!==e.geocodeParam&&null!==e.geocodeParam&&(t.geocodeParam=String(e.geocodeParam)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.defaultUrl="http://maps.google.com/maps",r.geocodeParam="q"),void 0!==e.defaultUrl&&null!==e.defaultUrl&&e.hasOwnProperty("defaultUrl")&&(r.defaultUrl=e.defaultUrl),void 0!==e.geocodeParam&&null!==e.geocodeParam&&e.hasOwnProperty("geocodeParam")&&(r.geocodeParam=e.geocodeParam),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.RockTreeDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.FilmstripConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.requirements=null,o.prototype.alleycatUrlTemplate=null,o.prototype.fallbackAlleycatUrlTemplate=null,o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null,o.prototype.featuredToursUrl=null,o.prototype.enableViewportFallback=!1,o.prototype.viewportFallbackDistance=0,o.prototype.imageryType=r.emptyArray;var a={0:"keyhole.dbroot.RequirementProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.requirements=a[0].decode(e,e.uint32());break;case 2:o.alleycatUrlTemplate=a[1].decode(e,e.uint32());break;case 9:o.fallbackAlleycatUrlTemplate=a[2].decode(e,e.uint32());break;case 3:o.metadataUrlTemplate=a[3].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[4].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[5].decode(e,e.uint32());break;case 6:o.featuredToursUrl=a[6].decode(e,e.uint32());break;case 7:o.enableViewportFallback=e.bool();break;case 8:o.viewportFallbackDistance=e.uint32();break;case 10:o.imageryType&&o.imageryType.length||(o.imageryType=[]),o.imageryType.push(a[9].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[0].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){var t=a[1].verify(e.alleycatUrlTemplate);if(t)return"alleycatUrlTemplate."+t}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){var t=a[2].verify(e.fallbackAlleycatUrlTemplate);if(t)return"fallbackAlleycatUrlTemplate."+t}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[3].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[4].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[5].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){var t=a[6].verify(e.featuredToursUrl);if(t)return"featuredToursUrl."+t}if(void 0!==e.enableViewportFallback&&"boolean"!=typeof e.enableViewportFallback)return"enableViewportFallback: boolean expected";if(void 0!==e.viewportFallbackDistance&&!r.isInteger(e.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(void 0!==e.imageryType){if(!Array.isArray(e.imageryType))return"imageryType: array expected";for(var i=0;i<e.imageryType.length;++i){var t=a[9].verify(e.imageryType[i]);if(t)return"imageryType."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected");t.requirements=a[0].fromObject(e.requirements)}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){if("object"!=typeof e.alleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected");t.alleycatUrlTemplate=a[1].fromObject(e.alleycatUrlTemplate)}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){if("object"!=typeof e.fallbackAlleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected");t.fallbackAlleycatUrlTemplate=a[2].fromObject(e.fallbackAlleycatUrlTemplate)}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[3].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[4].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[5].fromObject(e.kmlUrlTemplate)}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){if("object"!=typeof e.featuredToursUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected");t.featuredToursUrl=a[6].fromObject(e.featuredToursUrl)}if(void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&(t.enableViewportFallback=Boolean(e.enableViewportFallback)),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&(t.viewportFallbackDistance=e.viewportFallbackDistance>>>0),e.imageryType){if(!Array.isArray(e.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");t.imageryType=[];for(var r=0;r<e.imageryType.length;++r){if("object"!=typeof e.imageryType[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected");t.imageryType[r]=a[9].fromObject(e.imageryType[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.imageryType=[]),t.defaults&&(r.requirements=null,r.alleycatUrlTemplate=null,r.fallbackAlleycatUrlTemplate=null,r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null,r.featuredToursUrl=null,r.enableViewportFallback=!1,r.viewportFallbackDistance=0),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[0].toObject(e.requirements,t)),void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate&&e.hasOwnProperty("alleycatUrlTemplate")&&(r.alleycatUrlTemplate=a[1].toObject(e.alleycatUrlTemplate,t)),void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate&&e.hasOwnProperty("fallbackAlleycatUrlTemplate")&&(r.fallbackAlleycatUrlTemplate=a[2].toObject(e.fallbackAlleycatUrlTemplate,t)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[3].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[4].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[5].toObject(e.kmlUrlTemplate,t)),void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl&&e.hasOwnProperty("featuredToursUrl")&&(r.featuredToursUrl=a[6].toObject(e.featuredToursUrl,t)),void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&e.hasOwnProperty("enableViewportFallback")&&(r.enableViewportFallback=e.enableViewportFallback),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&e.hasOwnProperty("viewportFallbackDistance")&&(r.viewportFallbackDistance=e.viewportFallbackDistance),void 0!==e.imageryType&&null!==e.imageryType&&e.hasOwnProperty("imageryType")){r.imageryType=[];for(var i=0;i<e.imageryType.length;++i)r.imageryType[i]=a[9].toObject(e.imageryType[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.AlleycatImageryTypeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageryTypeId=0,o.prototype.imageryTypeLabel="",o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null;var a={2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageryTypeId=e.int32();break;case 2:o.imageryTypeLabel=e.string();break;case 3:o.metadataUrlTemplate=a[2].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[3].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[4].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageryTypeId&&!r.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(void 0!==e.imageryTypeLabel&&!r.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[2].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[3].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[4].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&(t.imageryTypeId=0|e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&(t.imageryTypeLabel=String(e.imageryTypeLabel)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[2].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[3].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[4].fromObject(e.kmlUrlTemplate)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.imageryTypeId=0,r.imageryTypeLabel="",r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null),void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&e.hasOwnProperty("imageryTypeId")&&(r.imageryTypeId=e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&e.hasOwnProperty("imageryTypeLabel")&&(r.imageryTypeLabel=e.imageryTypeLabel),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[2].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[3].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[4].toObject(e.kmlUrlTemplate,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.StarDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.DbRootRefProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url="",o.prototype.isCritical=!1,o.prototype.requirements=null;var a={2:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootRefProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 2:o.url=e.string();break;case 1:o.isCritical=e.bool();break;case 3:o.requirements=a[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.url))return"url: string expected";if(void 0!==e.isCritical&&"boolean"!=typeof e.isCritical)return"isCritical: boolean expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[2].verify(e.requirements);if(t)return"requirements."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootRefProto)return e;var t=new n.keyhole.dbroot.DbRootRefProto;if(void 0!==e.url&&null!==e.url&&(t.url=String(e.url)),void 0!==e.isCritical&&null!==e.isCritical&&(t.isCritical=Boolean(e.isCritical)),void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=a[2].fromObject(e.requirements)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url="",r.isCritical=!1,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=e.url),void 0!==e.isCritical&&null!==e.isCritical&&e.hasOwnProperty("isCritical")&&(r.isCritical=e.isCritical),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[2].toObject(e.requirements,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.DatabaseVersionProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.quadtreeVersion=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseVersionProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.quadtreeVersion=e.uint32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseVersionProto)return e;var t=new n.keyhole.dbroot.DatabaseVersionProto;return void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&(t.quadtreeVersion=e.quadtreeVersion>>>0),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.quadtreeVersion=0),void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&e.hasOwnProperty("quadtreeVersion")&&(r.quadtreeVersion=e.quadtreeVersion),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.imageryPresent=!0,o.prototype.protoImagery=!1,o.prototype.terrainPresent=!1,o.prototype.providerInfo=r.emptyArray,o.prototype.nestedFeature=r.emptyArray,o.prototype.styleAttribute=r.emptyArray,o.prototype.styleMap=r.emptyArray,o.prototype.endSnippet=null,o.prototype.translationEntry=r.emptyArray,o.prototype.language="en",o.prototype.version=5,o.prototype.dbrootReference=r.emptyArray,o.prototype.databaseVersion=null,o.prototype.refreshTimeout=0;var a={0:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.ProviderInfoProto",5:"keyhole.dbroot.NestedFeatureProto",6:"keyhole.dbroot.StyleAttributeProto",7:"keyhole.dbroot.StyleMapProto",8:"keyhole.dbroot.EndSnippetProto",9:"keyhole.dbroot.StringEntryProto",12:"keyhole.dbroot.DbRootRefProto",13:"keyhole.dbroot.DatabaseVersionProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 15:o.databaseName=a[0].decode(e,e.uint32());break;case 1:o.imageryPresent=e.bool();break;case 14:o.protoImagery=e.bool();break;case 2:o.terrainPresent=e.bool();break;case 3:o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(a[4].decode(e,e.uint32()));break;case 4:o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(a[5].decode(e,e.uint32()));break;case 5:o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(a[6].decode(e,e.uint32()));break;case 6:o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(a[7].decode(e,e.uint32()));break;case 7:o.endSnippet=a[8].decode(e,e.uint32());break;case 8:o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(a[9].decode(e,e.uint32()));break;case 9:o.language=e.string();break;case 10:o.version=e.int32();break;case 11:o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(a[12].decode(e,e.uint32()));break;case 13:o.databaseVersion=a[13].decode(e,e.uint32());break;case 16:o.refreshTimeout=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}if(void 0!==e.imageryPresent&&"boolean"!=typeof e.imageryPresent)return"imageryPresent: boolean expected";if(void 0!==e.protoImagery&&"boolean"!=typeof e.protoImagery)return"protoImagery: boolean expected";if(void 0!==e.terrainPresent&&"boolean"!=typeof e.terrainPresent)return"terrainPresent: boolean expected";if(void 0!==e.providerInfo){if(!Array.isArray(e.providerInfo))return"providerInfo: array expected";for(var i=0;i<e.providerInfo.length;++i){var t=a[4].verify(e.providerInfo[i]);if(t)return"providerInfo."+t}}if(void 0!==e.nestedFeature){if(!Array.isArray(e.nestedFeature))return"nestedFeature: array expected";for(var i=0;i<e.nestedFeature.length;++i){var t=a[5].verify(e.nestedFeature[i]);if(t)return"nestedFeature."+t}}if(void 0!==e.styleAttribute){if(!Array.isArray(e.styleAttribute))return"styleAttribute: array expected";for(var i=0;i<e.styleAttribute.length;++i){var t=a[6].verify(e.styleAttribute[i]);if(t)return"styleAttribute."+t}}if(void 0!==e.styleMap){if(!Array.isArray(e.styleMap))return"styleMap: array expected";for(var i=0;i<e.styleMap.length;++i){var t=a[7].verify(e.styleMap[i]);if(t)return"styleMap."+t}}if(void 0!==e.endSnippet&&null!==e.endSnippet){var t=a[8].verify(e.endSnippet);if(t)return"endSnippet."+t}if(void 0!==e.translationEntry){if(!Array.isArray(e.translationEntry))return"translationEntry: array expected";for(var i=0;i<e.translationEntry.length;++i){var t=a[9].verify(e.translationEntry[i]);if(t)return"translationEntry."+t}}if(void 0!==e.language&&!r.isString(e.language))return"language: string expected";if(void 0!==e.version&&!r.isInteger(e.version))return"version: integer expected";if(void 0!==e.dbrootReference){if(!Array.isArray(e.dbrootReference))return"dbrootReference: array expected";for(var i=0;i<e.dbrootReference.length;++i){var t=a[12].verify(e.dbrootReference[i]);if(t)return"dbrootReference."+t}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){var t=a[13].verify(e.databaseVersion);if(t)return"databaseVersion."+t}return void 0===e.refreshTimeout||r.isInteger(e.refreshTimeout)?null:"refreshTimeout: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootProto)return e;var t=new n.keyhole.dbroot.DbRootProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DbRootProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}if(void 0!==e.imageryPresent&&null!==e.imageryPresent&&(t.imageryPresent=Boolean(e.imageryPresent)),void 0!==e.protoImagery&&null!==e.protoImagery&&(t.protoImagery=Boolean(e.protoImagery)),void 0!==e.terrainPresent&&null!==e.terrainPresent&&(t.terrainPresent=Boolean(e.terrainPresent)),e.providerInfo){if(!Array.isArray(e.providerInfo))throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: array expected");t.providerInfo=[];for(var r=0;r<e.providerInfo.length;++r){if("object"!=typeof e.providerInfo[r])throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: object expected");t.providerInfo[r]=a[4].fromObject(e.providerInfo[r])}}if(e.nestedFeature){if(!Array.isArray(e.nestedFeature))throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: array expected");t.nestedFeature=[];for(var r=0;r<e.nestedFeature.length;++r){if("object"!=typeof e.nestedFeature[r])throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: object expected");t.nestedFeature[r]=a[5].fromObject(e.nestedFeature[r])}}if(e.styleAttribute){if(!Array.isArray(e.styleAttribute))throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: array expected");t.styleAttribute=[]
  449. ;for(var r=0;r<e.styleAttribute.length;++r){if("object"!=typeof e.styleAttribute[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: object expected");t.styleAttribute[r]=a[6].fromObject(e.styleAttribute[r])}}if(e.styleMap){if(!Array.isArray(e.styleMap))throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: array expected");t.styleMap=[];for(var r=0;r<e.styleMap.length;++r){if("object"!=typeof e.styleMap[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: object expected");t.styleMap[r]=a[7].fromObject(e.styleMap[r])}}if(void 0!==e.endSnippet&&null!==e.endSnippet){if("object"!=typeof e.endSnippet)throw TypeError(".keyhole.dbroot.DbRootProto.endSnippet: object expected");t.endSnippet=a[8].fromObject(e.endSnippet)}if(e.translationEntry){if(!Array.isArray(e.translationEntry))throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: array expected");t.translationEntry=[];for(var r=0;r<e.translationEntry.length;++r){if("object"!=typeof e.translationEntry[r])throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: object expected");t.translationEntry[r]=a[9].fromObject(e.translationEntry[r])}}if(void 0!==e.language&&null!==e.language&&(t.language=String(e.language)),void 0!==e.version&&null!==e.version&&(t.version=0|e.version),e.dbrootReference){if(!Array.isArray(e.dbrootReference))throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: array expected");t.dbrootReference=[];for(var r=0;r<e.dbrootReference.length;++r){if("object"!=typeof e.dbrootReference[r])throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: object expected");t.dbrootReference[r]=a[12].fromObject(e.dbrootReference[r])}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){if("object"!=typeof e.databaseVersion)throw TypeError(".keyhole.dbroot.DbRootProto.databaseVersion: object expected");t.databaseVersion=a[13].fromObject(e.databaseVersion)}return void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&(t.refreshTimeout=0|e.refreshTimeout),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.providerInfo=[],r.nestedFeature=[],r.styleAttribute=[],r.styleMap=[],r.translationEntry=[],r.dbrootReference=[]),t.defaults&&(r.databaseName=null,r.imageryPresent=!0,r.protoImagery=!1,r.terrainPresent=!1,r.endSnippet=null,r.language="en",r.version=5,r.databaseVersion=null,r.refreshTimeout=0),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.imageryPresent&&null!==e.imageryPresent&&e.hasOwnProperty("imageryPresent")&&(r.imageryPresent=e.imageryPresent),void 0!==e.protoImagery&&null!==e.protoImagery&&e.hasOwnProperty("protoImagery")&&(r.protoImagery=e.protoImagery),void 0!==e.terrainPresent&&null!==e.terrainPresent&&e.hasOwnProperty("terrainPresent")&&(r.terrainPresent=e.terrainPresent),void 0!==e.providerInfo&&null!==e.providerInfo&&e.hasOwnProperty("providerInfo")){r.providerInfo=[];for(var i=0;i<e.providerInfo.length;++i)r.providerInfo[i]=a[4].toObject(e.providerInfo[i],t)}if(void 0!==e.nestedFeature&&null!==e.nestedFeature&&e.hasOwnProperty("nestedFeature")){r.nestedFeature=[];for(var i=0;i<e.nestedFeature.length;++i)r.nestedFeature[i]=a[5].toObject(e.nestedFeature[i],t)}if(void 0!==e.styleAttribute&&null!==e.styleAttribute&&e.hasOwnProperty("styleAttribute")){r.styleAttribute=[];for(var i=0;i<e.styleAttribute.length;++i)r.styleAttribute[i]=a[6].toObject(e.styleAttribute[i],t)}if(void 0!==e.styleMap&&null!==e.styleMap&&e.hasOwnProperty("styleMap")){r.styleMap=[];for(var i=0;i<e.styleMap.length;++i)r.styleMap[i]=a[7].toObject(e.styleMap[i],t)}if(void 0!==e.endSnippet&&null!==e.endSnippet&&e.hasOwnProperty("endSnippet")&&(r.endSnippet=a[8].toObject(e.endSnippet,t)),void 0!==e.translationEntry&&null!==e.translationEntry&&e.hasOwnProperty("translationEntry")){r.translationEntry=[];for(var i=0;i<e.translationEntry.length;++i)r.translationEntry[i]=a[9].toObject(e.translationEntry[i],t)}if(void 0!==e.language&&null!==e.language&&e.hasOwnProperty("language")&&(r.language=e.language),void 0!==e.version&&null!==e.version&&e.hasOwnProperty("version")&&(r.version=e.version),void 0!==e.dbrootReference&&null!==e.dbrootReference&&e.hasOwnProperty("dbrootReference")){r.dbrootReference=[];for(var i=0;i<e.dbrootReference.length;++i)r.dbrootReference[i]=a[12].toObject(e.dbrootReference[i],t)}return void 0!==e.databaseVersion&&null!==e.databaseVersion&&e.hasOwnProperty("databaseVersion")&&(r.databaseVersion=a[13].toObject(e.databaseVersion,t)),void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&e.hasOwnProperty("refreshTimeout")&&(r.refreshTimeout=e.refreshTimeout),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EncryptedDbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.encryptionType=0,o.prototype.encryptionData=r.newBuffer([]),o.prototype.dbrootData=r.newBuffer([]);var a={0:"keyhole.dbroot.EncryptedDbRootProto.EncryptionType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EncryptedDbRootProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.encryptionType=e.uint32();break;case 2:o.encryptionData=e.bytes();break;case 3:o.dbrootData=e.bytes();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.encryptionType)switch(e.encryptionType){default:return"encryptionType: enum value expected";case 0:}return void 0===e.encryptionData||e.encryptionData&&"number"==typeof e.encryptionData.length||r.isString(e.encryptionData)?void 0===e.dbrootData||e.dbrootData&&"number"==typeof e.dbrootData.length||r.isString(e.dbrootData)?null:"dbrootData: buffer expected":"encryptionData: buffer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EncryptedDbRootProto)return e;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(e.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0}return void 0!==e.encryptionData&&null!==e.encryptionData&&("string"==typeof e.encryptionData?r.base64.decode(e.encryptionData,t.encryptionData=r.newBuffer(r.base64.length(e.encryptionData)),0):e.encryptionData.length&&(t.encryptionData=e.encryptionData)),void 0!==e.dbrootData&&null!==e.dbrootData&&("string"==typeof e.dbrootData?r.base64.decode(e.dbrootData,t.dbrootData=r.newBuffer(r.base64.length(e.dbrootData)),0):e.dbrootData.length&&(t.dbrootData=e.dbrootData)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,i.encryptionData=t.bytes===String?"":[],i.dbrootData=t.bytes===String?"":[]),void 0!==e.encryptionType&&null!==e.encryptionType&&e.hasOwnProperty("encryptionType")&&(i.encryptionType=t.enums===String?a[0][e.encryptionType]:e.encryptionType),void 0!==e.encryptionData&&null!==e.encryptionData&&e.hasOwnProperty("encryptionData")&&(i.encryptionData=t.bytes===String?r.base64.encode(e.encryptionData,0,e.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(e.encryptionData):e.encryptionData),void 0!==e.dbrootData&&null!==e.dbrootData&&e.hasOwnProperty("dbrootData")&&(i.dbrootData=t.bytes===String?r.base64.encode(e.dbrootData,0,e.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(e.dbrootData):e.dbrootData),i},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.EncryptionType=function(){var e={},t=Object.create(e);return t.ENCRYPTION_XOR=0,t}(),o}(),o}(),o}(),r.lazyResolve(n,i),n.keyhole.dbroot}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!=(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function r(e,t,r,i,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=r,this.terrainVersion=i,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var i=[1,2,4,8];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;d<c;++d){var h=u[d],p=h.copyrightString;a(p)&&(l[h.providerId]=new n(p.value))}}).otherwise(function(){console.log("Failed to retrieve "+r+". Using defaults."),t.key=C})}var C=function(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r),n=0;n<t;++n)i[n]=e.charCodeAt(n);return r}('Eô½\vyâjE"’,ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½NuàA[ß@V\fÙ»r›|3SîOlÔq°{ÀEVZ­wUe\v3’*¬l5Å0sø3>mF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Pú[/F›n5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUœýKÆâŸ/(íË\\Æ-fˆ§;/*"N°k.Ý\r•}}GºC²²+>Mª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');s(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},readyPromise:{get:function(){return this._readyPromise}}}),v.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<<n,a=0;u(t,o)?u(e,o)&&(a|=1):(a|=2,u(e,o)||(a|=1)),i+=a}return i},v.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];u(a,2)?u(a,1)||(t|=o):(r|=o,u(a,1)&&(t|=o))}return{x:t,y:r,level:i}},v.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(a(t))return null!==t;for(var r,i=!0,n=e;n.length>1;){if(r=n.substring(n.length-1),n=n.substring(0,n.length-1),t=this.getTileInformationFromQuadKey(n),a(t)){t.hasSubtree()||t.hasChild(parseInt(r))||(i=!1);break}if(null===t){i=!1;break}}return i};var w=new 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;s<a;++s){var c=o[s];if(null!==t[c]){var d=l.clone(t[c]),h=c.length;if(h===i)d.setParent(r);else if(h>1){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<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,T),f=o.decodeTextureCoordinates(n,d,E),m=o.decodeTextureCoordinates(n,h,x),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,P);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function y(e,t,r,i){var n=e._buffer,o=0,a=0,s=0;r>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),d=0,h=0;h<o;++h)d+=l.getUint32(d,!0),d+=D;d+=D,d+=2*M;var p=c.toRadians(180*l.getFloat64(d,!0));d+=M;var f=c.toRadians(180*l.getFloat64(d,!0));d+=M;var m=i.width/p/2,g=i.height/f/2,v=l.getInt32(d,!0);d+=I;var _=3*l.getInt32(d,!0);d+=I,d+=I;var y,b=new Array(v),C=new Array(v),w=new Array(v);for(y=0;y<v;++y)b[y]=a+l.getUint8(d++)*m,C[y]=s+l.getUint8(d++)*g,w[y]=6371010*l.getFloat32(d,!0),d+=O;var S=new Array(_);for(y=0;y<_;++y)S[y]=l.getUint16(d,!0),d+=A;for(y=0;y<_;y+=3){var T=S[y],E=S[y+1],x=S[y+2],R=b[T],L=b[E],N=b[x],k=C[T],F=C[E],B=C[x],U=u.computeBarycentricCoordinates(t,r,R,k,L,F,N,B,P);if(U.x>=-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<<i);this._skirtHeight=Math.min(8*u,1e3);var c=b.scheduleTask({buffer:this._buffer,nativeRectangle:C,rectangle:w,relativeToCenter:l,ellipsoid:s,skirtHeight:this._skirtHeight,exaggeration:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(o(c)){var d=this;return c.then(function(e){return d._mesh=new g(l,new Float32Array(e.vertices),new Uint16Array(e.indices),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,m.clone(e.encoding),a),d._vertexCountWithoutSkirts=e.vertexCountWithoutSkirts,d._skirtIndex=e.skirtIndex,d._minimumHeight=e.minimumHeight,d._maximumHeight=e.maximumHeight,d._buffer=void 0,d._mesh})}},v.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1),n=c.clamp((r-e.south)/e.height,0,1);return o(this._mesh)?_(this,i,n):y(this,i,n,e)};var S=new f("upsampleQuantizedTerrainMesh");v.prototype.upsample=function(t,i,n,a,s,u,c){var p=this._mesh;if(o(this._mesh)){var f=2*i!==s,m=2*n===u,g=t.ellipsoid,v=t.tileXYToRectangle(s,u,c),_=S.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:m,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(_)){var y=this;return _.then(function(t){var i=new Uint16Array(t.vertices),n=l.createTypedArray(i.length/3,t.indices),o=y._skirtHeight;return new h({quantizedVertices:i,indices:n,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,boundingSphere:e.clone(t.boundingSphere),orientedBoundingBox:d.clone(t.orientedBoundingBox),horizonOcclusionPoint:r.clone(t.horizonOcclusionPoint),westIndices:t.westIndices,southIndices:t.southIndices,eastIndices:t.eastIndices,northIndices:t.northIndices,westSkirtHeight:o,southSkirtHeight:o,eastSkirtHeight:o,northSkirtHeight:o,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})}}},v.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},v.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var T=new t,E=new t,x=new t,P=new r,A=Uint16Array.BYTES_PER_ELEMENT,D=Uint32Array.BYTES_PER_ELEMENT,I=Int32Array.BYTES_PER_ELEMENT,O=Float32Array.BYTES_PER_ELEMENT,M=Float64Array.BYTES_PER_ELEMENT;return v}),define("Core/GoogleEarthEnterpriseTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./GoogleEarthEnterpriseMetadata","./GoogleEarthEnterpriseTerrainData","./HeightmapTerrainData","./JulianDate","./loadArrayBuffer","./Math","./Rectangle","./Request","./RequestState","./RequestType","./RuntimeError","./TaskProcessor","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(){this._terrainCache={},this._lastTidy=d.now()}function w(n){n=r(n,{});var o;o=i(n.metadata)?this._metadata=n.metadata:this._metadata=new l({url:n.url,proxy:n.proxy}),this._proxy=r(n.proxy,this._metadata.proxy),this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new f(-p.PI,-p.PI,p.PI,p.PI),ellipsoid:n.ellipsoid});var u=n.credit;"string"==typeof u&&(u=new t(u)),this._credit=u,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new C,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new a,this._ready=!1;var c,d=this;this._readyPromise=o.readyPromise.then(function(t){if(!o.terrainPresent){var r=new _("The server "+o.url+" doesn't have terrain");return c=b.handleError(c,d,d._errorEvent,r.message,void 0,void 0,void 0,r),e.reject(r)}return b.handleSuccess(c),d._ready=t,t}).otherwise(function(t){return c=b.handleError(c,d,d._errorEvent,t.message,void 0,void 0,void 0,t),e.reject(t)})}function S(e,t,r){var n=t.getChildBitmask();if(t.terrainState===E.PARENT){n=0;for(var o=0;o<4;++o){var a=r.getTileInformationFromQuadKey(e+o.toString());i(a)&&a.hasTerrain()&&(n|=1<<o)}}return n}function T(e,t,r){r=i(r)&&r>0?r:1;var n=e.url+"flatfile?f1c-0"+t+"-t."+r.toString(),o=e._proxy;return i(o)&&(n=o.getURL(n)),n}var 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;i<r;++i){var n=t[i],o=e[n];d.secondsDifference(x,o.timestamp)>10&&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;o<n;++o){var a=b+o.toString(),l=d.getTileInformationFromQuadKey(a);i(l)&&(s.add(a,e[o+1]),l.terrainState=E.PARENT,0===l.terrainProvider&&(l.terrainProvider=r))}}):e.reject(new _("Failed to load terrain."))}),A[b]=w,D[b]=x,w=w.always(function(){delete A[b],delete D[b]})}return w.then(function(){var t=s.get(a);if(i(t)){var r=d.providers[p.terrainProvider];return new u({buffer:t,childTileMask:S(a,p,d),credits:i(r)?[r]:void 0,negativeAltitudeExponentBias:d.negativeAltitudeExponentBias,negativeElevationThreshold:d.negativeAltitudeThreshold})}return e.reject(new _("Failed to load terrain."))}).otherwise(function(t){return x.state===g.CANCELLED?(o.state=x.state,e.reject(t)):(p.terrainState=E.NONE,e.reject(t))})},w.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},w.prototype.getTileDataAvailable=function(e,t,r){var n=this._metadata,o=l.tileXYToQuadKey(e,t,r),a=n.getTileInformation(e,t,r);if(null===a)return!1;if(i(a)){if(!a.ancestorHasTerrain)return!0;var s=a.terrainState;if(s===E.NONE)return!1;if(!(i(s)&&s!==E.UNKNOWN||(a.terrainState=E.UNKNOWN,a.hasTerrain()))){o=o.substring(0,o.length-1);var u=n.getTileInformationFromQuadKey(o);if(!i(u)||!u.hasTerrain())return!1}return!0}if(n.isValid(o)){var c=new m({throttle:!0,throttleByServer:!0,type:v.TERRAIN});n.populateSubtree(e,t,r,c)}return!1},w}),define("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function r(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.range=e(i,0)}return r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.heading=e.heading,i.pitch=e.pitch,i.range=e.range,i},r}),define("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(e,t,r,i,o,a){var s,l,u,c=0;if(i>0){for(l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,r,i-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-r[t[l]])}return c}function o(e,t,r,n,o,a){for(var s,l,u=-1,c=t.length,d=c*(c+1)/2,h=0;h<o;h++){var p=Math.floor(h*d);for(s=0;s<c;s++)l=t[s]*o*(a+1)+h,e[p+s]=n[l];for(var f=1;f<c;f++){var m=0,g=Math.floor(f*(1-f)/2)+c*f,v=!1;for(s=0;s<c-f;s++){var _,y,b=r[t[s]],C=r[t[s+f]];if(C-b<=0)l=t[s]*o*(a+1)+o*f+h,_=n[l],y=_/i.factorial(f),e[p+g+m]=y,m++;else{var w=Math.floor((f-1)*(2-f)/2)+c*(f-1);_=e[p+w+s+1]-e[p+w+s],y=_/(C-b),e[p+g+m]=y,m++}v=v||0!==_}v&&(u=Math.max(u,f))}}return u}var a=i.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,r){return r=e(r,0),Math.max(Math.floor((t+1)/(r+1)),2)},s.interpolateOrderZero=function(e,r,i,o,s){t(s)||(s=new Array(o));var l,u,c,d,h,p,f=r.length,m=new Array(o);for(l=0;l<o;l++){s[l]=0;var g=new Array(f);for(m[l]=g,u=0;u<f;u++)g[u]=[]}var v=f,_=new Array(v);for(l=0;l<v;l++)_[l]=l;var y=f-1;for(d=0;d<o;d++){for(u=0;u<v;u++)p=_[u]*o+d,m[d][0].push(i[p]);for(l=1;l<v;l++){var b=!1;for(u=0;u<v-l;u++){var C,w=r[_[u]],S=r[_[u+l]];S-w<=0?(p=_[u]*o+o*l+d,C=i[p],m[d][l].push(C/a(l))):(C=m[d][l-1][u+1]-m[d][l-1][u],m[d][l].push(C/(S-w))),b=b||0!==C}b||(y=l-1)}}for(c=0,h=0;c<=h;c++)for(l=c;l<=y;l++){var T=n(e,_,r,c,l,[]);for(d=0;d<o;d++){var E=m[d][l][0];s[d+c*o]+=E*T}}return s};var l=[];return s.interpolate=function(e,r,i,a,s,u,c){var d=a*(u+1);t(c)||(c=new Array(d));for(var h=0;h<d;h++)c[h]=0;var p,f=r.length,m=new Array(f*(s+1));for(p=0;p<f;p++)for(var g=0;g<s+1;g++)m[p*(s+1)+g]=p;for(var v=m.length,_=l,y=o(_,m,r,i,a,s),b=[],C=v*(v+1)/2,w=Math.min(y,u),S=0;S<=w;S++)for(p=S;p<=y;p++){b.length=0;for(var T=n(e,m,r,S,p,b),E=Math.floor(p*(1-p)/2)+v*p,x=0;x<a;x++){var P=Math.floor(x*C),A=_[P+E];c[x+S*a]+=A*T}}return c},s}),define("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i}return e}),define("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=-.0529921,s=-.1059842,l=13.0120009,u=13.3407154,c=26.4057084,d=13.064993,h=1.7484877,p=new r;return o.ComputeMoon=function(o,f){e(o)||(o=r.now()),p=r.addSeconds(o,32.184,p);var m=r.totalDays(p)-2451545,g=m/n.DAYS_PER_JULIAN_CENTURY,v=(125.045+a*m)*i.RADIANS_PER_DEGREE,_=(250.089+s*m)*i.RADIANS_PER_DEGREE,y=(260.008+l*m)*i.RADIANS_PER_DEGREE,b=(176.625+u*m)*i.RADIANS_PER_DEGREE,C=(357.529+.9856003*m)*i.RADIANS_PER_DEGREE,w=(311.589+c*m)*i.RADIANS_PER_DEGREE,S=(134.963+d*m)*i.RADIANS_PER_DEGREE,T=(276.617+.3287146*m)*i.RADIANS_PER_DEGREE,E=(34.226+h*m)*i.RADIANS_PER_DEGREE,x=(15.134+-.1589763*m)*i.RADIANS_PER_DEGREE,P=(119.743+.0036096*m)*i.RADIANS_PER_DEGREE,A=(239.961+.1643573*m)*i.RADIANS_PER_DEGREE,D=(25.053+12.9590088*m)*i.RADIANS_PER_DEGREE,I=Math.sin(v),O=Math.sin(_),M=Math.sin(y),R=Math.sin(b),L=Math.sin(C),N=Math.sin(w),k=Math.sin(S),F=Math.sin(T),B=Math.sin(E),U=Math.sin(x),V=Math.sin(P),z=Math.sin(A),G=Math.sin(D),H=Math.cos(v),W=Math.cos(_),j=Math.cos(y),q=Math.cos(b),Y=Math.cos(C),X=Math.cos(w),Q=Math.cos(S),Z=Math.cos(T),K=Math.cos(E),J=Math.cos(x),$=Math.cos(P),ee=Math.cos(A),te=Math.cos(D),re=(269.9949+.0031*g-3.8787*I-.1204*O+.07*M-.0172*R+.0072*N-.0052*U+.0043*G)*i.RADIANS_PER_DEGREE,ie=(66.5392+.013*g+1.5419*H+.0239*W-.0278*j+.0068*q-.0029*X+9e-4*Q+8e-4*J-9e-4*te)*i.RADIANS_PER_DEGREE,ne=(38.3213+13.17635815*m-1.4e-12*m*m+3.561*I+.1208*O-.0642*M+.0158*R+.0252*L-.0066*N-.0047*k-.0046*F+.0028*B+.0052*U+.004*V+.0019*z-.0044*G)*i.RADIANS_PER_DEGREE,oe=(13.17635815-2*m*1.4e-12+3.561*H*a+.1208*W*s-.0642*j*l+.0158*q*u+.0252*Y*.9856003-.0066*X*c-.0047*Q*d-.0046*Z*.3287146+.0028*K*h+.0052*J*-.1589763+.004*$*.0036096+.0019*ee*.1643573-.0044*te*12.9590088)/86400*i.RADIANS_PER_DEGREE;return e(f)||(f=new t),f.rightAscension=re,f.declination=ie,f.rotation=ne,f.rotationRate=oe,f},o}),define("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e}function l(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),h=d;h.x=l*Math.cos(r),h.y=l*Math.sin(r),h.z=Math.sin(i);var p=e.cross(h,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=h.x,a[3]=s.y,a[4]=p.y,a[5]=h.y,a[6]=s.z,a[7]=p.z,a[8]=h.z,a}var u=new e,c=new e,d=new e,h=new o,p=new a;return s.prototype.evaluate=function(r,s){t(r)||(r=i.now());var u=this._computeFunction(r),c=l(u.rightAscension,u.declination,s),d=n.zeroToTwoPi(u.rotation),f=a.fromAxisAngle(e.UNIT_Z,d,p),m=o.fromQuaternion(a.conjugate(f,f),h);return o.multiply(m,c,c)},s}),define("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),define("Core/TimeInterval",["./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./JulianDate"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.start=r(e.start)?o.clone(e.start):new o,this.stop=r(e.stop)?o.clone(e.stop):new o,this.data=e.data,this.isStartIncluded=t(e.isStartIncluded,!0),this.isStopIncluded=t(e.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(e,i){
  450. var n=e.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=t(e.isStartIncluded,!0),d=t(e.isStopIncluded,!0),h=e.data;return r(i)?(i.start=l,i.stop=u,i.isStartIncluded=c,i.isStopIncluded=d,i.data=h,i):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=d,s.data=h,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,t){if(r(e))return r(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new a(e)},a.equals=function(e,t,i){return e===t||r(e)&&r(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&o.equals(e.start,t.start)&&o.equals(e.stop,t.stop)&&(e.data===t.data||r(i)&&i(e.data,t.data)))},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&o.equalsEpsilon(e.start,t.start,i)&&o.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||r(n)&&n(e.data,t.data)))},a.intersect=function(e,t,i,n){if(!r(t))return a.clone(a.EMPTY,i);var s=e.start,l=e.stop,u=t.start,c=t.stop,d=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),h=!d&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!d&&!h)return a.clone(a.EMPTY,i);var p=e.isStartIncluded,f=e.isStopIncluded,m=t.isStartIncluded,g=t.isStopIncluded,v=o.lessThan(l,c);return i.start=d?u:s,i.isStartIncluded=p&&m||!o.equals(u,s)&&(d&&m||h&&p),i.stop=v?l:c,i.isStopIncluded=v?f:f&&g||!o.equals(c,l)&&g,i.data=r(n)?n(e.data,t.data):e.data,i},a.contains=function(e,t){if(e.isEmpty)return!1;var r=o.compare(e.start,t);if(0===r)return e.isStartIncluded;var i=o.compare(t,e.stop);return 0===i?e.isStopIncluded:r<0&&i<0},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),define("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z"));return{MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:e(new r({start:i,stop:n}))}}),define("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";return e({SHIFT:0,CTRL:1,ALT:2})}),define("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;a<n;a++)o[a]=0;for(a=0;a<l;a++){var u=1;for(s=0;s<l;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;s<n;s++)o[s]+=u*i[a*n+s]}return o},t}),define("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var r={type:"Linear"};return r.getRequiredDataPoints=function(e){return 2},r.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;a<n;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},r}),define("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";function t(t,r,i){return e({url:t,responseType:"blob",headers:r,request:i})}return t}),define("Core/loadCRN",["../ThirdParty/when","./CompressedTextureBuffer","./defined","./DeveloperError","./loadArrayBuffer","./TaskProcessor"],function(e,t,r,i,n,o){"use strict";function a(i,o,a){var l;if(l=i instanceof ArrayBuffer||ArrayBuffer.isView(i)?e.resolve(i):n(i,o,a),r(l))return l.then(function(e){var t=[];return e instanceof ArrayBuffer?t.push(e):0===e.byteOffset&&e.byteLength===e.buffer.byteLength?t.push(e.buffer):(e=e.slice(0,e.length),t.push(e.buffer)),s.scheduleTask(e,t)}).then(function(e){return t.clone(e)})}var s=new o("transcodeCRNToDXT",Number.POSITIVE_INFINITY);return a});define("Core/loadImage",["../ThirdParty/when","./Check","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","./isDataUri","./Request","./RequestScheduler","./TrustedServers"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,n,u){return n=r(n,!0),u=i(u)?u:new s,u.url=t,u.requestFunction=function(){var r;r=!(a(t)||!n)&&o(t);var i=e.defer();return c.createImage(t,r,i),i.promise},l.request(u)}return c.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(u.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},c.defaultCreateImage=c.createImage,c}),define("Core/loadImageFromTypedArray",["../ThirdParty/when","./Check","./defined","./DeveloperError","./loadImage"],function(e,t,r,i,n){"use strict";function o(t,r,i){var o=new Blob([t],{type:r}),a=window.URL.createObjectURL(o);return n(a,!1,i).then(function(e){return window.URL.revokeObjectURL(a),e},function(t){return window.URL.revokeObjectURL(a),e.reject(t)})}return o}),define("Core/loadImageViaBlob",["../ThirdParty/when","./defined","./isDataUri","./loadBlob","./loadImage"],function(e,t,r,i,n){"use strict";function o(o,s){if(!a||r(o))return n(o,void 0,s);var l=i(o,void 0,s);if(t(l))return l.then(function(t){var r=window.URL.createObjectURL(t);return n(r,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var a=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();return o}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,isPacked:function(e){return e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case r.UNSIGNED_BYTE:return 1;case r.UNSIGNED_SHORT:case r.UNSIGNED_SHORT_4_4_4_4:case r.UNSIGNED_SHORT_5_5_5_1:case r.UNSIGNED_SHORT_5_6_5:return 2;case r.UNSIGNED_INT:case r.FLOAT:case r.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT||e===r.FLOAT||e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5}};return e(r)}),define("Core/PixelFormat",["../Renderer/PixelDatatype","./freezeObject","./WebGLConstants"],function(e,t,r){"use strict";var i={DEPTH_COMPONENT:r.DEPTH_COMPONENT,DEPTH_STENCIL:r.DEPTH_STENCIL,ALPHA:r.ALPHA,RGB:r.RGB,RGBA:r.RGBA,LUMINANCE:r.LUMINANCE,LUMINANCE_ALPHA:r.LUMINANCE_ALPHA,RGB_DXT1:r.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:r.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:r.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:r.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:r.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case i.RGB:case i.RGBA:return 4;case i.LUMINANCE_ALPHA:return 2;case i.ALPHA:case i.LUMINANCE:default:return 1}},validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA||e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL},isCompressedFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isDXTFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5},isPVRTCFormat:function(e){return e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===i.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,r){switch(e){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(t,r,n,o){var a=i.componentsLength(t);return e.isPacked(r)&&(a=1),a*e.sizeInBytes(r)*n*o}};return t(i)}),define("Core/loadKTX",["../ThirdParty/when","./Check","./CompressedTextureBuffer","./defined","./loadArrayBuffer","./PixelFormat","./RuntimeError"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,o){var a;if(a=t instanceof ArrayBuffer||ArrayBuffer.isView(t)?e.resolve(t):n(t,r,o),i(a))return a.then(function(e){return l(e)})}function l(e){for(var t=new Uint8Array(e),n=!0,s=0;s<u.length;++s)if(u[s]!==t[s]){n=!1;break}if(!n)throw new a("Invalid KTX file.");var l,h;i(e.buffer)?(l=new DataView(e.buffer),h=e.byteOffset):(l=new DataView(e),h=0),h+=12;var p=l.getUint32(h,!0);if(h+=d,p!==c)throw new a("File is the wrong endianness.");var f=l.getUint32(h,!0);h+=d;var m=l.getUint32(h,!0);h+=d;var g=l.getUint32(h,!0);h+=d;var v=l.getUint32(h,!0);h+=d;var _=l.getUint32(h,!0);h+=d;var y=l.getUint32(h,!0);h+=d;var b=l.getUint32(h,!0);h+=d;var C=l.getUint32(h,!0);h+=d;var w=l.getUint32(h,!0);h+=d;var S=l.getUint32(h,!0);h+=d;var T=l.getUint32(h,!0);h+=d;var E=l.getUint32(h,!0);h+=d,h+=E;var x=l.getUint32(h,!0);h+=d;var P;if(P=i(e.buffer)?new Uint8Array(e.buffer,h,x):new Uint8Array(e,h,x),32849===v?v=o.RGB:32856===v&&(v=o.RGBA),!o.validate(v))throw new a("glInternalFormat is not a valid format.");if(o.isCompressedFormat(v)){if(0!==f)throw new a("glType must be zero when the texture is compressed.");if(1!==m)throw new a("The type size for compressed textures must be 1.");if(0!==g)throw new a("glFormat must be zero when the texture is compressed.")}else if(_!==g)throw new a("The base internal format must be the same as the format for uncompressed textures.");if(0!==C)throw new a("3D textures are unsupported.");if(0!==w)throw new a("Texture arrays are unsupported.");if(1!==S)throw new a("Cubemaps are unsupported.");if(T>1){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<c;++l)h[l]=e[i+l];for(u=0;u<d;++u)p[u]=e[n+u+1];l=0,u=0;for(var f=i;f<=s;++f){var m=h[l],g=p[u];l<c&&(u>=d||t(m,g,r)<=0)?(e[f]=m,++l):u<d&&(e[f]=g,++u)}}function i(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));i(e,t,n,o,s),i(e,t,n,s+1,a),r(e,t,n,o,s,a)}}function n(e,t,r){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,i(e,t,r,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)}return i.clone=function(e,r){if(t(e))return t(r)?(r.near=e.near,r.nearValue=e.nearValue,r.far=e.far,r.farValue=e.farValue,r):new i(e.near,e.nearValue,e.far,e.farValue)},i.packedLength=4,i.pack=function(t,r,i){return i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue,r},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.near=r[n++],o.nearValue=r[n++],o.far=r[n++],o.farValue=r[n],o},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";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,i<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n));if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance)*o+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*i<s?u.NONE:(o=this._occluderRadius+i,(o=a-o*o)>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+i*i?u.FULL:u.PARTIAL):(n=t.subtract(r,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-i?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,r,i){var n=t.clone(r),o=t.clone(e.center),a=e.radius,s=i.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[0]);if(h){for(var p,f=1;f<s;++f){if(!(p=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[f])))return;p<h&&(h=p)}if(!(h<.0017453283658983088)){var g=a/h;return t.add(o,t.multiplyByScalar(l,g,m),m)}}};var g=[];c.computeOccludeePointFromRectangle=function(i,n){n=r(n,a.WGS84);var o=l.subsample(i,n,0,g),s=e.fromPoints(o),u=t.ZERO;if(!t.equals(u,s.center))return c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var v=new t;c._anyRotationVector=function(e,r,i){var n=t.abs(r,v),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,r,i,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,a,a);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<d)return!1;var h=c-d,p=Math.sqrt(h),f=Math.sqrt(c),m=1/f,g=p*m,v=g*p;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,v,w),w),S=Math.sqrt(h-v*v),T=this._rotationVector(s,r,i,a,n),E=t.fromElements(T.x*T.x*u.x+(T.x*T.y-T.z)*u.y+(T.x*T.z+T.y)*u.z,(T.x*T.y+T.z)*u.x+T.y*T.y*u.y+(T.y*T.z-T.x)*u.z,(T.x*T.z-T.y)*u.x+(T.y*T.z+T.x)*u.y+T.z*T.z*u.z,y);E=t.normalize(E,E);var x=t.multiplyByScalar(E,S,y);T=t.normalize(t.subtract(t.add(_,x,C),s,C),C);var P=t.dot(r,T);T=t.normalize(t.subtract(t.subtract(_,x,T),s,T),T);var A=t.dot(r,T);return P<A?P:A},c}),define("Core/Packable",["./DeveloperError"],function(e){"use strict";return{packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError}}),define("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";return{packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError}}),define("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)};return function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=e(t.canvas,"font-style"),u=e(t.canvas,"font-weight"),c=!/\S/.test(r);o.fontsize=s;var d=document.createElement("div");d.style.position="absolute",d.style.opacity=0,d.style.font=l+" "+u+" "+s+"px "+a,d.innerHTML=r+"<br/>"+r,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas");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;++y<C&&255===_[y];);var w=y/b|0;for(y=C-1;--y>0&&255===_[y];);var S=y/b|0;for(y=0;y<C&&255===_[y];)(y+=b)>=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.width<r.height&&(o=n*(r.width/r.height));var s=Math.round((i-o)/2),l=Math.round(7/24*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(r,s-1,l,o,a),e.drawImage(r,s,l-1,o,a),e.drawImage(r,s+1,l,o,a),e.drawImage(r,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(r,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s-1,l-2,o+2,a+2)}function u(e,t,i,a,u){d[0]=e,d[1]=t,d[2]=i,d[3]=a;var c=JSON.stringify(d),h=u[c];if(r(h))return h;var p=document.createElement("canvas");p.width=a,p.height=a;var f=p.getContext("2d");if(s(f,i,a),r(e)){var m=n(e).then(function(e){return l(f,e,a),u[c]=p,p});return u[c]=m,m}if(r(t)){var g=o(t,{font:"bold "+a+"px sans-serif"});l(f,g,a)}return u[c]=p,p}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,r){return u(e,void 0,t,r,this._cache)},a.prototype.fromMakiIconId=function(t,r,i){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,r,i,this._cache)},a.prototype.fromText=function(e,t,r){return u(void 0,e,t,r,this._cache)};var c=new t,d=new Array(4);return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function r(t,r,n,o){return e(t,r,n,o,i),i.x>0&&i.y>0&&i.z>0}var i=new t;return r}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return-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;u<l;++u)i.push(s[u])}}return r},v.packPolygonHierarchy=function(e,r,i){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(r[i++]=n(s)?s.length:0,r[i++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,i+=3)t.pack(s[c],r,i);if(n(l))for(var d=l.length,h=0;h<d;++h)o.push(l[h])}}return i},v.unpackPolygonHierarchy=function(e,r){for(var i=e[r++],n=e[r++],o=new Array(i),a=n>0?new Array(n):void 0,s=0;s<i;++s,r+=t.packedLength)o[s]=t.unpack(e,r);for(var l=0;l<n;++l)a[l]=v.unpackPolygonHierarchy(e,r),r=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:r}};var _=new t;v.subdivideLineCount=function(e,r,i){var n=t.distance(e,r),o=n/i,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},v.subdivideLine=function(e,r,i,o){var a=v.subdivideLineCount(e,r,i),s=t.distance(e,r),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,d=0;d<a;d++){var h=g(e,r,d*l,s);u[c++]=h[0],u[c++]=h[1],u[c++]=h[2]}return u};var y=new t,b=new t,C=new t,w=new t;v.scaleToGeodeticHeightExtruded=function(e,r,a,s,l){s=i(s,o.WGS84);var u=y,c=b,d=C,h=w;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,f=p.length/2,m=0;m<f;m+=3)t.fromArray(p,m,d),s.geodeticSurfaceNormal(d,u),h=s.scaleToGeodeticSurface(d,h),c=t.multiplyByScalar(u,a,c),c=t.add(h,c,c),p[m+f]=c.x,p[m+1+f]=c.y,p[m+2+f]=c.z,l&&(h=t.clone(d,h)),c=t.multiplyByScalar(u,r,c),c=t.add(h,c,c),p[m]=c.x,p[m+1]=c.y,p[m+2]=c.z;return e},v.polygonsFromHierarchy=function(r,i,o,a){var s=[],l=[],u=new f;for(u.enqueue(r);0!==u.length;){var c=u.dequeue(),d=c.positions,p=c.holes;if(d=e(d,t.equalsEpsilon,!0),!(d.length<3)){var g=o.projectPointsOntoPlane(d),v=[],_=h.computeWindingOrder2D(g);_===m.CLOCKWISE&&(g.reverse(),d=d.slice().reverse());var y,b,C=d.slice(),w=n(p)?p.length:0,S=[];for(y=0;y<w;y++){
  451. var T=p[y],E=e(T.positions,t.equalsEpsilon,!0);if(!(E.length<3)){var x=o.projectPointsOntoPlane(E);_=h.computeWindingOrder2D(x),_===m.CLOCKWISE&&(x.reverse(),E=E.slice().reverse()),S.push(E),v.push(C.length),C=C.concat(E),g=g.concat(x);var P=0;for(n(T.holes)&&(P=T.holes.length),b=0;b<P;b++)u.enqueue(T.holes[b])}}if(!i){for(y=0;y<d.length;y++)a.scaleToGeodeticSurface(d[y],d[y]);for(y=0;y<S.length;y++){var A=S[y];for(b=0;b<A.length;++b)a.scaleToGeodeticSurface(A[b],A[b])}}s.push({outerRing:d,holes:S}),l.push({positions:C,positions2D:g,holes:v})}}return{hierarchy:s,polygons:l}},v.createGeometryFromPositions=function(e,t,i,n,o){var l=h.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var d=c.length,f=new Array(3*d),m=0,g=0;g<d;g++){var v=c[g];f[m++]=v.x,f[m++]=v.y,f[m++]=v.z}var _=new a({attributes:{position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(_):_}return h.computeSubdivision(e,c,l,i)};var S=[],T=new t,E=new t;return v.computeWallGeometry=function(e,i,n,o){var u,h,f,m,g,_=e.length,y=0;if(o)for(h=3*_*2,u=new Array(2*h),f=0;f<_;f++)m=e[f],g=e[(f+1)%_],u[y]=u[y+h]=m.x,++y,u[y]=u[y+h]=m.y,++y,u[y]=u[y+h]=m.z,++y,u[y]=u[y+h]=g.x,++y,u[y]=u[y+h]=g.y,++y,u[y]=u[y+h]=g.z,++y;else{var b=d.chordLength(n,i.maximumRadius),C=0;for(f=0;f<_;f++)C+=v.subdivideLineCount(e[f],e[(f+1)%_],b);for(h=3*(C+_),u=new Array(2*h),f=0;f<_;f++){m=e[f],g=e[(f+1)%_];for(var w=v.subdivideLine(m,g,b,S),x=w.length,P=0;P<x;++P,++y)u[y]=w[P],u[y+h]=w[P];u[y]=g.x,u[y+h]=g.x,++y,u[y]=g.y,u[y+h]=g.y,++y,u[y]=g.z,u[y+h]=g.z,++y}}_=u.length;var A=c.createTypedArray(_/3,_-6*e.length),D=0;for(_/=6,f=0;f<_;f++){var I=f,O=I+1,M=I+_,R=M+1;m=t.fromArray(u,3*I,T),g=t.fromArray(u,3*O,E),t.equalsEpsilon(m,g,d.EPSILON14)||(A[D++]=I,A[D++]=M,A[D++]=O,A[D++]=O,A[D++]=M,A[D++]=R)}return new a({attributes:new l({position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:u})}),indices:A,primitiveType:p.TRIANGLES})},v}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E){"use strict";function x(e,t,r,n){for(var o=w.fromAxisAngle(e._plane.normal,r,R),a=y.fromQuaternion(o,L),s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=t.length,p=0;p<h;++p){var f=i.clone(t[p],M);y.multiplyByVector(a,f,f);var m=e.projectPointOntoPlane(f,O);l(m)&&(s=Math.min(s,m.x),u=Math.max(u,m.x),c=Math.min(c,m.y),d=Math.max(d,m.y))}return n.x=s,n.y=c,n.width=u-s,n.height=d-c,n}function P(e,t,r,i){var n=i.cartesianToCartographic(e,N),o=n.height,a=i.cartesianToCartographic(t,k);a.height=o,i.cartographicToCartesian(a,t);var s=i.cartesianToCartographic(r,k);s.height=o-100,i.cartographicToCartesian(s,r)}function A(e){var t=e.vertexFormat,n=e.geometry,o=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||o){var s=e.boundingRectangle,l=e.tangentPlane,u=e.ellipsoid,c=e.stRotation,d=e.wall,h=e.top||d,p=e.bottom||d,m=e.perPositionHeight,g=Y;g.x=s.x,g.y=s.y;var v,b=n.attributes.position.values,C=b.length,S=t.st?new Float32Array(C/3*2):void 0;t.normal&&(v=m&&h&&!d?n.attributes.normal.values:new Float32Array(C));var T=t.tangent?new Float32Array(C):void 0,E=t.bitangent?new Float32Array(C):void 0,x=o?new Float32Array(C):void 0,A=0,D=0,I=U,O=V,M=z,R=!0,L=w.fromAxisAngle(l._plane.normal,c,Z),N=y.fromQuaternion(L,K),k=0,F=0;h&&p&&(k=C/2,F=C/3,C/=2);for(var J=0;J<C;J+=3){var $=i.fromArray(b,J,Q);if(t.st){var ee=y.multiplyByVector(N,$,B);ee=u.scaleToGeodeticSurface(ee,ee);var te=l.projectPointOntoPlane(ee,X);r.subtract(te,g,te);var re=_.clamp(te.x/s.width,0,1),ie=_.clamp(te.y/s.height,0,1);p&&(S[A+F]=re,S[A+1+F]=ie),h&&(S[A]=re,S[A+1]=ie),A+=2}if(t.normal||t.tangent||t.bitangent||o){var ne=D+1,oe=D+2;if(d){if(J+3<C){var ae=i.fromArray(b,J+3,G);if(R){var se=i.fromArray(b,J+C,H);m&&P($,ae,se,u),i.subtract(ae,$,ae),i.subtract(se,$,se),I=i.normalize(i.cross(se,ae,I),I),R=!1}i.equalsEpsilon(ae,$,_.EPSILON10)&&(R=!0)}(t.tangent||t.bitangent)&&(M=u.geodeticSurfaceNormal($,M),t.tangent&&(O=i.normalize(i.cross(M,I,O),O)))}else I=u.geodeticSurfaceNormal($,I),(t.tangent||t.bitangent)&&(m&&(W=i.fromArray(v,D,W),j=i.cross(i.UNIT_Z,W,j),j=i.normalize(y.multiplyByVector(N,j,j),j),t.bitangent&&(q=i.normalize(i.cross(W,j,q),q))),O=i.cross(i.UNIT_Z,I,O),O=i.normalize(y.multiplyByVector(N,O,O),O),t.bitangent&&(M=i.normalize(i.cross(I,O,M),M)));t.normal&&(e.wall?(v[D+k]=I.x,v[ne+k]=I.y,v[oe+k]=I.z):p&&(v[D+k]=-I.x,v[ne+k]=-I.y,v[oe+k]=-I.z),(h&&!m||d)&&(v[D]=I.x,v[ne]=I.y,v[oe]=I.z)),o&&(d&&(I=u.geodeticSurfaceNormal($,I)),x[D+k]=-I.x,x[ne+k]=-I.y,x[oe+k]=-I.z),t.tangent&&(e.wall?(T[D+k]=O.x,T[ne+k]=O.y,T[oe+k]=O.z):p&&(T[D+k]=-O.x,T[ne+k]=-O.y,T[oe+k]=-O.z),h&&(m?(T[D]=j.x,T[ne]=j.y,T[oe]=j.z):(T[D]=O.x,T[ne]=O.y,T[oe]=O.z))),t.bitangent&&(p&&(E[D+k]=M.x,E[ne+k]=M.y,E[oe+k]=M.z),h&&(m?(E[D]=q.x,E[ne]=q.y,E[oe]=q.z):(E[D]=M.x,E[ne]=M.y,E[oe]=M.z))),D+=3}}t.st&&(n.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:S})),t.normal&&(n.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(n.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E})),o&&(n.attributes.extrudeDirection=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:x}))}return n}function D(e,t,r,i,n,o,a,s){var l,u={walls:[]};if(o||a){var c,d,p=b.createGeometryFromPositions(e,t,r,n,s),f=p.attributes.position.values,g=p.indices;if(o&&a){var _=f.concat(f);c=_.length/3,d=v.createTypedArray(c,2*g.length),d.set(g);var y=g.length,w=c/2;for(l=0;l<y;l+=3){var S=d[l]+w,T=d[l+1]+w,x=d[l+2]+w;d[l+y]=x,d[l+1+y]=T,d[l+2+y]=S}if(p.attributes.position.values=_,n){var P=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(_.length),p.attributes.normal.values.set(P)}p.indices=d}else if(a){for(c=f.length/3,d=v.createTypedArray(c,g.length),l=0;l<g.length;l+=3)d[l]=g[l+2],d[l+1]=g[l+1],d[l+2]=g[l];p.indices=d}u.topAndBottom=new m({geometry:p})}var A=i.outerRing,D=h.fromPoints(A,e),I=D.projectPointsOntoPlane(A,J),O=C.computeWindingOrder2D(I);O===E.CLOCKWISE&&(A=A.slice().reverse());var M=b.computeWallGeometry(A,e,r,n);u.walls.push(new m({geometry:M}));var R=i.holes;for(l=0;l<R.length;l++){var L=R[l];D=h.fromPoints(L,e),I=D.projectPointsOntoPlane(L,J),O=C.computeWindingOrder2D(I),O===E.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),M=b.computeWallGeometry(L,e,r),u.walls.push(new m({geometry:M}))}return u}function I(e){var t=e.polygonHierarchy,r=s(e.vertexFormat,T.DEFAULT),i=s(e.ellipsoid,d.WGS84),n=s(e.granularity,_.RADIANS_PER_DEGREE),o=s(e.stRotation,0),a=s(e.height,0),u=s(e.perPositionHeight,!1),c=e.extrudedHeight,h=l(c);if(!u&&h)if(_.equalsEpsilon(a,c,_.EPSILON10))c=void 0,h=!1;else{var p=c;c=Math.min(p,a),a=Math.max(p,a)}this._vertexFormat=T.clone(r),this._ellipsoid=d.clone(i),this._granularity=n,this._stRotation=o,this._height=a,this._extrudedHeight=s(c,0),this._extrude=h,this._closeTop=s(e.closeTop,!0),this._closeBottom=s(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var f=t.positions;!l(f)||f.length<3?this._rectangle=new S:this._rectangle=S.fromCartesianArray(f,i),this.packedLength=b.computeHierarchyPackedLength(t)+d.packedLength+T.packedLength+S.packedLength+10}var O=new r,M=new i,R=new w,L=new y,N=new n,k=new n,F=new e,B=new i,U=new i,V=new i,z=new i,G=new i,H=new i,W=new i,j=new i,q=new i,Y=new r,X=new r,Q=new i,Z=new w,K=new y,J=[];I.fromPositions=function(e){return e=s(e,s.EMPTY_OBJECT),new I({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom})},I.pack=function(e,t,r){return r=s(r,0),r=b.packPolygonHierarchy(e._polygonHierarchy,t,r),d.pack(e._ellipsoid,t,r),r+=d.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,S.pack(e._rectangle,t,r),r+=S.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r]=e.packedLength,t};var $=d.clone(d.UNIT_SPHERE),ee=new T,te=new S,re={polygonHierarchy:{}};return I.unpack=function(e,t,r){t=s(t,0);var i=b.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=d.unpack(e,t,$);t+=d.packedLength;var o=T.unpack(e,t,ee);t+=T.packedLength;var a=S.unpack(e,t,te);t+=S.packedLength;var u=e[t++],c=e[t++],h=e[t++],p=e[t++],f=1===e[t++],m=1===e[t++],g=1===e[t++],v=1===e[t++],_=1===e[t++],y=e[t];return l(r)||(r=new I(re)),r._polygonHierarchy=i,r._ellipsoid=d.clone(n,r._ellipsoid),r._vertexFormat=T.clone(o,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=h,r._stRotation=p,r._extrude=f,r._perPositionHeight=m,r._closeTop=g,r._closeBottom=v,r._rectangle=S.clone(a),r._shadowVolume=_,r.packedLength=y,r},I.createGeometry=function(e){var r=e._vertexFormat,i=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,d=e._closeTop,f=e._closeBottom,_=u.positions;if(!(_.length<3)){var y=h.fromPoints(_,i),w=b.polygonsFromHierarchy(u,c,y,i),S=w.hierarchy,T=w.polygons;if(0!==S.length){_=S[0].outerRing;var E,P,I=x(y,_,o,F),O=[],M={perPositionHeight:c,vertexFormat:r,geometry:void 0,tangentPlane:y,boundingRectangle:I,ellipsoid:i,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(M.top=d,M.bottom=f,M.shadowVolume=e._shadowVolume,P=0;P<T.length;P++){E=D(i,T[P],n,S[P],c,d,f,r);var R;d&&f?(R=E.topAndBottom,M.geometry=b.scaleToGeodeticHeightExtruded(R.geometry,a,s,i,c)):d?(R=E.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,a,i,!c),M.geometry=R.geometry):f&&(R=E.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,s,i,!0),M.geometry=R.geometry),(d||f)&&(M.wall=!1,R.geometry=A(M),O.push(R));var L=E.walls;M.wall=!0;for(var N=0;N<L.length;N++){var k=L[N];M.geometry=b.scaleToGeodeticHeightExtruded(k.geometry,a,s,i,c),k.geometry=A(M),O.push(k)}}else for(P=0;P<T.length;P++)E=new m({geometry:b.createGeometryFromPositions(i,T[P],n,c,r)}),E.geometry.attributes.position.values=C.scaleToGeodeticHeight(E.geometry.attributes.position.values,a,i,!c),M.geometry=E.geometry,E.geometry=A(M),O.push(E);E=g.combineInstances(O)[0],E.attributes.position.values=new Float64Array(E.attributes.position.values),E.indices=v.createTypedArray(E.attributes.position.values.length/3,E.indices);var B=E.attributes,U=t.fromVertices(B.position.values);return r.position||delete B.position,new p({attributes:B,indices:E.indices,primitiveType:E.primitiveType,boundingSphere:U})}}},I.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new I({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},u(I.prototype,{rectangle:{get:function(){return this._rectangle}}}),I}),define("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,r){this.positions=e(t)?t:[],this.holes=e(r)?r:[]}return t}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,E);_.computeWindingOrder2D(a)===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var s,l,f=t.length,g=0;if(i)for(s=new Float64Array(2*f*3),l=0;l<f;l++){var b=t[l],w=t[(l+1)%f];s[g++]=b.x,s[g++]=b.y,s[g++]=b.z,s[g++]=w.x,s[g++]=w.y,s[g++]=w.z}else{var S=0;for(l=0;l<f;l++)S+=v.subdivideLineCount(t[l],t[(l+1)%f],r);for(s=new Float64Array(3*S),l=0;l<f;l++)for(var T=v.subdivideLine(t[l],t[(l+1)%f],r,x),P=T.length,A=0;A<P;++A)s[g++]=T[A]}f=s.length/3;var D=2*f,I=m.createTypedArray(f,D);for(g=0,l=0;l<f-1;l++)I[g++]=l,I[g++]=l+1;return I[g++]=f-1,I[g++]=0,new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s})}),indices:I,primitiveType:y.LINES})})}function S(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,E);_.computeWindingOrder2D(a)===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var s,l,f=t.length,g=new Array(f),b=0;if(i)for(s=new Float64Array(2*f*3*2),l=0;l<f;++l){g[l]=b/3;var w=t[l],S=t[(l+1)%f];s[b++]=w.x,s[b++]=w.y,s[b++]=w.z,s[b++]=S.x,s[b++]=S.y,s[b++]=S.z}else{var T=0;for(l=0;l<f;l++)T+=v.subdivideLineCount(t[l],t[(l+1)%f],r);for(s=new Float64Array(3*T*2),l=0;l<f;++l){g[l]=b/3;for(var P=v.subdivideLine(t[l],t[(l+1)%f],r,x),A=P.length,D=0;D<A;++D)s[b++]=P[D]}}f=s.length/6;var I=g.length,O=2*(2*f+I),M=m.createTypedArray(f,O);for(b=0,l=0;l<f;++l)M[b++]=l,M[b++]=(l+1)%f,M[b++]=l+f,M[b++]=(l+1)%f+f;for(l=0;l<I;l++){var R=g[l];M[b++]=R,M[b++]=R+f}return new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s})}),indices:M,primitiveType:y.LINES})})}function T(e){var t=e.polygonHierarchy,r=o(e.ellipsoid,l.WGS84),i=o(e.granularity,g.RADIANS_PER_DEGREE),n=o(e.height,0),s=o(e.perPositionHeight,!1),u=e.extrudedHeight,c=a(u);if(c&&!s){var d=u;u=Math.min(d,n),n=Math.max(d,n)}this._ellipsoid=l.clone(r),this._granularity=i,this._height=n,this._extrudedHeight=o(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=v.computeHierarchyPackedLength(t)+l.packedLength+6}var E=[],x=[];T.pack=function(e,t,r){return r=o(r,0),r=v.packPolygonHierarchy(e._polygonHierarchy,t,r),l.pack(e._ellipsoid,t,r),r+=l.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var P=l.clone(l.UNIT_SPHERE),A={polygonHierarchy:{}};return T.unpack=function(e,t,r){t=o(t,0);var i=v.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=l.unpack(e,t,P);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],d=1===e[t++],h=1===e[t++],p=e[t++];return a(r)||(r=new T(A)),r._polygonHierarchy=i,r._ellipsoid=l.clone(n,r._ellipsoid),r._height=s,r._extrudedHeight=u,r._granularity=c,r._extrude=d,r._perPositionHeight=h,r.packedLength=p,r},T.fromPositions=function(e){return e=o(e,o.EMPTY_OBJECT),new T({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight})},T.createGeometry=function(i){var n=i._ellipsoid,o=i._granularity,s=i._height,l=i._extrudedHeight,u=i._extrude,d=i._polygonHierarchy,h=i._perPositionHeight,p=[],m=new b;m.enqueue(d);for(var y;0!==m.length;){var C=m.dequeue(),T=C.positions;if(T=e(T,r.equalsEpsilon,!0),!(T.length<3)){var E=C.holes?C.holes.length:0;for(y=0;y<E;y++){var x=C.holes[y];if(x.positions=e(x.positions,r.equalsEpsilon,!0),!(x.positions.length<3)){p.push(x.positions);var P=0;a(x.holes)&&(P=x.holes.length);for(var A=0;A<P;A++)m.enqueue(x.holes[A])}}p.push(T)}}if(0!==p.length){var D,I=[],O=g.chordLength(o,n.maximumRadius);if(u)for(y=0;y<p.length;y++)D=S(n,p[y],O,h),D.geometry=v.scaleToGeodeticHeightExtruded(D.geometry,s,l,n,h),I.push(D);else for(y=0;y<p.length;y++)D=w(n,p[y],O,h),D.geometry.attributes.position.values=_.scaleToGeodeticHeight(D.geometry.attributes.position.values,s,n,!h),I.push(D);D=f.combineInstances(I)[0];var M=t.fromVertices(D.attributes.position.values);return new c({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:M})}},T}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e,t,r,n,o){var a=b;a.length=o;var s,l=r.red,u=r.green,c=r.blue,d=r.alpha,h=n.red,p=n.green,f=n.blue,m=n.alpha;if(i.equals(r,n)){for(s=0;s<o;s++)a[s]=i.clone(r);return a}var g=(h-l)/o,v=(p-u)/o,_=(f-c)/o,y=(m-d)/o;for(s=0;s<o;s++)a[s]=new i(l+s*g,u+s*v,c+s*_,d+s*y);return a}function y(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,n=e.colors,s=o(e.width,1),u=o(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=s,this._colorsPerVertex=u,this._vertexFormat=v.clone(o(e.vertexFormat,v.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*r.packedLength;c+=a(n)?1+n.length*i.packedLength:1,this.packedLength=c+l.packedLength+v.packedLength+4}var b=[];y.pack=function(e,t,n){n=o(n,0);var s,u=e._positions,c=u.length;for(t[n++]=c,s=0;s<c;++s,n+=r.packedLength)r.pack(u[s],t,n);var d=e._colors;for(c=a(d)?d.length:0,t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(d[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,v.pack(e._vertexFormat,t,n),n+=v.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var C=l.clone(l.UNIT_SPHERE),w=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:w,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,t,n){t=o(t,0);var s,u=e[t++],c=new Array(u);for(s=0;s<u;++s,t+=r.packedLength)c[s]=r.unpack(e,t);u=e[t++];var d=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=i.packedLength)d[s]=i.unpack(e,t);var h=l.unpack(e,t,C);t+=l.packedLength;var p=v.unpack(e,t,w);t+=v.packedLength;var f=e[t++],m=1===e[t++],g=1===e[t++],_=e[t];return a(n)?(n._positions=c,n._colors=d,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=v.clone(p,n._vertexFormat),n._width=f,n._colorsPerVertex=m,n._followSurface=g,n._granularity=_,n):(S.positions=c,S.colors=d,S.width=f,S.colorsPerVertex=m,S.followSurface=g,S.granularity=_,new y(S))};var T=new r,E=new r,x=new r,P=new r;return y.createGeometry=function(o){var s,l,v,y=o._width,C=o._vertexFormat,w=o._colors,S=o._colorsPerVertex,A=o._followSurface,D=o._granularity,I=o._ellipsoid,O=e(o._positions,r.equalsEpsilon),M=O.length;if(!(M<2||y<=0)){if(A){var R=m.extractHeights(O,I),L=f.chordLength(D,I.maximumRadius);if(a(w)){var N=1;for(s=0;s<M-1;++s)N+=m.numberOfPoints(O[s],O[s+1],L);var k=new Array(N),F=0;for(s=0;s<M-1;++s){var B=O[s],U=O[s+1],V=w[s],z=m.numberOfPoints(B,U,L);if(S&&s<N){var G=w[s+1],H=_(B,U,V,G,z),W=H.length;for(l=0;l<W;++l)k[F++]=H[l]}else for(l=0;l<z;++l)k[F++]=i.clone(V)}k[F]=i.clone(w[w.length-1]),w=k,b.length=0}O=m.generateCartesianArc({positions:O,minDistance:L,ellipsoid:I,height:R})}M=O.length;var j,q=4*M-4,Y=new Float64Array(3*q),X=new Float64Array(3*q),Q=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,J=a(w)?new Uint8Array(4*q):void 0,$=0,ee=0,te=0,re=0;for(l=0;l<M;++l){0===l?(j=T,r.subtract(O[0],O[1],j),r.add(O[0],j,j)):j=O[l-1],r.clone(j,x),r.clone(O[l],E),l===M-1?(j=T,r.subtract(O[M-1],O[M-2],j),r.add(O[M-1],j,j)):j=O[l+1],r.clone(j,P);var ie,ne;a(J)&&(ie=0===l||S?w[l]:w[l-1],l!==M-1&&(ne=w[l]));var oe=0===l?2:0,ae=l===M-1?2:4;for(v=oe;v<ae;++v){r.pack(E,Y,$),r.pack(x,X,$),r.pack(P,Q,$),$+=3;var se=v-2<0?-1:1;if(Z[ee++]=v%2*2-1,Z[ee++]=se*y,C.st&&(K[te++]=l/(M-1),K[te++]=Math.max(Z[ee-2],0)),a(J)){var le=v<2?ie:ne;J[re++]=i.floatToByte(le.red),J[re++]=i.floatToByte(le.green),J[re++]=i.floatToByte(le.blue),J[re++]=i.floatToByte(le.alpha)}}}var ue=new d;ue.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ue.prevPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:X}),ue.nextPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Q}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(q,6*M-6),de=0,he=0,pe=M-1;for(l=0;l<pe;++l)ce[he++]=de,ce[he++]=de+2,ce[he++]=de+1,ce[he++]=de+1,ce[he++]=de+2,ce[he++]=de+3,de+=4;return new u({attributes:ue,indices:ce,primitiveType:g.TRIANGLES,boundingSphere:t.fromPoints(O),geometryType:h.POLYLINES})}},y}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(e,t,i,n){var a=new p;n.position&&(a.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,g,y,C=t.length,w=e.length/3,S=(w-2*C)/(2*C),T=_.triangulate(t),E=(S-1)*C*6+2*T.length,x=m.createTypedArray(w,E),P=2*C,A=0;for(s=0;s<S-1;s++){for(l=0;l<C-1;l++)u=2*l+s*C*2,y=u+P,c=u+1,g=c+P,x[A++]=c,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=y;u=2*C-2+s*C*2,c=u+1,g=c+P,y=u+P,x[A++]=c,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=y}if(n.st||n.tangent||n.bitangent){var D,I,O=new Float32Array(2*w),M=1/(S-1),R=1/i.height,L=i.height/2,N=0;for(s=0;s<S;s++){for(D=s*M,I=R*(t[0].y+L),O[N++]=D,O[N++]=I,l=1;l<C;l++)I=R*(t[l].y+L),O[N++]=D,O[N++]=I,O[N++]=D,O[N++]=I;I=R*(t[0].y+L),O[N++]=D,O[N++]=I}for(l=0;l<C;l++)D=0,I=R*(t[l].y+L),O[N++]=D,O[N++]=I;for(l=0;l<C;l++)D=(S-1)*M,I=R*(t[l].y+L),O[N++]=D,O[N++]=I;a.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(O)})}var k=w-2*C;for(s=0;s<T.length;s+=3){var F=T[s]+k,B=T[s+1]+k,U=T[s+2]+k;x[A++]=F,x[A++]=B,x[A++]=U,x[A++]=U+C,x[A++]=B+C,x[A++]=F+C}var V=new d({attributes:a,indices:x,boundingSphere:r.fromVertices(e),primitiveType:b.TRIANGLES});if(n.normal&&(V=f.computeNormal(V)),n.tangent||n.bitangent){try{V=f.computeTangentAndBitangent(V)}catch(e){v("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(V.attributes.tangent=void 0),n.bitangent||(V.attributes.bitangent=void 0),n.st||(V.attributes.st=void 0)}return V}function T(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._granularity=s(e.granularity,g.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+C.packedLength+2}T.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var E=c.clone(c.UNIT_SPHERE),x=new C,P={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:x,cornerType:void 0,granularity:void 0};T.unpack=function(e,t,r){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,E);t+=c.packedLength;var p=C.unpack(e,t,x);t+=C.packedLength;var f=e[t++],m=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._vertexFormat=C.clone(p,r._vertexFormat),r._cornerType=f,r._granularity=m,r):(P.polylinePositions=u,P.shapePositions=d,P.cornerType=f,P.granularity=m,new T(P))};var A=new t;return T.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._shape;if(a=y.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){_.computeWindingOrder2D(a)===w.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,A);return S(y.computePositions(o,a,s,r,!0),a,s,r._vertexFormat)}},T}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(e,t){var i=new p;i.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=i.position.values.length/3,u=e.length/3,c=u/s,m=f.createTypedArray(l,2*s*(c+1)),g=0;n=0;var v=n*s;for(a=0;a<s-1;a++)m[g++]=a+v,m[g++]=a+v+1;for(m[g++]=s-1+v,m[g++]=v,n=c-1,v=n*s,a=0;a<s-1;a++)m[g++]=a+v,m[g++]=a+v+1;for(m[g++]=s-1+v,m[g++]=v,n=0;n<c-1;n++){var y=s*n,b=y+s;for(a=0;a<s;a++)m[g++]=a+y,m[g++]=a+b}return new d({attributes:i,indices:f.createTypedArray(l,m),boundingSphere:r.fromVertices(e),primitiveType:_.LINES})}function C(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+2}C.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var w=c.clone(c.UNIT_SPHERE),S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:w,height:void 0,cornerType:void 0,granularity:void 0};C.unpack=function(e,t,r){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,w);t+=c.packedLength;var p=e[t++],f=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._cornerType=p,r._granularity=f,r):(S.polylinePositions=u,S.shapePositions=d,S.cornerType=p,S.granularity=f,new C(S))};var T=new t;return C.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._shape;if(a=v.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){g.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,T);return b(v.computePositions(o,a,s,r,!1),a)}},C}),define("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;s<o-1;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var r=e.points,i=e.innerQuadrangles,o=e.times;if(r.length<3){var a=o[0],s=1/(o[1]-a),l=r[0],u=r[1];return function(e,r){t(r)||(r=new n);var i=(e-a)*s;return n.fastSlerp(l,u,i,r)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=r[l],d=r[l+1],h=i[l],p=i[l+1];return n.fastSquad(c,d,h,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(r,n,o);this._times=i,this._points=r,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return r(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r,i,n,o,s,l){var u=Math.cos(r),c=n*u,d=i*u,h=Math.sin(r),m=n*h,_=i*h;f=v.project(t,f),f=e.subtract(f,g,f);var y=a.fromRotation(r,p);f=a.multiplyByVector(y,f,f),f=e.add(f,g,f),t=v.unproject(f,t),s-=1,l-=1;var b=t.latitude,C=b+s*_,w=b-c*l,S=b-c*l+s*_,T=Math.max(b,C,w,S),E=Math.min(b,C,w,S),x=t.longitude,P=x+s*d,A=x+l*m,D=x+l*m+s*d;return{north:T,south:E,east:Math.max(x,P,A,D),west:Math.min(x,P,A,D),granYCos:c,granYSin:m,granXCos:d,granXSin:_,nwCorner:t}}var u=Math.cos,c=Math.sin,d=Math.sqrt,h={};h.computePosition=function(e,t,i,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,h=s.latitude-e.granYCos*t+i*e.granXSin,p=u(h),f=c(h),m=a.z*f,g=s.longitude+t*e.granYSin+i*e.granXCos,v=p*u(g),_=p*c(g),y=a.x*v,b=a.y*_,C=d(y*v+b*_+m*f);if(n.x=y/C,n.y=b/C,n.z=m/C,r(e.vertexFormat)&&e.vertexFormat.st){var w=e.stNwCorner;r(w)?(h=w.latitude-e.stGranYCos*t+i*e.stGranXSin,g=w.longitude+t*e.stGranYSin+i*e.stGranXCos,o.x=(g-e.stWest)*e.lonScalar,o.y=(h-e.stSouth)*e.latScalar):(o.x=(g-l.west)*e.lonScalar,o.y=(h-l.south)*e.latScalar)}};var p=new a,f=new e,m=new t,g=new e,v=new n;return h.computeOptions=function(e,t,r,i){var n,a,u,c,d,h=e._granularity,p=e._ellipsoid,f=e._surfaceHeight,_=e._rotation,y=e._stRotation,b=e._extrudedHeight,C=t.east,w=t.west,S=t.north,T=t.south,E=S-T;w>C?(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.longitude<r.longitude&&(x.longitude+=o.TWO_PI),g=v.project(x,g));var P=c,A=u,D={granYCos:P,granYSin:0,granXCos:A,granXSin:0,ellipsoid:p,surfaceHeight:f,extrudedHeight:b,nwCorner:r,rectangle:t,width:n,height:a};if(0!==_){var I=l(r,_,u,c,x,n,a);S=I.north,T=I.south,C=I.east,w=I.west,D.granYCos=I.granYCos,D.granYSin=I.granYSin,D.granXCos=I.granXCos,D.granXSin=I.granXSin,t.north=S,t.south=T,t.east=C,t.west=w}if(0!==y){_-=y,i=s.northwest(t,i);var O=l(i,_,u,c,x,n,a);D.stGranYCos=O.granYCos,D.stGranXCos=O.granXCos,D.stGranYSin=O.granYSin,D.stGranXSin=O.granXSin,D.stNwCorner=i,D.stWest=O.west,D.stSouth=O.south}return D},h}),
  452. define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T){"use strict";function E(e,t){var r=new d({attributes:new p,primitiveType:b.TRIANGLES});return r.attributes.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(r.attributes.bitangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.bitangents})),r}function x(e,t,i,n){var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.bitangent?new Float32Array(o):void 0,u=0,c=F,d=k,h=N;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<o;p+=3){var f=r.fromArray(e,p,L),m=u+1,g=u+2;h=i.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(r.cross(r.UNIT_Z,h,d),_.multiplyByVector(n,d,d),r.normalize(d,d),t.bitangent&&r.normalize(r.cross(h,d,c),c)),t.normal&&(a[u]=h.x,a[m]=h.y,a[g]=h.z),t.tangent&&(s[u]=d.x,s[m]=d.y,s[g]=d.z),t.bitangent&&(l[u]=c.x,l[m]=c.y,l[g]=c.z),u+=3}return E(t,{positions:e,normals:a,tangents:s,bitangents:l})}function P(e,t,i){var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=0,c=0,d=!0,h=F,p=k,f=N;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<n;m+=6){var g=r.fromArray(e,m,L),_=r.fromArray(e,(m+6)%n,G);if(d){var y=r.fromArray(e,(m+3)%n,H);r.subtract(_,g,_),r.subtract(y,g,y),f=r.normalize(r.cross(y,_,f),f),d=!1}r.equalsEpsilon(_,g,v.EPSILON10)&&(d=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(g,h),t.tangent&&(p=r.normalize(r.cross(h,f,p),p))),t.normal&&(o[l++]=f.x,o[l++]=f.y,o[l++]=f.z,o[l++]=f.x,o[l++]=f.y,o[l++]=f.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.bitangent&&(s[c++]=h.x,s[c++]=h.y,s[c++]=h.z,s[c++]=h.x,s[c++]=h.y,s[c++]=h.z)}return E(t,{positions:e,normals:o,tangents:a,bitangents:s})}function A(e){for(var t=e.vertexFormat,r=e.ellipsoid,i=e.size,n=e.height,a=e.width,s=t.position?new Float64Array(3*i):void 0,l=t.st?new Float32Array(2*i):void 0,u=0,c=0,d=L,p=U,f=Number.MAX_VALUE,m=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,y=0;y<n;++y)for(var b=0;b<a;++b)S.computePosition(e,y,b,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[c++]=p.x,l[c++]=p.y,f=Math.min(f,p.x),m=Math.min(m,p.y),v=Math.max(v,p.x),_=Math.max(_,p.y));if(t.st&&(f<0||m<0||v>1||_>1))for(var C=0;C<l.length;C+=2)l[C]=(l[C]-f)/(v-f),l[C+1]=(l[C+1]-m)/(_-m);for(var w=x(s,t,r,e.tangentRotationMatrix),T=6*(a-1)*(n-1),E=g.createTypedArray(i,T),P=0,A=0,D=0;D<n-1;++D){for(var I=0;I<a-1;++I){var O=P,M=O+a,R=M+1,N=O+1;E[A++]=O,E[A++]=M,E[A++]=N,E[A++]=N,E[A++]=M,E[A++]=R,++P}++P}return w.indices=E,t.st&&(w.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:l})),w}function D(e,t,r,i,n){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r+2],e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r+2],e}function I(e,t,r,i){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r],e[t++]=i[r+1],e}function O(e){var t,i=e.shadowVolume,n=e.vertexFormat,a=e.surfaceHeight,s=e.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a),c=e.height,d=e.width,p=e.ellipsoid;i&&(e.vertexFormat=T.clone(n,W),e.vertexFormat.normal=!0);var _=A(e);if(v.equalsEpsilon(l,u,v.EPSILON10))return _;var b=y.scaleToGeodeticHeight(_.attributes.position.values,u,p,!1);b=new Float64Array(b);var C=b.length,w=2*C,S=new Float64Array(w);S.set(b);var E=y.scaleToGeodeticHeight(_.attributes.position.values,l,p);S.set(E,C),_.attributes.position.values=S;var x,O,M=n.normal?new Float32Array(w):void 0,R=n.tangent?new Float32Array(w):void 0,L=n.bitangent?new Float32Array(w):void 0,N=n.st?new Float32Array(w/3*2):void 0;if(n.normal){for(O=_.attributes.normal.values,M.set(O),t=0;t<C;t++)O[t]=-O[t];M.set(O,C),_.attributes.normal.values=M}if(i){O=_.attributes.normal.values,n.normal||(_.attributes.normal=void 0);var k=new Float32Array(w);for(t=0;t<C;t++)O[t]=-O[t];k.set(O,C),_.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:k})}if(n.tangent){var F=_.attributes.tangent.values;for(R.set(F),t=0;t<C;t++)F[t]=-F[t];R.set(F,C),_.attributes.tangent.values=R}if(n.bitangent){var B=_.attributes.bitangent.values;L.set(B),L.set(B,C),_.attributes.bitangent.values=L}n.st&&(x=_.attributes.st.values,N.set(x),N.set(x,C/3*2),_.attributes.st.values=N);var U=_.indices,V=U.length,z=C/3,j=g.createTypedArray(w/3,2*V);for(j.set(U),t=0;t<V;t+=3)j[t+V]=U[t+2]+z,j[t+1+V]=U[t+1]+z,j[t+2+V]=U[t]+z;_.indices=j;var q,Y=2*d+2*c-4,X=2*(Y+4),Q=new Float64Array(3*X),Z=i?new Float32Array(3*X):void 0,K=n.st?new Float32Array(2*X):void 0,J=0,$=0,ee=0,te=d*c;for(t=0;t<te;t+=d)q=3*t,Q=D(Q,J,q,b,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=te-d;t<te;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]);for(t=te-1;t>0;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<C-1;t+=2){ie=t,ae=(ie+2)%C;var ue=r.fromArray(Q,3*ie,G),ce=r.fromArray(Q,3*ae,H);r.equalsEpsilon(ue,ce,v.EPSILON10)||(ne=(ie+1)%C,oe=(ne+2)%C,se[le++]=ie,se[le++]=ne,se[le++]=ae,se[le++]=ae,se[le++]=ne,se[le++]=oe)}return re.indices=se,re=m.combineInstances([new f({geometry:_}),new f({geometry:re})]),re[0]}function M(e,t,r){if(0===r)return w.clone(e);w.northeast(e,Q[0]),w.northwest(e,Q[1]),w.southeast(e,Q[2]),w.southwest(e,Q[3]),t.cartographicArrayToCartesianArray(Q,X);var i=t.geodeticSurfaceNormalCartographic(w.center(e,q));C.fromAxisAngle(i,r,Y),_.fromQuaternion(Y,j);for(var n=0;n<4;++n)_.multiplyByVector(j,X[n],X[n]);return t.cartesianArrayToCartographicArray(X,Q),w.fromCartographicArray(Q)}function R(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,r=a(e.rotation,0);this._rectangle=t,this._granularity=a(e.granularity,v.RADIANS_PER_DEGREE),this._ellipsoid=c.clone(a(e.ellipsoid,c.WGS84)),this._surfaceHeight=a(e.height,0),this._rotation=r,this._stRotation=a(e.stRotation,0),this._vertexFormat=T.clone(a(e.vertexFormat,T.DEFAULT)),this._extrudedHeight=a(e.extrudedHeight,0),this._extrude=s(e.extrudedHeight),this._closeTop=a(e.closeTop,!0),this._closeBottom=a(e.closeBottom,!0),this._shadowVolume=a(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=M(this._rectangle,this._ellipsoid,r)}var L=new r,N=new r,k=new r,F=new r,B=new w,U=new t,V=new e,z=new e,G=new r,H=new r,W=new T,j=new _,q=new r,Y=new C,X=[new r,new r,new r,new r],Q=[new i,new i,new i,new i];R.packedLength=w.packedLength+c.packedLength+T.packedLength+w.packedLength+9,R.pack=function(e,t,r){return r=a(r,0),w.pack(e._rectangle,t,r),r+=w.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,w.pack(e._rotatedRectangle,t,r),r+=w.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r]=e._shadowVolume?1:0,t};var Z=new w,K=new w,J=c.clone(c.UNIT_SPHERE),$={rectangle:Z,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};R.unpack=function(e,t,r){t=a(t,0);var i=w.unpack(e,t,Z);t+=w.packedLength;var n=c.unpack(e,t,J);t+=c.packedLength;var o=T.unpack(e,t,W);t+=T.packedLength;var l=w.unpack(e,t,K);t+=w.packedLength;var u=e[t++],d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=1===e[t++],g=1===e[t++],v=1===e[t++],_=1===e[t];return s(r)?(r._rectangle=w.clone(i,r._rectangle),r._ellipsoid=c.clone(n,r._ellipsoid),r._vertexFormat=T.clone(o,r._vertexFormat),r._granularity=u,r._surfaceHeight=d,r._rotation=h,r._stRotation=p,r._extrudedHeight=m?f:void 0,r._extrude=m,r._closeTop=g,r._closeBottom=v,r._rotatedRectangle=l,r._shadowVolume=_,r):($.granularity=u,$.height=d,$.rotation=h,$.stRotation=p,$.extrudedHeight=m?f:void 0,$.closeTop=g,$.closeBottom=v,$.shadowVolume=_,new R($))};var ee=new _,te=new i,re=new i,ie=new C,ne=new i;return R.createGeometry=function(t){if(!v.equalsEpsilon(t._rectangle.north,t._rectangle.south,v.EPSILON10)&&!v.equalsEpsilon(t._rectangle.east,t._rectangle.west,v.EPSILON10)){var r=w.clone(t._rectangle,B),i=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,c=S.computeOptions(t,r,te,re),h=ee;if(0!==l||0!==s){var p=w.center(r,ne),f=i.geodeticSurfaceNormalCartographic(p,G);C.fromAxisAngle(f,-l,ie),_.fromQuaternion(ie,h)}else _.clone(_.IDENTITY,h);c.lonScalar=1/t._rectangle.width,c.latScalar=1/t._rectangle.height,c.vertexFormat=u,c.rotation=s,c.stRotation=l,c.tangentRotationMatrix=h,c.size=c.width*c.height;var m,g;if(r=t._rectangle,o){c.shadowVolume=t._shadowVolume,m=O(c);var b=e.fromRectangle3D(r,i,n,z),T=e.fromRectangle3D(r,i,a,V);g=e.union(b,T)}else m=A(c),m.attributes.position.values=y.scaleToGeodeticHeight(m.attributes.position.values,n,i,!1),g=e.fromRectangle3D(r,i,n);return u.position||delete m.attributes.position,new d({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:g})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},l(R.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),R}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){var t,r=e.size,n=e.height,o=e.width,a=new Float64Array(3*r),s=0,h=0,p=w;for(t=0;t<o;t++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,h=1;h<n;h++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(h=n-1,t=o-2;t>=0;t--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,v=d.createTypedArray(a.length/3,m),_=0,y=0;y<a.length/3-1;y++)v[_++]=y,v[_++]=y+1;v[_++]=a.length/3-1,v[_++]=0;var b=new l({attributes:new c,primitiveType:f.LINES});return b.attributes.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a}),b.indices=v,b}function _(e){var t=e.surfaceHeight,r=e.extrudedHeight,i=e.ellipsoid,n=Math.min(r,t),o=Math.max(r,t),a=v(e);if(h.equalsEpsilon(n,o,h.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,i,!1),c=u.length,f=new Float64Array(2*c);f.set(u);var m=p.scaleToGeodeticHeight(a.attributes.position.values,n,i);f.set(m,c),a.attributes.position.values=f;var g=f.length/3*2+8,_=d.createTypedArray(f.length/3,g);c=f.length/6;for(var y=0,b=0;b<c-1;b++)_[y++]=b,_[y++]=b+1,_[y++]=b+c,_[y++]=b+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,r=n(e.granularity,h.RADIANS_PER_DEGREE),i=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var b=new e,C=new e,w=new t,S=new m;y.packedLength=m.packedLength+s.packedLength+5,y.pack=function(e,t,r){return r=n(r,0),m.pack(e._rectangle,t,r),r+=m.packedLength,s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=o(e._extrudedHeight)?1:0,t[r]=n(e._extrudedHeight,0),t};var T=new m,E=s.clone(s.UNIT_SPHERE),x={rectangle:T,ellipsoid:E,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,r){t=n(t,0);var i=m.unpack(e,t,T);t+=m.packedLength;var a=s.unpack(e,t,E);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return o(r)?(r._rectangle=m.clone(i,r._rectangle),r._ellipsoid=s.clone(a,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=d?h:void 0,r):(x.granularity=l,x.height=u,x.rotation=c,x.extrudedHeight=d?h:void 0,new y(x))};var P=new r;return y.createGeometry=function(t){var r=m.clone(t._rectangle,S),i=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=g.computeOptions(t,r,P);s.size=2*s.width+2*s.height-4;var u,c;if(r=t._rectangle,!h.equalsEpsilon(r.north,r.south,h.EPSILON10)&&!h.equalsEpsilon(r.east,r.west,h.EPSILON10)){if(o(a)){u=_(s);var d=e.fromRectangle3D(r,i,n,C),y=e.fromRectangle3D(r,i,a,b);c=e.union(d,y)}else u=v(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,i,!1),c=e.fromRectangle3D(r,i,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:f.LINES,boundingSphere:c})}},y}),define("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";return e({FIXED:0,INERTIAL:1})}),define("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function r(e){return i(e)}if("undefined"!=typeof window){var i=window.requestAnimationFrame;return function(){if(!e(i))for(var r=["webkit","moz","ms","o"],n=0,o=r.length;n<o&&!e(i);)i=window[r[n]+"RequestAnimationFrame"],++n;if(!e(i)){var a=0;i=function(e){var r=t(),i=Math.max(1e3/60-(r-a),0);return a=r+i,setTimeout(function(){e(a)},i)}}}(),r}}),define("Core/sampleTerrain",["../ThirdParty/when","./Check"],function(e,t){"use strict";function r(e,t,r){return e.readyPromise.then(function(){return i(e,t,r)})}function i(t,r,i){var a,s=t.tilingScheme,l=[],u={};for(a=0;a<i.length;++a){var c=s.positionToTileXY(i[a],r),d=c.toString();if(!u.hasOwnProperty(d)){var h={x:c.x,y:c.y,level:r,tilingScheme:s,terrainProvider:t,positions:[]};u[d]=h,l.push(h)}u[d].positions.push(i[a])}var p=[];for(a=0;a<l.length;++a){var f=l[a],m=f.terrainProvider.requestTileGeometry(f.x,f.y,f.level),g=e(m,n(f),o(f));p.push(g)}return e.all(p,function(){return i})}function n(e){var t=e.positions,r=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var i=0;i<t.length;++i){var n=t[i];n.height=e.interpolateHeight(r,n.longitude,n.latitude)}}}function o(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){t[e].height=void 0}}}return r}),define("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./defined","./DeveloperError","./sampleTerrain"],function(e,t,r,i){"use strict";function n(r,n){return r.readyPromise.then(function(){for(var o=[],a=r.availability,s=0;s<n.length;++s){var l=n[s],u=a.computeMaximumLevelAtPosition(l),c=o[u];t(c)||(o[u]=c=[]),c.push(l)}return e.all(o.map(function(e,n){if(t(e))return i(r,n,e)})).then(function(){return n})})}return n}),define("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";return e({LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19})}),define("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i=e._element;if(i===document)return r.x=t.clientX,r.y=t.clientY,r;var n=i.getBoundingClientRect();return r.x=t.clientX-n.left,r.y=t.clientY-n.top,r}function d(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e){return e.shiftKey?l.SHIFT:e.ctrlKey?l.CTRL:e.altKey?l.ALT:void 0}function p(e,t,r,i){function n(t){i(e,t)}r.addEventListener(t,n,!1),e._removalFunctions.push(function(){r.removeEventListener(t,n,!1)})}function f(e){var t=e._element,r=i(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(p(e,"pointerdown",t,A),p(e,"pointerup",t,D),p(e,"pointermove",t,I),p(e,"pointercancel",t,D)):(p(e,"mousedown",t,_),p(e,"mouseup",r,y),p(e,"mousemove",r,b),p(e,"touchstart",t,S),p(e,"touchend",r,T),p(e,"touchmove",r,x),p(e,"touchcancel",r,T)),p(e,"dblclick",t,C);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,w)}function m(e){for(var t=e._removalFunctions,r=0;r<t.length;++r)t[r]()}function g(e){e._lastSeenTouchEvent=s()}function v(e){return s()-e._lastSeenTouchEvent>O.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)<e._clickPixelTolerance&&(t.clone(p,N.position),d(N))}}}}function b(e,r){if(v(e)){var n=h(r),o=c(e,r,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(u.MOUSE_MOVE,n);i(s)&&(t.clone(a,k.startPosition),t.clone(o,k.endPosition),s(k)),t.clone(o,a),i(e._buttonDown)&&r.preventDefault()}}function C(e,t){var r,n=t.button;if(n===M.LEFT){r=u.LEFT_DOUBLE_CLICK;var o=h(t),a=e.getInputAction(r,o);i(a)&&(c(e,t,F.position),a(F))}}function w(e,t){var r;if(i(t.deltaY)){var n=t.deltaMode;r=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else r=t.detail>0?-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;i<s;++i)n=a[i],o=n.identifier,l.set(o,c(e,n,new t));E(e,r);var u=e._previousPositions;for(i=0;i<s;++i)n=a[i],o=n.identifier,u.set(o,t.clone(l.get(o)))}function T(e,t){g(e);var r,i,n,o=t.changedTouches,a=o.length,s=e._positions;for(r=0;r<a;++r)i=o[r],n=i.identifier,s.remove(n);E(e,t);var l=e._previousPositions;for(r=0;r<a;++r)i=o[r],n=i.identifier,l.remove(n)}function E(e,r){var n,o,a=h(r),s=e._positions,l=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===M.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(u.LEFT_UP,a),i(n)&&(t.clone(e._primaryPosition,V.position),n(V)),0===c&&(o=e.getInputAction(u.LEFT_CLICK,a),i(o)))){var d=e._primaryStartPosition,p=l.values[0],f=d.x-p.x,m=d.y-p.y;Math.sqrt(f*f+m*m)<e._clickPixelTolerance&&(t.clone(e._primaryPosition,z.position),o(z))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),i(n)&&n()),1===c){var g=s.values[0];t.clone(g,e._primaryPosition),t.clone(g,e._primaryStartPosition),t.clone(g,e._primaryPreviousPosition),e._buttonDown=M.LEFT,n=e.getInputAction(u.LEFT_DOWN,a),i(n)&&(t.clone(g,B.position),n(B)),r.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),i(n)&&(t.clone(s.values[0],U.position1),t.clone(s.values[1],U.position2),n(U),r.preventDefault()))}function x(e,r){g(e);var n,o,a,s=r.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var d=u.get(a);i(d)&&c(e,o,d)}P(e,r);var h=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),h.get(a))}function P(e,r){var n,o=h(r),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===M.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(u.MOUSE_MOVE,o),i(n)&&(t.clone(d,G.startPosition),t.clone(c,G.endPosition),n(G)),t.clone(c,d),r.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(u.PINCH_MOVE,o),i(n))){var p=a.values[0],f=a.values[1],m=s.values[0],g=s.values[1],v=f.x-p.x,_=f.y-p.y,y=.25*Math.sqrt(v*v+_*_),b=g.x-m.x,C=g.y-m.y,w=.25*Math.sqrt(b*b+C*C),S=.125*(f.y+p.y),T=.125*(g.y+m.y),E=Math.atan2(_,v),x=Math.atan2(C,b);t.fromElements(0,w,H.distance.startPosition),t.fromElements(0,y,H.distance.endPosition),t.fromElements(x,T,H.angleAndHeight.startPosition),t.fromElements(E,S,H.angleAndHeight.endPosition),n(H)}}function A(e,r){if(r.target.setPointerCapture(r.pointerId),"touch"===r.pointerType){var i=e._positions,n=r.pointerId;i.set(n,c(e,r,new t)),E(e,r);e._previousPositions.set(n,t.clone(i.get(n)))}else _(e,r)}function D(e,t){if("touch"===t.pointerType){var r=e._positions,i=t.pointerId;r.remove(i),E(e,t);e._previousPositions.remove(i)}else y(e,t)}function I(e,r){if("touch"===r.pointerType){var n=e._positions,o=r.pointerId,a=n.get(o);if(!i(a))return;c(e,r,a),P(e,r);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else b(e,r)}function O(i){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-O.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=r(i,document),f(this)}var M={LEFT:0,MIDDLE:1,RIGHT:2},R={position:new t},L={position:new t},N={position:new t},k={startPosition:new t,endPosition:new t},F={position:new t},B={position:new t},U={position1:new t,position2:new t},V={position:new t},z={position:new t},G={startPosition:new t,endPosition:new t},H={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return O.prototype.setInputAction=function(e,t,r){var i=d(t,r);this._inputEvents[i]=e},O.prototype.getInputAction=function(e,t){var r=d(e,t);return this._inputEvents[r]},O.prototype.removeInputAction=function(e,t){var r=d(e,t);delete this._inputEvents[r]},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return m(this),n(this)},O.mouseEmulationIgnoreMilliseconds=800,O}),define("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return i(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return r(t)?(t[0]=e,t):new Uint8Array([e])},o}),define("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=i.addSeconds(e,b,t);var r=i.totalDays(t)-C;return t=i.addSeconds(t,l(r),t)}function c(r,i,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=r*(1-i),f=s-l,g=l,v=h(u-s,i);d(i,0);m(f,a,g,x);var _=p*(1+i),y=Math.cos(v),b=Math.sin(v),C=1+i*y,w=_/C;return t(c)?(c.x=w*y,c.y=w*b,c.z=0):c=new e(w*y,w*b,0),o.multiplyByVector(x,c,c)}function d(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function h(e,t){return f(p(e,t),t)}function p(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(i=0;i<P&&Math.abs(a-o)>A;++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;l<u;l++)a[s++]=r.floatToByte(c),a[s++]=r.floatToByte(d),a[s++]=r.floatToByte(h),a[s++]=r.floatToByte(f);return s}var y=(m-c)/u,b=(g-d)/u,C=(v-h)/u,w=(_-f)/u,S=s;for(l=0;l<u;l++)a[S++]=r.floatToByte(c+l*y),a[S++]=r.floatToByte(d+l*b),a[S++]=r.floatToByte(h+l*C),a[S++]=r.floatToByte(f+l*w);return S}function g(e){e=n(e,n.EMPTY_OBJECT);var i=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=i,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,h.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+i.length*t.packedLength;u+=o(a)?1+a.length*r.packedLength:1,this.packedLength=u+s.packedLength+3}g.pack=function(e,i,a){a=n(a,0);var l,u=e._positions,c=u.length;for(i[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],i,a);var d=e._colors;for(c=o(d)?d.length:0,i[a++]=c,l=0;l<c;++l,a+=r.packedLength)r.pack(d[l],i,a);return s.pack(e._ellipsoid,i,a),a+=s.packedLength,i[a++]=e._colorsPerVertex?1:0,i[a++]=e._followSurface?1:0,i[a]=e._granularity,i},g.unpack=function(e,i,a){i=n(i,0);var l,u=e[i++],c=new Array(u);for(l=0;l<u;++l,i+=t.packedLength)c[l]=t.unpack(e,i);u=e[i++];var d=u>0?new Array(u):void 0;for(l=0;l<u;++l,i+=r.packedLength)d[l]=r.unpack(e,i);var h=s.unpack(e,i);i+=s.packedLength;var p=1===e[i++],f=1===e[i++],m=e[i];return o(a)?(a._positions=c,a._colors=d,a._ellipsoid=h,a._colorsPerVertex=p,a._followSurface=f,a._granularity=m,a):new g({positions:c,colors:d,ellipsoid:h,colorsPerVertex:p,followSurface:f,granularity:m})};var v=new Array(2),_=new Array(2),y={positions:v,height:_,ellipsoid:void 0,minDistance:void 0}
  453. ;return g.createGeometry=function(n){var a,s,g,b,C,w=n._positions,S=n._colors,T=n._colorsPerVertex,E=n._followSurface,x=n._granularity,P=n._ellipsoid,A=h.chordLength(x,P.maximumRadius),D=o(S)&&!T,I=w.length,O=0;if(E){var M=p.extractHeights(w,P),R=y;if(R.minDistance=A,R.ellipsoid=P,D){var L=0;for(a=0;a<I-1;a++)L+=p.numberOfPoints(w[a],w[a+1],A)+1;s=new Float64Array(3*L),b=new Uint8Array(4*L),R.positions=v,R.height=_;var N=0;for(a=0;a<I-1;++a){v[0]=w[a],v[1]=w[a+1],_[0]=M[a],_[1]=M[a+1];var k=p.generateArc(R);if(o(S)){var F=k.length/3;C=S[a];for(var B=0;B<F;++B)b[N++]=r.floatToByte(C.red),b[N++]=r.floatToByte(C.green),b[N++]=r.floatToByte(C.blue),b[N++]=r.floatToByte(C.alpha)}s.set(k,O),O+=k.length}}else if(R.positions=w,R.height=M,s=new Float64Array(p.generateArc(R)),o(S)){for(b=new Uint8Array(s.length/3*4),a=0;a<I-1;++a){var U=w[a],V=w[a+1],z=S[a],G=S[a+1];O=m(U,V,z,G,A,b,O)}var H=S[I-1];b[O++]=r.floatToByte(H.red),b[O++]=r.floatToByte(H.green),b[O++]=r.floatToByte(H.blue),b[O++]=r.floatToByte(H.alpha)}}else{g=D?2*I-2:I,s=new Float64Array(3*g),b=o(S)?new Uint8Array(4*g):void 0;var W=0,j=0;for(a=0;a<I;++a){var q=w[a];if(D&&a>0&&(t.pack(q,s,W),W+=3,C=S[a-1],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha)),D&&a===I-1)break;t.pack(q,s,W),W+=3,o(S)&&(C=S[a],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha))}}var Y=new c;Y.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(S)&&(Y.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),g=s.length/3;var X=2*(g-1),Q=d.createTypedArray(g,X),Z=0;for(a=0;a<g-1;++a)Q[Z++]=a,Q[Z++]=a+1;return new l({attributes:Y,indices:Q,primitiveType:f.LINES,boundingSphere:e.fromPoints(w)})},g}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(e,t,r,i,n,o){"use strict";function a(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,r,i,n){"use strict";function o(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),define("Core/Spherical",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)}return i.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return r(t)||(t=new i),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},i.clone=function(e,t){if(r(e))return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude)},i.normalize=function(e,t){return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new i(e.clock,e.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},i}),define("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t){for(var r=[],i=e.length,n=0;n<i;){var o=Math.ceil((i-n)/t--);r.push(e.slice(n,n+o)),n+=o}return r}return r}),define("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{credits:{get:t.throwInstantiationError},waterMask:{get:t.throwInstantiationError}}),r.prototype.interpolateHeight=t.throwInstantiationError,r.prototype.isChildAvailable=t.throwInstantiationError,r.prototype.createMesh=t.throwInstantiationError,r.prototype.upsample=t.throwInstantiationError,r.prototype.wasCreatedByUpsampling=t.throwInstantiationError,r}),define("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(e){}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),r.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,r.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,r.prototype.rectangleToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToRectangle=t.throwInstantiationError,r.prototype.positionToTileXY=t.throwInstantiationError,r}),define("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GregorianDate","./isLeapYear","./Iso8601","./JulianDate","./TimeInterval"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t){return u.compare(e.start,t.start)}function h(e){if(this._intervals=[],this._changedEvent=new o,r(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}function p(e,t,i){r(i)||(i=new u),u.toGregorianDate(e,g);var n=g.millisecond+t.millisecond,o=g.second+t.second,a=g.minute+t.minute,l=g.hour+t.hour,c=g.day+t.day,d=g.month+t.month,h=g.year+t.year;for(n>=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;o<n;o++)if(!c.equals(r[o],i[o],t))return!1;return!0},h.prototype.get=function(e){return this._intervals[e]},h.prototype.removeAll=function(){this._intervals.length>0&&(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-1<r.length&&c.contains(r[i-1],t)?i-1:~i)},h.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var i=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;l<u;l++){var c=s[l];if((!r(i)||c.start.equals(i))&&(!r(n)||c.stop.equals(n))&&(!r(o)||c.isStartIncluded===o)&&(!r(a)||c.isStopIncluded===a))return s[l]}},h.prototype.addInterval=function(t,i){if(!t.isEmpty){var n,o,a=this._intervals;if(0===a.length||u.greaterThan(t.start,a[a.length-1].stop))return a.push(t),void this._changedEvent.raiseEvent(this);for(o=e(a,t,d),o<0?o=~o:o>0&&t.isStartIncluded&&a[o-1].isStartIncluded&&a[o-1].start.equals(t.start)?--o:o<a.length&&!t.isStartIncluded&&a[o].isStartIncluded&&a[o].start.equals(t.start)&&++o,o>0&&((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})));o<a.length&&((n=u.compare(t.stop,a[o].start))>0||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(n<i.length&&!s&&f.isStartIncluded&&o.equals(f.start)&&(r=!0,i.splice(n,0,new c({start:f.start,stop:f.start,isStartIncluded:!0,isStopIncluded:!0,data:f.data})),++n,f=i[n]);n<i.length&&u.greaterThan(a,f.stop);)r=!0,i.splice(n,1),f=i[n];return n<i.length&&a.equals(f.stop)&&(r=!0,!l&&f.isStopIncluded?(n+1<i.length&&i[n+1].start.equals(a)&&f.data===i[n+1].data?(i.splice(n,1),f=new c({start:f.start,stop:f.stop,isStartIncluded:!0,isStopIncluded:f.isStopIncluded,data:f.data})):f=new c({start:a,stop:a,isStartIncluded:!0,isStopIncluded:!0,data:f.data}),i[n]=f):i.splice(n,1)),n<i.length&&(u.greaterThan(a,f.start)||a.equals(f.start)&&l&&f.isStartIncluded)&&(r=!0,i[n]=new c({start:a,stop:f.stop,isStartIncluded:!l,isStopIncluded:f.isStopIncluded,data:f.data})),r&&this._changedEvent.raiseEvent(this),r},h.prototype.intersect=function(e,t,i){for(var n=0,o=0,a=new h,s=this._intervals,l=e._intervals;n<s.length&&o<l.length;){var d=s[n],p=l[o];if(u.lessThan(d.stop,p.start))++n;else if(u.lessThan(p.stop,d.start))++o;else{if(r(i)||r(t)&&t(d.data,p.data)||!r(t)&&p.data===d.data){var f=c.intersect(d,p,new c,i);f.isEmpty||a.addInterval(f,t)}u.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++n:++o}}return a},h.fromJulianDateArray=function(e,i){r(i)||(i=new h);var n,o=e.julianDates,a=o.length,s=e.dataCallback,u=t(e.isStartIncluded,!0),d=t(e.isStopIncluded,!0),p=t(e.leadingInterval,!1),f=t(e.trailingInterval,!1),m=0;p&&(++m,n=new c({start:l.MINIMUM_VALUE,stop:o[0],isStartIncluded:!0,isStopIncluded:!u}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n));for(var g=0;g<a-1;++g){var v=o[g],_=o[g+1];n=new c({start:v,stop:_,isStartIncluded:i.length!==m||u,isStopIncluded:g===a-2&&d}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n),v=_}return f&&(n=new c({start:o[a-1],stop:l.MAXIMUM_VALUE,isStartIncluded:!d,isStopIncluded:!0}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n)),i};var g=new a,v=[0,31,28,31,30,31,30,31,31,30,31,30,31],_=new u,y=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/,b=new a;return h.fromIso8601=function(e,t){var r=e.iso8601.split("/"),i=u.fromIso8601(r[0]),n=u.fromIso8601(r[1]),o=[];if(f(r[2],b)){var a=u.clone(i);for(o.push(a);u.compare(a,n)<0;){a=p(a,b);u.compare(n,a)<=0&&u.clone(n,a),o.push(a)}}else o.push(i,n);return h.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DateArray=function(e,t){return h.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return u.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DurationArray=function(e,i){for(var n,o,a=e.epoch,s=e.iso8601Durations,l=t(e.relativeToPrevious,!1),u=[],c=s.length,d=0;d<c;++d)(f(s[d],b)||0===d)&&(n=l&&r(o)?p(o,b):p(a,b),u.push(n),o=n);return h.fromJulianDateArray({julianDates:u,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},i)},h}),define("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,r,i){"use strict";var n=new e(1,1,1),o=e.ZERO,a=i.IDENTITY,s=function(r,s,l){this.translation=e.clone(t(r,o)),this.rotation=i.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||r(t)&&e.equals(this.translation,t.translation)&&i.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),define("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,r,i,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,n.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function s(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return r(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var r=this._clock;r!==e&&(t(r)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(a.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var r=this._element;r!==e&&(t(r)&&r.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=s(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),a.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,i(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(r){var i=this._element;if(t(i)&&!(i.readyState<2)){var a=i.paused,s=r.shouldAnimate;if(s===a&&(s?i.play():i.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);i.playbackRate=r.multiplier;var l,u=r.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),d=o.secondsDifference(u,c),h=i.duration,p=i.currentTime;i.loop?(d%=h,d<0&&(d=h-d),l=d):l=d>h?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,i.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./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;n<i.length;++n){var a=i[n],s=p.toRadians(parseFloat(a.getAttribute("minx"))),u=p.toRadians(parseFloat(a.getAttribute("miny"))),c=p.toRadians(parseFloat(a.getAttribute("maxx"))),d=p.toRadians(parseFloat(a.getAttribute("maxy"))),h=parseInt(a.getAttribute("maxlevel"),10);m._rectangles.push(new y(new f(s,u,c,d),h))}m._ready=!0,m._readyPromise.resolve(!0)}function o(e){var t=r(e,"An error occurred while accessing "+m._url+".");d=_.handleError(d,m,m._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(h(m._url),n,o)}i=r(i,r.EMPTY_OBJECT),this._url=i.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=i.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=i.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var d,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<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var d=c.rectangle,h=f.intersection(d,s,S);i(h)&&(w(o,d,2*t,2*r,n+1)&&(l|=4),w(o,d,2*t+1,2*r,n+1)&&(l|=8),w(o,d,2*t,2*r+1,n+1)&&(l|=1),w(o,d,2*t+1,2*r+1,n+1)&&(l|=2))}}return l}function w(e,t,r,n,o){var a=e.tileXYToRectangle(r,n,o);return i(f.intersection(a,t,S))}n(b.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),b.prototype.requestTileGeometry=function(t,r,n,o){var a=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._url+n+"/"+t+"/"+(a-r-1)+".tif?cesium=true",l=this._proxy;i(l)&&(s=l.getURL(s));var h=d(s,void 0,o);if(i(h)){var p=this;return e(h,function(e){return new c({buffer:u(e),width:p._heightmapWidth,height:p._heightmapHeight,childTileMask:C(p,t,r,n),structure:p._terrainDataStructure})})}},b.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var S=new f;return b.prototype.getTileDataAvailable=function(e,t,r){},b}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function l(r,i,n,o){var a=i.length;if(!(a<2)){var l=t(o),u=t(n),h=!0,p=new Array(a),f=new Array(a),m=new Array(a),g=i[0];p[0]=g;var v=r.cartesianToCartographic(g,c);u&&(v.height=n[0]),h=h&&v.height<=0,f[0]=v.height,m[0]=l?o[0]:0;for(var _=1,y=1;y<a;++y){var b=i[y],C=r.cartesianToCartographic(b,d);u&&(C.height=n[y]),h=h&&C.height<=0,s(v,C)?v.height<C.height&&(f[_-1]=C.height):(p[_]=b,f[_]=C.height,m[_]=l?o[y]:0,e.clone(C,v),++_)}if(!(h||_<2))return p.length=_,f.length=_,m.length=_,{positions:p,topHeights:f,bottomHeights:m}}}var u={},c=new e,d=new e,h=new Array(2),p=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,d,m){var g=l(e,s,u,c);if(t(g)){if(s=g.positions,u=g.topHeights,c=g.bottomHeights,s.length>=3){var v=r.fromPoints(s,e),_=v.projectPointsOntoPlane(s);n.computeWindingOrder2D(_)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,b,C=s.length,w=C-2,S=i.chordLength(d,e.maximumRadius),T=f;if(T.minDistance=S,T.ellipsoid=e,m){var E,x=0;for(E=0;E<C-1;E++)x+=o.numberOfPoints(s[E],s[E+1],S)+1;y=new Float64Array(3*x),b=new Float64Array(3*x);var P=h,A=p;T.positions=P,T.height=A;var D=0;for(E=0;E<C-1;E++){P[0]=s[E],P[1]=s[E+1],A[0]=u[E],A[1]=u[E+1];var I=o.generateArc(T);y.set(I,D),A[0]=c[E],A[1]=c[E+1],b.set(o.generateArc(T),D),D+=I.length}}else T.positions=s,T.height=u,y=new Float64Array(o.generateArc(T)),T.height=c,b=new Float64Array(o.generateArc(T));return{bottomPositions:b,topPositions:y,numCorners:w}}},u}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.vertexFormat,p.DEFAULT),u=i(e.granularity,d.RADIANS_PER_DEGREE),c=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var h=1+r.length*t.packedLength+2;n(s)&&(h+=s.length),n(o)&&(h+=o.length),this.packedLength=h+a.packedLength+p.packedLength+1}var g=new t,v=new t,_=new t,y=new t,b=new t,C=new t,w=new t,S=new t;m.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,p.pack(e._vertexFormat,r,o),o+=p.packedLength,r[o]=e._granularity,r};var T=a.clone(a.UNIT_SPHERE),E=new p,x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:T,vertexFormat:E,granularity:void 0};return m.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,T);r+=a.packedLength;var f=p.unpack(e,r,E);r+=p.packedLength;var g=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._vertexFormat=p.clone(f,o._vertexFormat),o._granularity=g,o):(x.positions=u,x.minimumHeights=c,x.maximumHeights=d,x.granularity=g,new m(x))},m.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}return new m({positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},m.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,p=i._maximumHeights,m=i._vertexFormat,T=i._granularity,E=i._ellipsoid,x=f.computePositions(E,o,p,a,T,!0);if(n(x)){var P=x.bottomPositions,A=x.topPositions,D=x.numCorners,I=A.length,O=2*I,M=m.position?new Float64Array(O):void 0,R=m.normal?new Float32Array(O):void 0,L=m.tangent?new Float32Array(O):void 0,N=m.bitangent?new Float32Array(O):void 0,k=m.st?new Float32Array(O/3*2):void 0,F=0,B=0,U=0,V=0,z=0,G=S,H=w,W=C,j=!0;I/=3;var q,Y=0,X=1/(I-o.length+1);for(q=0;q<I;++q){var Q=3*q,Z=t.fromArray(A,Q,g),K=t.fromArray(P,Q,v);if(m.position&&(M[F++]=K.x,M[F++]=K.y,M[F++]=K.z,M[F++]=Z.x,M[F++]=Z.y,M[F++]=Z.z),m.st&&(k[z++]=Y,k[z++]=0,k[z++]=Y,k[z++]=1),m.normal||m.tangent||m.bitangent){var J,$=t.clone(t.ZERO,b),ee=E.scaleToGeodeticSurface(t.fromArray(A,Q,v),v);if(q+1<I&&(J=E.scaleToGeodeticSurface(t.fromArray(A,Q+3,_),_),$=t.fromArray(A,Q+3,b)),j){var te=t.subtract($,Z,y),re=t.subtract(ee,Z,g);G=t.normalize(t.cross(re,te,G),G),j=!1}t.equalsEpsilon(J,ee,d.EPSILON10)?j=!0:(Y+=X,m.tangent&&(H=t.normalize(t.subtract(J,ee,H),H)),m.bitangent&&(W=t.normalize(t.cross(G,H,W),W))),m.normal&&(R[B++]=G.x,R[B++]=G.y,R[B++]=G.z,R[B++]=G.x,R[B++]=G.y,R[B++]=G.z),m.tangent&&(L[V++]=H.x,L[V++]=H.y,L[V++]=H.z,L[V++]=H.x,L[V++]=H.y,L[V++]=H.z),m.bitangent&&(N[U++]=W.x,N[U++]=W.y,N[U++]=W.z,N[U++]=W.x,N[U++]=W.y,N[U++]=W.z)}}var ie=new u;m.position&&(ie.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M})),m.normal&&(ie.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),m.tangent&&(ie.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),m.bitangent&&(ie.bitangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:N})),m.st&&(ie.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:k}));var ne=O/3;O-=6*(D+1);var oe=c.createTypedArray(ne,O),ae=0;for(q=0;q<ne-2;q+=2){var se=q,le=q+2,ue=t.fromArray(M,3*se,g),ce=t.fromArray(M,3*le,v);if(!t.equalsEpsilon(ue,ce,d.EPSILON10)){var de=q+1,he=q+3;oe[ae++]=de,oe[ae++]=se,oe[ae++]=he,oe[ae++]=he,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:ie,indices:oe,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(M)})}},m}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.granularity,d.RADIANS_PER_DEGREE),u=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+r.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var m=new t,g=new t;f.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,r[o]=e._granularity,r};var v=a.clone(a.UNIT_SPHERE),_={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:v,granularity:void 0};return f.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,v);r+=a.packedLength;var p=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._granularity=p,o):(_.positions=u,_.minimumHeights=c,_.maximumHeights=d,_.granularity=p,new f(_))},f.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}return new f({positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid})},f.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,f=i._maximumHeights,v=i._granularity,_=i._ellipsoid,y=p.computePositions(_,o,f,a,v,!1);if(n(y)){var b=y.bottomPositions,C=y.topPositions,w=C.length,S=2*w,T=new Float64Array(S),E=0;w/=3;var x;for(x=0;x<w;++x){var P=3*x,A=t.fromArray(C,P,m),D=t.fromArray(b,P,g);T[E++]=D.x,T[E++]=D.y,T[E++]=D.z,T[E++]=A.x,T[E++]=A.y,T[E++]=A.z}var I=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:T})}),O=S/3;S=2*O-4+O;var M=c.createTypedArray(O,S),R=0;for(x=0;x<O-2;x+=2){var L=x,N=x+2,k=t.fromArray(T,3*L,m),F=t.fromArray(T,3*N,g);if(!t.equalsEpsilon(k,F,d.EPSILON10)){var B=x+1,U=x+3;M[R++]=B,M[R++]=L,M[R++]=B,M[R++]=U,M[R++]=L,M[R++]=N}}return M[R++]=O-2,M[R++]=O-1,new s({attributes:I,indices:M,primitiveType:h.LINES,boundingSphere:new e.fromVertices(T)})}},f}),define("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,r,i,n,o,a){"use strict";function s(i){if(i=t(i,{}),this._ellipsoid=t(i.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(i.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(i.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),r(i.rectangleSouthwestInMeters)&&r(i.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=i.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=i.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return i(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){
  454. return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,n=i.project(o.southwest(e)),a=i.project(o.northeast(e));return r(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,i,n){var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,h=this._rectangleNortheastInMeters.y-t*d,p=this._rectangleNortheastInMeters.y-(t+1)*d;return r(n)?(n.west=u,n.south=p,n.east=c,n.north=h,n):new o(u,p,c,h)},s.prototype.tileXYToRectangle=function(t,r,i,n){var o=this.tileXYToNativeRectangle(t,r,i,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,i,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,d=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=d/l,p=this._projection,f=p.project(t),m=f.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-f.y,v=m/c|0;v>=s&&(v=s-1);var _=g/h|0;return _>=l&&(_=l-1),r(n)?(n.x=v,n.y=_,n):new e(v,_)}},s}),define("Core/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<this._count;s++){var l=o*this._count+s;t[s]=i[l]*(1-a)+i[l+this._count]*a}return t},a}),define("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}}return t}),define("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,r){"use strict";function i(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new r,this.setValue(e)}return t(i.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),i.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},i.prototype.setValue=function(t){var r=this._value;if(r!==t){var i=e(t),n=i&&"function"==typeof t.clone,o=i&&"function"==typeof t.equals;(!o||!t.equals(r))&&(this._hasClone=n,this._hasEquals=o,this._value=n?t.clone(this._value):t,this._definitionChanged.raiseEvent(this))}},i.prototype.equals=function(e){return this===e||e instanceof i&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},i.prototype.valueOf=function(){return this._value},i.prototype.toString=function(){return String(this._value)},i}),define("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,r){"use strict";function i(e,r,i,n,o){return{configurable:n,get:function(){return this[r]},set:function(n){var a=this[r],s=this[i];t(s)&&(s(),this[i]=void 0),!(void 0!==n)||t(n)&&t(n.getValue)||!t(o)||(n=o(n)),a!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new r(e)}function o(t,r,o){return i(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(r,!1),e(o,n))}return o}),define("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this._disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2})}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,LEFT:1,RIGHT:-1})}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1})}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";return e({DONE:0,PENDING:1,FAILED:2})}),define("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r,i){"use strict";function n(){i.throwInstantiationError()}return r(n.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),n.prototype.getValue=i.throwInstantiationError,n.prototype.equals=i.throwInstantiationError,n.equals=function(e,r){return e===r||t(e)&&e.equals(r)},n.arrayEquals=function(e,r){if(e===r)return!0;if(!t(e)||!t(r)||e.length!==r.length)return!1;for(var i=e.length,o=0;o<i;o++)if(!n.equals(e[o],r[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,r,i){return t(e)?e.getValue(r,i):void 0},n.getValueOrDefault=function(r,i,n,o){return t(r)?e(r.getValue(i,o),n):n},n.getValueOrClonedDefault=function(e,r,i,n){var o;return t(e)&&(o=e.getValue(r,n)),t(o)||(o=i.clone(o)),o},n}),define("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function g(t,r){r.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function v(e,t,r){o(e)&&(e.billboard=void 0,r.removeBillboard(t))}var _=n.WHITE,y=i.ZERO,b=c.NONE,C=r.ZERO,w=i.ZERO,S=d.CENTER,T=h.CENTER,E=new i,x=new n,P=new i,A=new r,D=new u,I=new u,O=new u,M=new t,R=new l;return g.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i<n;i++){var a,s=t[i],l=s.entity,u=l._billboard,c=s.billboard,d=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);if(d&&(E=f.getValueOrUndefined(l._position,e,E),a=f.getValueOrUndefined(u._image,e),d=o(E)&&o(a)),d){f.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=d,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=E,c.color=f.getValueOrDefault(u._color,e,_,x),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,y,P),c.heightReference=f.getValueOrDefault(u._heightReference,e,b),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,C,A),c.scale=f.getValueOrDefault(u._scale,e,1),c.rotation=f.getValueOrDefault(u._rotation,e,0),c.alignedAxis=f.getValueOrDefault(u._alignedAxis,e,w),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,S),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,T),c.width=f.getValueOrUndefined(u._width,e),c.height=f.getValueOrUndefined(u._height,e),c.scaleByDistance=f.getValueOrUndefined(u._scaleByDistance,e,D),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,I),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,O),c.sizeInMeters=f.getValueOrDefault(u._sizeInMeters,e,!1),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,R),c.disableDepthTestDistance=f.getValueOrDefault(u._disableDepthTestDistance,e,0);var h=f.getValueOrUndefined(u._imageSubRegion,e,M);o(h)&&c.setImageSubRegion(c._imageId,h)}else v(s,l,r)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.billboard))return p.FAILED;var n=r.billboard;if(n.heightReference===c.NONE)t.center=i.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=i.clone(n._clampedPosition,t.center)}return t.radius=0,p.DONE},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,r,i){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new m(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";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)
  455. ;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;i<r;++i){var n=t[i];if(!(e="function"==typeof n?e&&n():e&&n))break}return e},R.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;t<n;++t){var o=i[t];r=o.id;var s,l=o.image;s=new _(a(l.internalFormat)?{context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView}}:{context:e,source:l}),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var d=this._loadedCubeMaps;for(n=d.length,t=0;t<n;++t){var h=d[t];r=h.id;var p=h.images,f=new v({context:e,source:{positiveX:p[0],negativeX:p[1],positiveY:p[2],negativeY:p[3],positiveZ:p[4],negativeZ:p[5]}});this._textures[r]=f}d.length=0;var m=this._updateFunctions;for(n=m.length,t=0;t<n;++t)m[t](this,e);var g=this.materials;for(var y in g)g.hasOwnProperty(y)&&g[y].update(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];r!==this._defaultTexture&&r.destroy()}var i=this.materials;for(var n in i)i.hasOwnProperty(n)&&i[n].destroy();return l(this)};var X=["type","materials","uniforms","components","source"],Q=["diffuse","specular","shininess","normal","emission","alpha"],Z={mat2:f,mat3:m,mat4:g},K=/\.ktx$/i,J=/\.crn$/i;return R._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},R.DefaultImageId="czm_defaultImage",R.DefaultCubeMapId="czm_defaultCubeMap",R.ColorType="Color",R._materialCache.addMaterial(R.ColorType,{fabric:{type:R.ColorType,uniforms:{color:new r(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.ImageType="Image",R._materialCache.addMaterial(R.ImageType,{fabric:{type:R.ImageType,uniforms:{image:R.DefaultImageId,repeat:new e(1,1),color:new r(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.DiffuseMapType="DiffuseMap",R._materialCache.addMaterial(R.DiffuseMapType,{fabric:{type:R.DiffuseMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.AlphaMapType="AlphaMap",R._materialCache.addMaterial(R.AlphaMapType,{fabric:{type:R.AlphaMapType,uniforms:{image:R.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),R.SpecularMapType="SpecularMap",R._materialCache.addMaterial(R.SpecularMapType,{fabric:{type:R.SpecularMapType,uniforms:{image:R.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),R.EmissionMapType="EmissionMap",R._materialCache.addMaterial(R.EmissionMapType,{fabric:{type:R.EmissionMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.BumpMapType="BumpMap",R._materialCache.addMaterial(R.BumpMapType,{fabric:{type:R.BumpMapType,uniforms:{image:R.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:y},translucent:!1}),R.NormalMapType="NormalMap",R._materialCache.addMaterial(R.NormalMapType,{fabric:{type:R.NormalMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:T},translucent:!1}),R.GridType="Grid",R._materialCache.addMaterial(R.GridType,{fabric:{type:R.GridType,uniforms:{color:new r(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:S},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),R.StripeType="Stripe",R._materialCache.addMaterial(R.StripeType,{fabric:{type:R.StripeType,uniforms:{horizontal:!0,evenColor:new r(1,1,1,.5),oddColor:new r(0,0,1,.5),offset:0,repeat:5},source:I},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),R.CheckerboardType="Checkerboard",R._materialCache.addMaterial(R.CheckerboardType,{fabric:{type:R.CheckerboardType,uniforms:{lightColor:new r(1,1,1,.5),darkColor:new r(0,0,0,.5),repeat:new e(5,5)},source:b},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),R.DotType="Dot",R._materialCache.addMaterial(R.DotType,{fabric:{type:R.DotType,uniforms:{lightColor:new r(1,1,0,.75),darkColor:new r(0,1,1,.75),repeat:new e(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),R.WaterType="Water",R._materialCache.addMaterial(R.WaterType,{fabric:{type:R.WaterType,uniforms:{baseWaterColor:new r(.2,.3,.6,1),blendColor:new r(0,1,.699,1),specularMap:R.DefaultImageId,normalMap:R.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:O},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),R.RimLightingType="RimLighting",R._materialCache.addMaterial(R.RimLightingType,{fabric:{type:R.RimLightingType,uniforms:{color:new r(1,0,0,.7),rimColor:new r(1,1,1,.4),width:.3},source:D},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),R.FadeType="Fade",R._materialCache.addMaterial(R.FadeType,{fabric:{type:R.FadeType,uniforms:{fadeInColor:new r(1,0,0,1),fadeOutColor:new r(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:w},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),R.PolylineArrowType="PolylineArrow",R._materialCache.addMaterial(R.PolylineArrowType,{fabric:{type:R.PolylineArrowType,uniforms:{color:new r(1,1,1,1)},source:E},translucent:!0}),R.PolylineDashType="PolylineDash",R._materialCache.addMaterial(R.PolylineDashType,{fabric:{type:R.PolylineDashType,uniforms:{color:new r(1,0,1,1),gapColor:new r(0,0,0,0),dashLength:16,dashPattern:255},source:x},translucent:!0}),R.PolylineGlowType="PolylineGlow",R._materialCache.addMaterial(R.PolylineGlowType,{fabric:{type:R.PolylineGlowType,uniforms:{color:new r(0,.5,1,1),glowPower:.25},source:P},translucent:!0}),R.PolylineOutlineType="PolylineOutline",R._materialCache.addMaterial(R.PolylineOutlineType,{fabric:{type:R.PolylineOutlineType,uniforms:{color:new r(1,1,1,1),outlineColor:new r(1,0,0,1),outlineWidth:1},source:A},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),R}),define("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:h.fromType(h.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(r.fragmentShaderSource,o.fragmentShaderSource),this._renderState=d.getDefaultRenderState(i,n,r.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)}return r(p.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),
  456. p.prototype.getFragmentShaderSource=d.prototype.getFragmentShaderSource,p.prototype.isTranslucent=d.prototype.isTranslucent,p.prototype.getRenderState=d.prototype.getRenderState,p.MaterialSupport={BASIC:i({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:i({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:i({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),define("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),define("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),d=c?a:n,h=c?o:i,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,d),this._fragmentShaderSource=e(t.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=r.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),define("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===r.STREAM_DRAW||e===r.STATIC_DRAW||e===r.DYNAMIC_DRAW}};return e(r)}),define("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=e(t.cull,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=e(t.primitiveType,i.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=e(t.offset,0),this._instanceCount=e(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=e(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=e(t.castShadows,!1),this._receiveShadows=e(t.receiveShadows,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}return r(n.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}}}),n.shallowClone=function(e,r){if(t(e))return t(r)||(r=new n),r._boundingVolume=e._boundingVolume,r._orientedBoundingBox=e._orientedBoundingBox,r._cull=e._cull,r._modelMatrix=e._modelMatrix,r._primitiveType=e._primitiveType,r._vertexArray=e._vertexArray,r._count=e._count,r._offset=e._offset,r._instanceCount=e._instanceCount,r._shaderProgram=e._shaderProgram,r._uniformMap=e._uniformMap,r._renderState=e._renderState,r._framebuffer=e._framebuffer,r._pass=e._pass,r._executeInClosestFrustum=e._executeInClosestFrustum,r._owner=e._owner,r._debugShowBoundingVolume=e._debugShowBoundingVolume,r._debugOverlappingFrustums=e._debugOverlappingFrustums,r._castShadows=e._castShadows,r._receiveShadows=e._receiveShadows,r.dirty=!0,r.lastDirtyTime=0,r},n.prototype.execute=function(e,t){e.draw(this,t)},n}),define("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";return e({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,OVERLAY:9,NUMBER_OF_PASSES:10})}),define("Renderer/freezeRenderState",["../Core/defined","../Core/freezeObject"],function(e,t){"use strict";function r(e){if("object"!=typeof e||null===e)return e;for(var i,n=Object.keys(e),o=0;o<n.length;o++)i=n[o],e.hasOwnProperty(i)&&"_applyFunctions"!==i&&(e[i]=r(e[i]));return t(e)}return r}),define("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits","./freezeRenderState"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(n){var s=r(n,{}),l=r(s.cull,{}),u=r(s.polygonOffset,{}),c=r(s.scissorTest,{}),d=r(c.rectangle,{}),h=r(s.depthRange,{}),p=r(s.depthTest,{}),f=r(s.colorMask,{}),m=r(s.blending,{}),g=r(m.color,{}),v=r(s.stencilTest,{}),_=r(v.frontOperation,{}),y=r(v.backOperation,{}),b=r(s.sampleCoverage,{}),C=s.viewport;this.frontFace=r(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:r(l.enabled,!1),face:r(l.face,o.BACK)},this.lineWidth=r(s.lineWidth,1),this.polygonOffset={enabled:r(u.enabled,!1),factor:r(u.factor,0),units:r(u.units,0)},this.scissorTest={enabled:r(c.enabled,!1),rectangle:e.clone(d)},this.depthRange={near:r(h.near,0),far:r(h.far,1)},this.depthTest={enabled:r(p.enabled,!1),func:r(p.func,o.LESS)},this.colorMask={red:r(f.red,!0),green:r(f.green,!0),blue:r(f.blue,!0),alpha:r(f.alpha,!0)},this.depthMask=r(s.depthMask,!0),this.stencilMask=r(s.stencilMask,-1),this.blending={enabled:r(m.enabled,!1),color:new t(r(g.red,0),r(g.green,0),r(g.blue,0),r(g.alpha,0)),equationRgb:r(m.equationRgb,o.FUNC_ADD),equationAlpha:r(m.equationAlpha,o.FUNC_ADD),functionSourceRgb:r(m.functionSourceRgb,o.ONE),functionSourceAlpha:r(m.functionSourceAlpha,o.ONE),functionDestinationRgb:r(m.functionDestinationRgb,o.ZERO),functionDestinationAlpha:r(m.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:r(v.enabled,!1),frontFunction:r(v.frontFunction,o.ALWAYS),backFunction:r(v.backFunction,o.ALWAYS),reference:r(v.reference,0),mask:r(v.mask,-1),frontOperation:{fail:r(_.fail,o.KEEP),zFail:r(_.zFail,o.KEEP),zPass:r(_.zPass,o.KEEP)},backOperation:{fail:r(y.fail,o.KEEP),zFail:r(y.zFail,o.KEEP),zPass:r(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:r(b.enabled,!1),value:r(b.value,1),invert:r(b.invert,!1)},this.viewport=i(C)?new e(C.x,C.y,C.width,C.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,r){r?e.enable(t):e.disable(t)}function d(e,t){e.frontFace(t.frontFace)}function h(e,t){var r=t.cull,i=r.enabled;c(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function p(e,t){e.lineWidth(t.lineWidth)}function f(e,t){var r=t.polygonOffset,i=r.enabled;c(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function m(e,t,r){var n=t.scissorTest,o=i(r.scissorTest)?r.scissorTest.enabled:n.enabled;if(c(e,e.SCISSOR_TEST,o),o){var a=i(r.scissorTest)?r.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function g(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function v(e,t){var r=t.depthTest,i=r.enabled;c(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function _(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function y(e,t){e.depthMask(t.depthMask)}function b(e,t){e.stencilMask(t.stencilMask)}function C(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function w(e,t,r){var n=t.blending,o=i(r.blendingEnabled)?r.blendingEnabled:n.enabled;c(e,e.BLEND,o),o&&(C(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function S(e,t){var r=t.stencilTest,i=r.enabled;if(c(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,s=r.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=r.frontOperation,u=l.fail,d=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,d,h);var p=r.backOperation,f=p.fail,m=p.zFail,g=p.zPass;e.stencilOpSeparate(e.BACK,f,m,g)}}function T(e,t){var r=t.sampleCoverage,i=r.enabled;c(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)}function E(e,t,n){var o=r(t.viewport,n.viewport);i(o)||(o=D,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function x(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(d),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||r.push(h),e.lineWidth!==t.lineWidth&&r.push(p),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||r.push(f),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||r.push(g),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||r.push(v),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||r.push(_),e.depthMask!==t.depthMask&&r.push(y),e.stencilMask!==t.stencilMask&&r.push(b),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||r.push(S),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||r.push(T),r}var P=0,A={};u.fromCache=function(e){var t=JSON.stringify(e),r=A[t];if(i(r))return++r.referenceCount,r.state;var n=new u(e),o=JSON.stringify(n);return r=A[o],i(r)||(n.id=P++,r={referenceCount:0,state:n},A[o]=r),++r.referenceCount,A[t]={referenceCount:1,state:r.state},r.state},u.removeFromCache=function(e){var t=new u(e),r=JSON.stringify(t),n=A[r],o=JSON.stringify(e),a=A[o];i(a)&&0===--a.referenceCount&&(delete A[o],i(n)&&--n.referenceCount),i(n)&&0===n.referenceCount&&delete A[r]},u.getCache=function(){return A},u.clearCache=function(){A={}};var D=new e;return u.apply=function(e,t,r){d(e,t),h(e,t),p(e,t),f(e,t),g(e,t),v(e,t),_(e,t),y(e,t),b(e,t),S(e,t),T(e,t),m(e,t,r),w(e,t,r),E(e,t,r)},u.partialApply=function(e,t,r,n,o,a){if(t!==r){var s=r._applyFunctions[t.id];i(s)||(s=x(t,r),r._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,r)}((i(n.scissorTest)?n.scissorTest:t.scissorTest)!==(i(o.scissorTest)?o.scissorTest:r.scissorTest)||a)&&m(e,r,o);var c=i(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,d=i(o.blendingEnabled)?o.blendingEnabled:r.blending.enabled;(c!==d||d&&t.blending!==r.blending)&&w(e,r,o),t===r&&n===o&&n.context===o.context||E(e,r,o)},u.getState=function(r){return{frontFace:r.frontFace,cull:{enabled:r.cull.enabled,face:r.cull.face},lineWidth:r.lineWidth,polygonOffset:{enabled:r.polygonOffset.enabled,factor:r.polygonOffset.factor,units:r.polygonOffset.units},scissorTest:{enabled:r.scissorTest.enabled,rectangle:e.clone(r.scissorTest.rectangle)},depthRange:{near:r.depthRange.near,far:r.depthRange.far},depthTest:{enabled:r.depthTest.enabled,func:r.depthTest.func},colorMask:{red:r.colorMask.red,green:r.colorMask.green,blue:r.colorMask.blue,alpha:r.colorMask.alpha},depthMask:r.depthMask,stencilMask:r.stencilMask,blending:{enabled:r.blending.enabled,color:t.clone(r.blending.color),equationRgb:r.blending.equationRgb,equationAlpha:r.blending.equationAlpha,functionSourceRgb:r.blending.functionSourceRgb,functionSourceAlpha:r.blending.functionSourceAlpha,functionDestinationRgb:r.blending.functionDestinationRgb,functionDestinationAlpha:r.blending.functionDestinationAlpha},stencilTest:{enabled:r.stencilTest.enabled,frontFunction:r.stencilTest.frontFunction,backFunction:r.stencilTest.backFunction,reference:r.stencilTest.reference,mask:r.stencilTest.mask,frontOperation:{fail:r.stencilTest.frontOperation.fail,zFail:r.stencilTest.frontOperation.zFail,zPass:r.stencilTest.frontOperation.zPass},backOperation:{fail:r.stencilTest.backOperation.fail,zFail:r.stencilTest.backOperation.zFail,zPass:r.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:r.sampleCoverage.enabled,value:r.sampleCoverage.value,invert:r.sampleCoverage.invert},viewport:i(r.viewport)?e.clone(r.viewport):void 0}},u}),define("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,r){"use strict";function i(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};return o[r.FLOAT]="float",o[r.FLOAT_VEC2]="vec2",o[r.FLOAT_VEC3]="vec3",o[r.FLOAT_VEC4]="vec4",o[r.INT]="int",o[r.INT_VEC2]="ivec2",o[r.INT_VEC3]="ivec3",o[r.INT_VEC4]="ivec4",o[r.BOOL]="bool",o[r.BOOL_VEC2]="bvec2",o[r.BOOL_VEC3]="bvec3",o[r.BOOL_VEC4]="bvec4",o[r.FLOAT_MAT2]="mat2",o[r.FLOAT_MAT3]="mat3",o[r.FLOAT_MAT4]="mat4",o[r.SAMPLER_2D]="sampler2D",o[r.SAMPLER_CUBE]="samplerCube",i.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"},{czm_viewport:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new i({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new i({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new i({size:1,datatype:r.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_temeToPseudoFixed:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}})}}),define("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new w(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function h(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function f(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function m(e,t,r,i){this.name=r,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}function g(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function v(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function _(e,r,i,n){this.name=i,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,i,n){this.name=i,this.value=void 0,this._value=new r,this._gl=e,this._location=n}function b(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=i}function C(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=i}function w(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=i}return d.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},h.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},p.prototype.set=function(){var e=this.value;n(e.red)?i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},f.prototype.set=function(){var e=this.value;n(e.red)?i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},m.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},m.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},g.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},v.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},_.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;r.equals(e,this._value)||(r.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},b.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},C.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},w.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),define("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new w(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=i[0]}function h(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=i[0]}function p(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=i[0]}function f(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function m(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}function g(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=i[0]}function v(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=i[0]}function _(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=i[0]}function y(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=i[0]}function b(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function C(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=i[0]}function w(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=i[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1fv(this._location,r)},h.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,i)},p.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,o=!1,a=0,s=0;s<r;++s){var l=e[s];n(l.red)?l.red===i[a]&&l.green===i[a+1]&&l.blue===i[a+2]||(i[a]=l.red,i[a+1]=l.green,i[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,i,a)||(t.pack(l,i,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,i)},f.prototype.set=function(){
  457. for(var e=this.value,t=e.length,o=this._value,a=!1,s=0,l=0;l<t;++l){var u=e[l];n(u.red)?i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0):n(u.x)&&(r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},m.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,r=this.value,i=r.length,n=0;n<i;++n){var o=r[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},m.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,r=t.length,i=0;i<r;++i){var n=e+i;this._gl.uniform1i(t[i],n)}return e+r},g.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1iv(this._location,r)},v.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,i)},_.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=e[a];t.equalsArray(s,i,o)||(t.pack(s,i,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,i)},y.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];r.equalsArray(s,i,o)||(r.pack(s,i,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,i)},b.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,r,n)||(a.pack(s,r,n),i=!0),n+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,r,n)||(s.pack(a,r,n),i=!0),n+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,r)},w.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,r,n)||(l.pack(a,r,n),i=!0),n+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,r)},c}),define("Renderer/ShaderProgram",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){var t=p(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=b++}function h(e){var t=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(r(i))for(var n=i.length,o=0;o<n;o++){var a=i[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function p(e,t){var r={};if(!l.highpFloatSupported||!l.highpIntSupported){var i,n,o,a,s=h(e),u=h(t),c=s.length,d=u.length;for(i=0;i<c;i++)for(n=0;n<d;n++)if(s[i]===u[n]){o=s[i],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),r[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:r}}function f(e,t){var i=t._vertexShaderText,n=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,i),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),e.deleteShader(s);var u=t._attributeLocations;if(r(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var d;if(!e.getProgramParameter(l,e.LINK_STATUS)){var h=t._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(s),console.error(C+"Fragment shader compile log: "+d),r(h)){var p=h.getTranslatedShaderSource(s);""!==p?console.error(C+"Translated fragment shader source:\n"+p):console.error(C+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile. Compile log: "+d)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(o),console.error(C+"Vertex shader compile log: "+d),r(h)){var f=h.getTranslatedShaderSource(o);""!==f?console.error(C+"Translated vertex shader source:\n"+f):console.error(C+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile. Compile log: "+d)}throw d=e.getProgramInfoLog(l),console.error(C+"Shader program link log: "+d),r(h)&&(console.error(C+"Translated vertex shader source:\n"+h.getTranslatedShaderSource(o)),console.error(C+"Translated fragment shader source:\n"+h.getTranslatedShaderSource(s))),e.deleteProgram(l),new a("Program failed to link. Link log: "+d)}var m=t._logShaderCompilation;return m&&(d=e.getShaderInfoLog(o),r(d)&&d.length>0&&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<r;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function g(e,t){for(var i={},n=[],o=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var l=e.getActiveUniform(t,s),d=-1!==l.name.indexOf("[0]",l.name.length-"[0]".length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var h=e.getUniformLocation(t,d);if(null!==h){var p=u(e,l,d,h);i[d]=p,n.push(p),p._setSampler&&o.push(p)}}else{var f,m,g,v,_=d.indexOf("[");if(_>=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<l.size;++y)null!==(v=e.getUniformLocation(t,d+"["+y+"]"))&&m.push(v);f=c(e,l,d,m),i[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:i,uniforms:n,samplerUniforms:o}}function v(e,t){var i=[],n=[];for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],l=o,u=e._duplicateUniformNames[l];r(u)&&(a.name=u,l=u);var c=s[l];r(c)?i.push({uniform:a,automaticUniform:c}):n.push(a)}return{automaticUniforms:i,manualUniforms:n}}function _(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;o<n;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function y(e){if(!r(e._program)){var t=e._gl,i=f(t,e,e._debugShaders),n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES),o=g(t,i),a=v(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=n,e._vertexAttributes=m(t,i,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=_(t,i,o.samplerUniforms)}}var b=0;d.fromCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)},d.replaceCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)},i(d.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var C="[Cesium WebGL] ";return d.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},d.prototype._setUniforms=function(e,t,i){var n,o;if(r(e)){var a=this._manualUniforms;for(n=a.length,o=0;o<n;++o){var s=a[o];s.value=e[s.name]()}}var l=this._automaticUniforms;for(n=l.length,o=0;o<n;++o){var u=l[o];u.uniform.value=u.automaticUniform.getValue(t)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(i){var d=this._gl,h=this._program;d.validateProgram(h)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},d.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},d}),define("Renderer/modernizeShader",["../Core/defined","../Core/DeveloperError"],function(e,t){"use strict";function r(e,r){var n=/#define OUTPUT_DECLARATION/,c=e.split("\n");if(/#version 300 es/g.test(e))return e;var d,h,p=-1;for(d=0;d<c.length;++d)if(h=c[d],n.test(h)){p=d;break}if(-1===p)throw new t("Could not find a #define OUTPUT_DECLARATION!");var f=[];for(d=0;d<10;d++){var m="gl_FragData\\["+d+"\\]",g="czm_out"+d;new RegExp(m,"g").test(e)&&(s(g,f),i(m,g,c),c.splice(p,0,"layout(location = "+d+") out vec4 "+g+";"),p+=1)}o("gl_FragColor",c)&&(s("czm_fragColor",f),i("gl_FragColor","czm_fragColor",c),c.splice(p,0,"layout(location = 0) out vec4 czm_fragColor;"),p+=1);var v=l(f,c),_={};for(d=0;d<c.length;d++){h=c[d];for(var y in v)if(v.hasOwnProperty(y)){var b=new RegExp("(layout)[^]+(out)[^]+("+y+")[^]+","g");b.test(h)&&(_[h]=y)}}for(var C in _)if(_.hasOwnProperty(C)){var w,S=_[C],T=c.indexOf(C),E=v[S],x=E.length;for(w=0;w<x;w++)c.splice(T,0,E[w]);for(T+=x+1,w=x-1;w>=0;w--)c.splice(T,0,"#endif //"+E[w])}var P=!1;for(d=0;d<c.length;d++)/#version/.test(c[d])&&(c[d]="#version 300 es",P=!0);return P||c.splice(0,0,"#version 300 es"),u("EXT_draw_buffers",c),u("EXT_frag_depth",c),i("texture2D","texture",c),i("texture3D","texture",c),i("textureCube","texture",c),i("gl_FragDepthEXT","gl_FragDepth",c),r?i("varying","in",c):(i("attribute","in",c),i("varying","out",c)),a(c)}function i(e,t,r){for(var i="(^|[^\\w])("+e+")($|[^\\w])",n=new RegExp(i,"g"),o=r.length,a=0;a<o;++a){var s=r[a];r[a]=s.replace(n,"$1"+t+"$3")}}function n(e,t,r){for(var i=r.length,n=0;n<i;++n){var o=r[n];r[n]=o.replace(e,t)}}function o(e,t){for(var r="(^|[^\\w])("+e+")($|[^\\w])",i=new RegExp(r,"g"),n=t.length,o=0;o<n;++o){var a=t[o];if(i.test(a))return!0}return!1}function a(e){for(var t="",r=e.length,i=0;i<r;++i)t+=e[i]+"\n";return t}function s(e,t){-1===t.indexOf(e)&&t.push(e)}function l(t,r){for(var i={},n=t.length,o=[],a=0;a<r.length;++a){var s=r[a],l=/(#ifdef|#if)/g.test(s),u=/#else/g.test(s),c=/#endif/g.test(s);if(l)o.push(s);else if(u){var d=o[o.length-1],h=d.replace("ifdef","ifndef");/if/g.test(h)&&(h=h.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),o.pop(),o.push(h)}else if(c)o.pop();else if(!/layout/g.test(s))for(var p=0;p<n;++p){var f=t[p];-1!==s.indexOf(f)&&(e(i[f])?i[f]=i[f].filter(function(e){return o.indexOf(e)>=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"
  458. ;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;i<t;++i)r+="\n";return r})}function s(e,r,i){for(var n,o=0;o<i.length;++o)i[o].name===e&&(n=i[o]);return t(n)||(r=a(r),n={name:e,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)),n}function l(e,r){if(!e.evaluated){e.evaluated=!0;var i=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var i=s(t,h._czmBuiltinsAndUniforms[t],r);e.dependsOn.push(i),i.requiredBy.push(e),l(i,r)}}))}}function u(e){for(var t=[],r=[];e.length>0;){var i=e.pop();r.push(i),0===i.requiredBy.length&&t.push(i)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<r.length;++u)0!==r[u].requiredBy.length&&l.push(r[u])}function c(e){var t=[],r=s("main",e,t);l(r,t),u(t);for(var i="",n=t.length-1;n>=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;o<s;++o)l+="\n#line 0\n"+u[o];l=a(l);var d;l=l.replace(/#version\s+(.*?)\n/gm,function(e,t){return d=t,"\n"});var p=[];l=l.replace(/#extension.*\n/gm,function(e){return p.push(e),"\n"}),l=l.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var f=e.pickColorQualifier;t(f)&&(l=h.createPickFragmentShaderSource(l,f));var m="";t(d)&&(m="#version "+d+"\n");var g=p.length;for(o=0;o<g;o++)m+=p[o];r&&(m+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var v=e.defines;if(t(v))for(o=0,s=v.length;o<s;++o){var _=v[o];0!==_.length&&(m+="#define "+_+"\n")}return n.webgl2&&(m+="#define OUTPUT_DECLARATION\n\n"),e.includeBuiltIns&&(m+=c(l)),m+="\n#line 0\n",m+=l,n.webgl2&&(m=i(m,r,!0)),m}function h(r){r=e(r,e.EMPTY_OBJECT);var i=r.pickColorQualifier;this.defines=t(r.defines)?r.defines.slice(0):[],this.sources=t(r.sources)?r.sources.slice(0):[],this.pickColorQualifier=i,this.includeBuiltIns=e(r.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(e){return d(this,!1,e)},h.prototype.createCombinedFragmentShader=function(e){return d(this,!0,e)},h._czmBuiltinsAndUniforms={};for(var p in n)n.hasOwnProperty(p)&&(h._czmBuiltinsAndUniforms[p]=n[p]);for(var f in o)if(o.hasOwnProperty(f)){var m=o[f];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[f]=m.getDeclaration(f))}h.createPickVertexShaderSource=function(e){return h.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"},h.createPickFragmentShaderSource=function(e,t){return h.replaceMain(e,"czm_old_main")+"\n"+t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}"},h.findVarying=function(e,t){for(var r=e.sources,i=t.length,n=0;n<i;++n)for(var o=t[n],a=r.length,s=0;s<a;++s)if(-1!==r[s].indexOf(o))return o};var g=["v_normalEC","v_normal"];h.findNormalVarying=function(e){return h.findVarying(e,g)};var v=["v_positionEC"];return h.findPositionVarying=function(e){return h.findVarying(e,v)},h}),define("Renderer/Buffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e=t(e,t.EMPTY_OBJECT);var i=e.context._gl,n=e.bufferTarget,o=e.typedArray,a=e.sizeInBytes,s=e.usage,l=r(o);l&&(a=o.byteLength);var u=i.createBuffer();i.bindBuffer(n,u),i.bufferData(n,l?o:a,s),i.bindBuffer(n,null),this._gl=i,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return u.createVertexBuffer=function(e){return new u({context:e.context,bufferTarget:s.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},u.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=a.getSizeInBytes(r),o=new u({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),l=o.sizeInBytes/n;return i(o,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return l}}}),o},i(u.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),u.prototype._getBuffer=function(){return this._buffer},u.prototype.copyFromArrayView=function(e,r){r=t(r,0);var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,e),i.bindBuffer(n,null)},u.prototype.copyFromBuffer=function(e,t,r,i){var n=s.COPY_READ_BUFFER,o=s.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(n,e._buffer),a.copyBufferSubData(n,o,t,r,i),a.bindBuffer(o,null),a.bindBuffer(n,null)},u.prototype.getBufferData=function(e,r,i,n){r=t(r,0),i=t(i,0);var o=this._gl,a=s.COPY_READ_BUFFER;o.bindBuffer(a,this._buffer),o.getBufferSubData(a,r,e,i,n),o.bindBuffer(a,null)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),n(this)},u}),define("Renderer/VertexArray",["../Core/Check","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:r(n.index,o),enabled:r(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:r(n.componentDatatype,t.FLOAT),normalize:r(n.normalize,!1),offsetInBytes:r(n.offsetInBytes,0),strideInBytes:r(n.strideInBytes,0),instanceDivisor:r(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}e.push(c)}function m(e,t,r){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}i(r)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r._getBuffer())}function g(e){e=r(e,r.EMPTY_OBJECT);var n,o=e.context,a=o._gl,s=e.attributes,l=e.indexBuffer,u=[],c=1,d=!1,h=!1,p=s.length;for(n=0;n<p;++n)f(u,s[n],n,o);for(p=u.length,n=0;n<p;++n){var g=u[n];if(i(g.vertexBuffer)&&0===g.instanceDivisor){var v=g.strideInBytes||g.componentsPerAttribute*t.getSizeInBytes(g.componentDatatype);c=g.vertexBuffer.sizeInBytes/v;break}}for(n=0;n<p;++n)u[n].instanceDivisor>0&&(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;r<l;++r){var u=v(e[a[r]])
  459. ;if(u!==s)throw new c("Each attribute list must have the same number of vertices. Attribute "+a[r]+" has a different number of vertices ("+u.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(r,i){return t.getSizeInBytes(e[i].componentDatatype)-t.getSizeInBytes(e[r].componentDatatype)});var d=0,h={};for(r=0;r<l;++r)n=a[r],o=e[n],h[n]=d,d+=_(o);if(d>0){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;r<l;++r){n=a[r];var b=t.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:t.createTypedArray(e[n].componentDatatype,g),index:h[n]/b,strideInComponentType:d/b}}for(r=0;r<s;++r)for(var C=0;C<l;++C){n=a[C],o=e[n];for(var w=o.values,S=y[n],T=S.pointer,E=o.componentsPerAttribute,x=0;x<E;++x)T[S.index+x]=w[r*E+x];S.index+=S.strideInComponentType}return{buffer:g,offsetsInBytes:h,vertexSizeInBytes:d}}}function b(e){var t=e._context,r=e._hasInstancedAttributes;if(r||t._previousDrawInstanced){t._previousDrawInstanced=r;var i,n=t._vertexAttribDivisors,o=e._attributes,a=p.maximumVertexAttributes;if(r){var s=o.length;for(i=0;i<s;++i){var l=o[i];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(i=0;i<a;++i)n[i]>0&&(t.glVertexAttribDivisor(i,0),n[i]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o<n;++o){var a=r[o];a.enabled&&i(a.value)&&a.vertexAttrib(t)}}return g.fromGeometry=function(e){e=r(e,r.EMPTY_OBJECT);var n,o,a,c=e.context,p=r(e.geometry,r.EMPTY_OBJECT),f=r(e.bufferUsage,h.DYNAMIC_DRAW),m=r(e.attributeLocations,r.EMPTY_OBJECT),v=r(e.interleave,!1),_=e.vertexArrayAttributes,b=i(_)?_:[],C=p.attributes;if(v){var w=y(C);if(i(w)){a=d.createVertexBuffer({context:c,typedArray:w.buffer,usage:f});var S=w.offsetsInBytes,T=w.vertexSizeInBytes;for(n in C)C.hasOwnProperty(n)&&i(C[n])&&(o=C[n],i(o.values)?b.push({index:m[n],vertexBuffer:a,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:S[n],strideInBytes:T}):b.push({index:m[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in C)if(C.hasOwnProperty(n)&&i(C[n])){o=C[n];var E=o.componentDatatype;E===t.DOUBLE&&(E=t.FLOAT),a=void 0,i(o.values)&&(a=d.createVertexBuffer({context:c,typedArray:t.createTypedArray(E,o.values),usage:f})),b.push({index:m[n],vertexBuffer:a,value:o.value,componentDatatype:E,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,P=p.indices;return i(P)&&(x=s.computeNumberOfVertices(p)>=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<e.length;++r){var n=e[r];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var r=e[t].vertexBuffer;i(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy()}var n=this._indexBuffer;return i(n)&&!n.isDestroyed()&&n.vertexArrayDestroyable&&n.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),o(this)},g}),define("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(t,i,n){if(this._attributes=i,this._numberOfInstances=n,0!==i.length){var o=y(i),a=t.floatingPointTexture,s=o===p.FLOAT&&!a,l=C(i,s),u=w(l,i,s),c=Math.floor(h.maximumTextureSize/u),d=Math.min(n,c),f=u*d,m=Math.ceil(n/d),g=1/f,v=.5*g,_=1/m,b=.5*_;this._textureDimensions=new e(f,m),this._textureStep=new r(g,v,_,b),this._pixelDatatype=s?p.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var S=4*f*m;this._batchValues=o!==p.FLOAT||s?new Uint8Array(S):new Float32Array(S),this._batchValuesDirty=!1}}function y(e){for(var t=!1,r=e.length,i=0;i<r;++i)if(e[i].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?p.FLOAT:p.UNSIGNED_BYTE}function b(i,n){var o=i[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?r:Number}function C(e,t){for(var r=new Array(e.length),i=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;r[a]=i,l!==n.UNSIGNED_BYTE&&t?i+=4:++i}return r}function w(e,t,r){var i=e.length,o=e[i-1];return t[i-1].componentDatatype!==n.UNSIGNED_BYTE&&r?o+4:o+1}function S(e){var t=e.w/2,r=Math.floor(t),i=2*(t-r);if(r-=U,i=2*i-1,i=-i,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;i<r;++i)t+=R(this,i);return function(e){var r=e.indexOf("void main"),i=e.substring(0,r),n=e.substring(r);return i+"\n"+t+"\n"+n}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),s(this)},_}}),define("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS})}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t,i){var n,o=!i,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!h.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)r(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else h.multiplyTransformation(t,e[0].modelMatrix,t)}function m(e,r){var i=e.attributes,n=i.position,o=n.values.length/n.componentsPerAttribute;i.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=i.batchId.values,s=0;s<o;++s)a[s]=r}function g(e){for(var t=e.length,i=0;i<t;++i){var n=e[i];r(n.geometry)?m(n.geometry,i):r(n.westHemisphereGeometry)&&r(n.eastHemisphereGeometry)&&(m(n.westHemisphereGeometry,i),m(n.eastHemisphereGeometry,i))}}function v(i){var n,o,a=i.instances,s=i.projection,l=i.elementIndexUintSupported,u=i.scene3DOnly,d=i.vertexCacheOptimize,h=i.compressVertices,p=i.modelMatrix,m=a.length;for(n=0;n<m;++n)if(r(a[n].geometry)){a[n].geometry.primitiveType;break}if(f(a,p,u),!u)for(n=0;n<m;++n)r(a[n].geometry)&&c.splitLongitude(a[n]);if(g(a),d)for(n=0;n<m;++n){var v=a[n];r(v.geometry)?(c.reorderForPostVertexCache(v.geometry),c.reorderForPreVertexCache(v.geometry)):r(v.westHemisphereGeometry)&&r(v.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(v.westHemisphereGeometry),c.reorderForPreVertexCache(v.westHemisphereGeometry),c.reorderForPostVertexCache(v.eastHemisphereGeometry),c.reorderForPreVertexCache(v.eastHemisphereGeometry))}var _=c.combineInstances(a);for(m=_.length,n=0;n<m;++n){o=_[n];var y,b=o.attributes;if(u)for(y in b)b.hasOwnProperty(y)&&b[y].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,y,y+"3DHigh",y+"3DLow");else for(y in b)if(b.hasOwnProperty(y)&&b[y].componentDatatype===t.DOUBLE){var C=y+"3D",w=y+"2D";c.projectTo2D(o,y,C,w,s),r(o.boundingSphere)&&"position"===y&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,C,C+"High",C+"Low"),c.encodeAttribute(o,w,w+"High",w+"Low")}h&&c.compressVertices(o)}if(!l){var S=[];for(m=_.length,n=0;n<m;++n)o=_[n],S=S.concat(c.fitToUnsignedShortIndices(o));_=S}return _}function _(e,t,i,n){var o,a,s,l=n.length-1;if(l>=0){var u=n[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,d=0;d<c;++d){var h=e[d],p=h[t];if(r(p)){var f=p.indices.length;o+f>a&&(o=0,a=i[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var r=[];return _(e,"geometry",t,r),_(e,"westHemisphereGeometry",t,r),_(e,"eastHemisphereGeometry",t,r),r}function b(e,t){var i=e.attributes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o)&&r(o.values)&&t.push(o.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function C(e,t){for(var r=e.length,i=0;i<r;++i)b(e[i],t)}function w(t){for(var i=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++i,r(a)){var s=a.attributes;i+=6+2*e.packedLength+(r(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&r(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function S(e,t){var r=e.length,i=new Float64Array(1+16*r),n=0;i[n++]=r;for(var o=0;o<r;o++){var a=e[o];h.pack(a.modelMatrix,i,n),n+=h.packedLength}return t.push(i.buffer),i}function T(e){for(var t=e,r=new Array(t[0]),i=0,n=1;n<t.length;){var o=h.unpack(t,n);n+=h.packedLength,r[i++]={modelMatrix:o}}return r}function E(t){var i=t.length,n=1+(e.packedLength+1)*i,o=new Float32Array(n),a=0;o[a++]=i;for(var s=0;s<i;++s){var l=t[s];r(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function x(t){for(var r=new Array(t[0]),i=0,n=1;n<t.length;)1===t[n++]&&(r[i]=e.unpack(t,n)),++i,n+=e.packedLength;return r}if(!o.supportsTypedArrays())return{};var P={};return P.combineGeometry=function(t){var i,n,o,a=t.instances,s=a.length;s>0&&(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;d<s;++d){var h=a[d],p=h.geometry;r(p)&&(l[d]=p.boundingSphere,u[d]=p.boundingSphereCV);var f=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;r(f)&&r(m)&&(r(f.boundingSphere)&&r(m.boundingSphere)&&(l[d]=e.union(f.boundingSphere,m.boundingSphere)),r(f.boundingSphereCV)&&r(m.boundingSphereCV)&&(u[d]=e.union(f.boundingSphereCV,m.boundingSphereCV)))}return{geometries:i,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:o,boundingSpheres:l,boundingSpheresCV:u}},P.packCreateGeometryResults=function(t,i){var n=new Float64Array(w(t)),o=[],a={},s=t.length,l=0;n[l++]=s;for(var u=0;u<s;u++){var c=t[u],d=r(c);if(n[l++]=d?1:0,d){n[l++]=c.primitiveType,n[l++]=c.geometryType;var h=r(c.boundingSphere)?1:0;n[l++]=h,h&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=r(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var f=c.attributes,m=[];for(var g in f)f.hasOwnProperty(g)&&r(f[g])&&(m.push(g),r(a[g])||(a[g]=o.length,o.push(g)));n[l++]=m.length;for(var v=0;v<m.length;v++){var _=m[v],y=f[_];n[l++]=a[_],n[l++]=y.componentDatatype,n[l++]=y.componentsPerAttribute,n[l++]=y.normalize?1:0,n[l++]=y.values.length,n.set(y.values,l),l+=y.values.length}var b=r(c.indices)?c.indices.length:0;n[l++]=b,b>0&&(n.set(c.indices,l),l+=b)}}return i.push(n.buffer),{stringTable:o,packedData:n}},P.unpackCreateGeometryResults=function(r){for(var i,n=r.stringTable,o=r.packedData,a=new Array(o[0]),c=0,h=1;h<o.length;){if(1===o[h++]){var p,f,m=o[h++],g=o[h++];1===o[h++]&&(p=e.unpack(o,h)),h+=e.packedLength;1===o[h++]&&(f=e.unpack(o,h)),h+=e.packedLength;var v,_,y,b=new u,C=o[h++];for(i=0;i<C;i++){var w=n[o[h++]],S=o[h++];y=o[h++];var T=0!==o[h++];v=o[h++],_=t.createTypedArray(S,v);for(var E=0;E<v;E++)_[E]=o[h++];b[w]=new l({componentDatatype:S,componentsPerAttribute:y,normalize:T,values:_})}var x;if((v=o[h++])>0){var P=_.length/y;for(x=d.createTypedArray(P,v),i=0;i<v;i++)x[i]=o[h++]}a[c++]=new s({primitiveType:m,geometryType:g,boundingSphere:p,boundingSphereCV:f,indices:x,attributes:b})}else a[c++]=void 0}return a},P.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,i=r.length,n=0;n<i;n++)t.push(r[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:S(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},P.unpackCombineGeometryParameters=function(e){for(var t=T(e.packedInstances),r=e.createGeometryResults,i=r.length,o=0,s=0;s<i;s++)for(var l=P.unpackCreateGeometryResults(r[s]),u=l.length,c=0;c<u;c++){var d=l[c],f=t[o];f.geometry=d,++o}var m=n.clone(e.ellipsoid);return{instances:t,ellipsoid:m,projection:e.isGeographic?new a(m):new p(m),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},P.packCombineGeometryResults=function(e,t){r(e.geometries)&&C(e.geometries,t);var i=E(e.boundingSpheres),n=E(e.boundingSpheresCV);return t.push(i.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:i,boundingSpheresCV:n}},P.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}},P}),define("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";return e({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6})}),define("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),define("Scene/ShadowMode",["../Core/freezeObject"],function(e){"use strict";var t={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4};return t.castShadows=function(e){return e===t.ENABLED||e===t.CAST_ONLY},t.receiveShadows=function(e){return e===t.ENABLED||e===t.RECEIVE_ONLY},t.fromCastReceive=function(e,r){return e&&r?t.ENABLED:e?t.CAST_ONLY:r?t.RECEIVE_ONLY:t.DISABLED},e(t)}),define("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/isArray","../Core/Matrix4","../Core/RuntimeError","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BatchTable","./CullFace","./DepthFunction","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k,F,B,U){"use strict";function V(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=b.clone(u(e.modelMatrix,b.IDENTITY)),this._modelMatrix=new b,this.show=u(e.show,!0),this._vertexCacheOptimize=u(e.vertexCacheOptimize,!1),this._interleave=u(e.interleave,!1),this._releaseGeometryInstances=u(e.releaseGeometryInstances,!0),this._allowPicking=u(e.allowPicking,!0),this._asynchronous=u(e.asynchronous,!0),this._compressVertices=u(e.compressVertices,!0),this.cull=u(e.cull,!0),this.debugShowBoundingVolume=u(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=u(e.shadows,U.DISABLED),this._translucent=void 0,this._state=F.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=M.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function z(e){var t,r=e.length,i=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<r;++s){var l=e[s].attributes[t];if(!c(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&i.push(t)}return i}function G(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,de):3===n?r.unpack(e,0,he):4===n?i.unpack(e,0,pe):void 0}function H(e,t){var r=e.geometryInstances,i=y(r)?r:[r],n=i.length;if(0!==n){var o,s,d,h=z(i),p=h.length,f=e.allowPicking,m=[],g={},v={},_=i[0],b=_.attributes;for(o=0;o<p;++o)s=h[o],d=b[s],g[s]=o,m.push({functionName:"czm_batchTable_"+s,componentDatatype:d.componentDatatype,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize});-1!==h.indexOf("distanceDisplayCondition")&&(m.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:l.FLOAT,componentsPerAttribute:1}),v.center3DHigh=m.length-5,v.center3DLow=m.length-4,v.center2DHigh=m.length-3,v.center2DLow=m.length-2,v.radius=m.length-1),f&&m.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var C=m.length,w=new R(t,m,n);for(o=0;o<n;++o){var S=i[o];b=S.attributes;for(var T=0;T<p;++T){s=h[T],d=b[s];var E=G(d.value),x=g[s];w.setBatchedAttribute(o,x,E)}if(f){var P={primitive:u(S.pickPrimitive,e)};c(S.id)&&(P.id=S.id);var A=t.createPickId(P);e._pickIds.push(A);var D=A.color,I=pe;I.x=a.floatToByte(D.red),I.y=a.floatToByte(D.green),I.z=a.floatToByte(D.blue),I.w=a.floatToByte(D.alpha),w.setBatchedAttribute(o,C-1,I)}}e._batchTable=w,e._batchTableAttributeIndices=g,e._batchTableBoundingSphereAttributeIndices=v}}function W(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new v({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function j(t){var r=t.attributes,i=new _;for(var n in r)r.hasOwnProperty(n)&&c(r[n])&&(i[n]=W(r[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new g({attributes:i,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function q(e,t){return{geometry:t,modelMatrix:b.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function Y(e,t){if(!e.compressVertices)return t;var r=-1!==t.search(/attribute\s+vec3\s+normal;/g),i=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!r&&!i)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),a=i&&r?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(i){c+="vec2 st;\n";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;n<s;++n)i=r[n].geometry,a.push(r[n].id),d.push({moduleName:i._workerName,geometry:i});if(!c(me))for(me=new Array(ge),n=0;n<ge;n++)me[n]=new S("createGeometry",Number.POSITIVE_INFINITY);var h;for(d=w(d,ge),n=0;n<d.length;n++){var p=0,f=d[n],m=f.length;for(o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(h.offset=p,p+=u(i.constructor.packedLength,i.packedLength));var g;if(p>0){var v=new Float64Array(p);for(g=[v.buffer],o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,v,h.offset),h.geometry=v)}l.push(me[n].scheduleTask({subTasks:d[n]},g))}e._state=F.CREATING,M.all(l,function(t){e._createGeometryResults=t,e._state=F.CREATED}).otherwise(function(r){ce(e,t,F.FAILED,r)})}else if(e._state===F.CREATED){var _=[];r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var C=t.scene3DOnly,T=t.mapProjection,E=ve.scheduleTask(k.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:r,ellipsoid:T.ellipsoid,projection:T,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:C,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},_),_);e._createGeometryResults=void 0,e._state=F.COMBINING,M(E,function(r){var i=k.unpackCombineGeometryResults(r);e._geometries=i.geometries,e._attributeLocations=i.attributeLocations,e.modelMatrix=b.clone(i.modelMatrix,e.modelMatrix),e._pickOffsets=i.pickOffsets,e._instanceBoundingSpheres=i.boundingSpheres,e._instanceBoundingSpheresCV=i.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=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;i<o;i++){r=n[i];var u,d=r.geometry;u=c(d.attributes)&&c(d.primitiveType)?j(d):d.constructor.createGeometry(d),a[l++]=q(r,u),s.push(r.id)}a.length=l;var h=t.scene3DOnly,p=t.mapProjection,f=k.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=b.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=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;g<m;++g){var v=p[g];if(c(v)){var _=t.modelMatrix;c(_)&&(v=e.transform(v,_,Ce));var y=v.center,b=v.radius,C=f.fromCartesian(y,_e);h.setBatchedAttribute(g,n,C.high),h.setBatchedAttribute(g,o,C.low);var w=d.cartesianToCartographic(y,ye),S=u.project(w,be);C=f.fromCartesian(S,_e),h.setBatchedAttribute(g,a,C.high),h.setBatchedAttribute(g,s,C.low),h.setBatchedAttribute(g,l,b)}}t._batchTableBoundingSpheresUpdated=!0}}function te(t,r){
  460. for(var i=t._attributeLocations,n=t._geometries,o=r.scene3DOnly,a=r.context,s=[],l=n.length,u=0;u<l;++u){var d=n[u];if(s.push(O.fromGeometry({context:a,geometry:d,attributeLocations:i,bufferUsage:T.STATIC_DRAW,interleave:t._interleave})),c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(r,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!o){var h=d.boundingSphereCV.center,p=h.x,f=h.y,m=h.z;h.x=m,h.y=p,h.z=f,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=s,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,ce(t,r,F.COMPLETE,void 0)}function re(e,t,r,i){var n,a=r.getRenderState();i?(n=o(a,!1),n.cull={enabled:!0,face:L.BACK},e._frontFaceRS=A.fromCache(n),n.cull.face=L.FRONT,e._backFaceRS=A.fromCache(n)):(e._frontFaceRS=A.fromCache(a),e._backFaceRS=e._frontFaceRS),n=o(a,!1),c(e._depthFailAppearance)&&(n.depthTest.enabled=!1),e.allowPicking?i?(n.cull={enabled:!1},e._pickRS=A.fromCache(n)):e._pickRS=A.fromCache(n):(n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i?(n.cull={enabled:!1},e._pickRS=A.fromCache(n)):e._pickRS=A.fromCache(n)),c(e._depthFailAppearance)&&(a=e._depthFailAppearance.getRenderState(),n=o(a,!1),n.depthTest.func=N.GREATER,i?(n.cull={enabled:!0,face:L.BACK},e._frontFaceDepthFailRS=A.fromCache(n),n.cull.face=L.FRONT,e._backFaceDepthFailRS=A.fromCache(n)):(e._frontFaceDepthFailRS=A.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function ie(e,t,r){var i=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(r.vertexShaderSource);o=V._appendShowToShader(e,o),o=V._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=V._updateColorAttribute(e,o,!1),o=Y(e,o),o=V._modifyShaderPosition(e,o,t.scene3DOnly);var a=r.getFragmentShaderSource();if(e.allowPicking){var s=I.createPickVertexShaderSource(o);s=V._updatePickColorAttribute(s),e._pickSP=D.replaceCache({context:i,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:I.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=D.fromCache({context:i,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});Z(e._pickSP,n),e._sp=D.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Z(e._sp,n),c(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=V._appendShowToShader(e,o),o=V._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=V._updateColorAttribute(e,o,!0),o=Y(e,o),o=V._modifyShaderPosition(e,o,t.scene3DOnly),o=X(o),a=Q(e._depthFailAppearance.getFragmentShaderSource()),e._spDepthFail=D.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Z(e._spDepthFail,n))}function ne(e,t,r,i){var n=c(r)?r._uniforms:void 0,o={},a=t.uniforms;if(c(a))for(var l in a)a.hasOwnProperty(l)&&(o[l]=K(a,l));var u=s(o,n);return u=e._batchTable.getUniformMapCallback()(u),c(e.rtcCenter)&&(u.u_modifiedModelView=function(){var t=i.context.uniformState.view;return b.multiply(t,e._modelMatrix,we),b.multiplyByPoint(we,e.rtcCenter,Se),b.setTranslation(we,Se,we),we}),u}function oe(e,t,r,i,n,o,a,s){var l,u=ne(e,t,r,s);c(e._depthFailAppearance)&&(l=ne(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var d=i?P.TRANSLUCENT:P.OPAQUE,h=n?2:1;h*=c(e._depthFailAppearance)?2:1,o.length=e._va.length*h,a.length=e._va.length;for(var p=o.length,f=0,m=0,g=0;g<p;++g){var v;n&&(v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._backFaceRS,v.shaderProgram=e._sp,v.uniformMap=u,v.pass=d,++g),v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._frontFaceRS,v.shaderProgram=e._sp,v.uniformMap=u,v.pass=d,c(e._depthFailAppearance)&&(n&&(++g,v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._backFaceDepthFailRS,v.shaderProgram=e._spDepthFail,v.uniformMap=l,v.pass=d),++g,v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._frontFaceDepthFailRS,v.shaderProgram=e._spDepthFail,v.uniformMap=l,v.pass=d);var _=a[f];c(_)||(_=a[f]=new x({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._pickRS,_.shaderProgram=e._pickSP,_.uniformMap=u,_.pass=d,++f,++m}}function ae(e,t,r,i,n,o,a,s){V._updateBoundingVolumes(e,t,n);var l;t.mode===B.SCENE3D?l=e._boundingSphereWC:t.mode===B.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===B.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var u=t.commandList,d=t.passes;if(d.render){var h=U.castShadows(e.shadows),p=U.receiveShadows(e.shadows),f=r.length,m=s?2:1;m*=c(e._depthFailAppearance)?2:1;for(var g=0;g<f;++g){var v=Math.floor(g/m),_=r[g];_.modelMatrix=n,_.boundingVolume=l[v],_.cull=o,_.debugShowBoundingVolume=a,_.castShadows=h,_.receiveShadows=p,u.push(_)}}if(d.pick)for(var y=i.length,b=0;b<y;++b){var C=i[b];C.modelMatrix=n,C.boundingVolume=l[b],C.cull=o,u.push(C)}}function se(e,t,r){return function(){var i=e.getBatchedAttribute(t,r),n=e.attributes[r],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function le(e,t,r){return function(i){var n=G(i);e.setBatchedAttribute(t,r,n)}}function ue(t,r,i){r.boundingSphere={get:function(){var r=t._instanceBoundingSpheres[i],n=t.modelMatrix;return c(n)&&c(r)&&(r=e.transform(r,n)),r}},r.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[i]}}}function ce(e,t,r,i){e._error=i,e._state=r,t.afterRender.push(function(){e._ready=e._state===F.COMPLETE||e._state===F.FAILED,c(i)?e._readyPromise.reject(i):e._readyPromise.resolve(e)})}d(V.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var de=new t,he=new r,pe=new i,fe=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;V._modifyShaderPosition=function(e,t,r){for(var i,n="",o="",a="";null!==(i=fe.exec(t));){var s=i[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),c(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):r?a+=l+"\n{\n return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=l+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},V._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;return I.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}"},V._updateColorAttribute=function(e,t,r){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=r?i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},V._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},V._appendDistanceDisplayConditionToShader=function(e,t,r){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var i=I.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=r?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n",n+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}",i+"\n"+n};var me,ge=Math.max(m.hardwareConcurrency-1,1),ve=new S("combineGeometry",Number.POSITIVE_INFINITY),_e=new f,ye=new n,be=new r,Ce=new e,we=new b,Se=new r;return V._updateBoundingVolumes=function(t,r,i){var n,o,a,s=t.appearance.pixelSize;if(c(s))for(o=t._boundingSpheres.length,n=0;n<o;++n){a=t._boundingSpheres[n];var l=t._boundingSphereWC[n],u=r.camera.getPixelSize(a,r.context.drawingBufferWidth,r.context.drawingBufferHeight),d=u*s;l.radius=a.radius+d}if(!b.equals(i,t._modelMatrix))for(b.clone(i,t._modelMatrix),o=t._boundingSpheres.length,n=0;n<o;++n)a=t._boundingSpheres[n],c(a)&&(t._boundingSphereWC[n]=e.transform(a,i,t._boundingSphereWC[n]),r.scene3DOnly||(t._boundingSphere2D[n]=e.clone(t._boundingSphereCV[n],t._boundingSphere2D[n]),t._boundingSphere2D[n].center.x=0,t._boundingSphereMorph[n]=e.union(t._boundingSphereWC[n],t._boundingSphereCV[n])))},V.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&y(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==B.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==F.FAILED){var t=e.context;if(c(this._batchTable)||H(this,t),this._batchTable.attributes.length>0){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<n;++o){var a=(r+o)%n;if(e===i[a]){t=a;break}}if(-1!==t){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var h={};for(var p in u)if(u.hasOwnProperty(p)){var f=u[p];h[p]={get:se(l,t,f)};var m=!0,g=this._readOnlyInstanceAttributes;if(m&&c(g)){n=g.length;for(var v=0;v<n;++v)if(p===g[v]){m=!1;break}}m&&(h[p].set=le(l,t,f))}return ue(this,h,t),d(s,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var r=this._va;for(e=r.length,t=0;t<e;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,h(this)},V}),define("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"Color"},a.prototype.getValue=function(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,r,i){"use strict";function n(r,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),i.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),i.DONE):t(n)&&!n.ready||t(o)&&!o.ready?i.PENDING:i.FAILED}return n}),define("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i,n){"use strict";function o(){i.throwInstantiationError()}return r(o.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),o.prototype.getType=i.throwInstantiationError,o.prototype.getValue=i.throwInstantiationError,o.prototype.equals=i.throwInstantiationError,o.getValue=function(r,i,o){var a;return t(i)&&(a=i.getType(r),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),i.getValue(r,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),define("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.dimensions=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,"box",e.box,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity)}var P=new y(r.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),O=new b(r.BLACK),M=new b(_.DISABLED),R=new b(new u),L=new r;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(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new f(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),d=this._distanceDisplayConditionProperty.getValue(t),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var g=r.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(g=this._materialProperty.color.getValue(t)),a=i.fromColor(g),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s.computeModelMatrix(p.MINIMUM_VALUE),attributes:n})},E.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=S.getValueOrDefault(this._outlineColorProperty,e,r.BLACK),s=this._distanceDisplayConditionProperty.getValue(e);return new h({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n.computeModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},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||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.dimensions,h=e.position,f=a.show;if(!o(d)||!o(h)||o(f)&&f.isConstant&&!f.getValue(p.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=n(a.material,P),_=v instanceof y;this._materialProperty=v,this._fillProperty=n(s,D),this._showProperty=n(f,A),this._showOutlineProperty=n(a.outline,I),this._outlineColorProperty=c?n(a.outlineColor,O):void 0,this._shadowsProperty=n(a.shadows,M),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,R);var b=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&S.isConstant(e.orientation)&&d.isConstant&&S.isConstant(b)){var C=this._options;C.vertexFormat=_?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,C.dimensions=d.getValue(p.MINIMUM_VALUE,C.dimensions),this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},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.box;if(l.isShowing&&l.isAvailable(n)&&S.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l.computeModelMatrix(n),f=S.getValueOrUndefined(u.dimensions,n,d.dimensions);if(o(p)&&o(f)){d.dimensions=f;var _=this._geometryUpdater.shadowsProperty.getValue(n),y=this._geometryUpdater.distanceDisplayConditionProperty,b=y.getValue(n),C=c.fromDistanceDisplayCondition(b);if(S.getValueOrDefault(u.fill,n,!0)){var T=w.getValue(n,s.fillMaterialProperty,this._material);this._material=T;var E=new m({material:T,translucent:T.isTranslucent(),closed:!0});d.vertexFormat=E.vertexFormat,this._primitive=a.add(new v({geometryInstances:new h({id:l,geometry:e.fromDimensions(d),modelMatrix:p,attributes:{distanceDisplayCondition:C}}),appearance:E,asynchronous:!1,shadows:_}))}if(S.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=g.VERTEX_FORMAT;var x=S.getValueOrClonedDefault(u.outlineColor,n,r.BLACK,L),P=S.getValueOrDefault(u.outlineWidth,n,1),A=1!==x.alpha;this._outlinePrimitive=a.add(new v({geometryInstances:new h({id:l,geometry:t.fromDimensions(d),modelMatrix:p,attributes:{color:i.fromColor(x),distanceDisplayCondition:C}}),appearance:new g({flat:!0,translucent:A,renderState:{lineWidth:s._scene.clampLineWidth(P)}}),asynchronous:!1,shadows:_}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},E}),define("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}var u=new e(1,1),c=t.WHITE;return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._image)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:a("image"),repeat:a("repeat"),color:a("color"),transparent:a("transparent")}),l.prototype.getType=function(e){return"Image"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.image=s.getValueOrUndefined(this._image,e),t.repeat=s.getValueOrClonedDefault(this._repeat,e,u,t.repeat),t.color=s.getValueOrClonedDefault(this._color,e,c,t.color),s.getValueOrDefault(this._transparent,e,!1)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._image,e._image)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,r,i,n){"use strict";function o(t){if(t instanceof e)return new r(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var i=new n;return i.image=t,i}}function a(e,t){return i(e,t,o)}return a}),define("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,r,i){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new i,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var r=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,r&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),define("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,d=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,d),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";function s(){i.throwInstantiationError()}r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(t(c)||(c=new e),s===u)return e.clone(i,c);var d=a.computeIcrfToFixedMatrix(r,l);return t(d)||(d=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(d,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(d,l),i,c):void 0},s}),define("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,i){this._definitionChanged=new o,this._value=e.clone(r),this._referenceFrame=t(i,a.FIXED)}return i(l.prototype,{isConstant:{get:function(){return!r(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){
  461. return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,i){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),r(i)&&this._referenceFrame!==i&&(n=!0,this._referenceFrame=i),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,r)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),define("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function r(r,i){return e(r,i,t)}return r}),define("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),scaleByDistance:o("scaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.heightReference=this.heightReference,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.heightReference=e(this.heightReference,t.heightReference),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new i,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,r){return t(r)||(r=new n),r.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,r.translation),r.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,r.rotation),r.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,r.scale),r},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),define("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var r=e._propertyNames,i=t._propertyNames,n=r.length;if(n!==i.length)return!1;for(var o=0;o<n;++o){var a=r[o];if(-1===i.indexOf(a))return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,r){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,r)};return r(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,r=e.length;t<r;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},c.prototype.addProperty=function(r,i,n){this._propertyNames.push(r),Object.defineProperty(this,r,a(r,!0,e(n,l))),t(i)&&(this[r]=i),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,r){t(r)||(r={});for(var i=this._propertyNames,n=0,o=i.length;n<o;n++){var a=i[n];r[a]=s.getValueOrUndefined(this[a],e,r[a])}return r},c.prototype.merge=function(e,r){for(var i=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;o<a;o++){var s=n[o],l=this[s],u=e[s];void 0===l&&-1===i.indexOf(s)&&this.addProperty(s,void 0,r),void 0!==u&&(void 0!==l?t(l)&&t(l.merge)&&l.merge(u):t(u)&&t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),define("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),shadows:o("shadows"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount")}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e):new c(this)},c.prototype.merge=function(r){this.show=e(this.show,r.show),this.scale=e(this.scale,r.scale),this.minimumPixelSize=e(this.minimumPixelSize,r.minimumPixelSize),this.maximumScale=e(this.maximumScale,r.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,r.incrementallyLoadTextures),this.shadows=e(this.shadows,r.shadows),this.uri=e(this.uri,r.uri),this.runAnimations=e(this.runAnimations,r.runAnimations),this.heightReference=e(this.heightReference,r.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,r.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,r.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,r.silhouetteSize),this.color=e(this.color,r.color),this.colorBlendMode=e(this.colorBlendMode,r.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,r.colorBlendAmount);var i=r.nodeTransformations;if(t(i)){var n=this.nodeTransformations;t(n)?n.merge(i):this.nodeTransformations=new s(i,l)}},c}),define("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.heightReference=this.heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.heightReference=e(this.heightReference,t.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._definitionChanged=new n,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),depthFailMaterial:o("depthFailMaterial"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,
  462. e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.depthFailMaterial=e(this.depthFailMaterial,t.depthFailMaterial),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/Entity",["../Core/Cartesian3","../Core/Check","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./PropertyBag","./RectangleGraphics","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O){"use strict";function M(e){return new f(e)}function R(e,t){return g(e,void 0,function(e){return e instanceof t?e:new t(e)})}function L(e){e=i(e,i.EMPTY_OBJECT);var t=e.id;n(t)||(t=r()),this._availability=void 0,this._id=t,this._definitionChanged=new s,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function N(e,t,r){for(var i=t.length,n=0;n<i;n++){var o=t[n],a=o._show;(!r&&a)!==(r&&a)&&N(o,o._children,r)}e._definitionChanged.raiseEvent(e,"isShowing",r,!r)}o(L.prototype,{availability:v("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:v("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var r=this.isShowing;t!==r&&N(this,this._children,r),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!n(this.entityCollection)||this.entityCollection.show)&&(!n(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var r=this.isShowing;if(n(t)){var i=t._children.indexOf(this);t._children.splice(i,1)}this._parent=e,n(e)&&e._children.push(this);var o=this.isShowing;r!==o&&N(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",h),box:R("box",p),corridor:R("corridor",m),cylinder:R("cylinder",_),description:g("description"),ellipse:R("ellipse",y),ellipsoid:R("ellipsoid",b),label:R("label",C),model:R("model",w),orientation:g("orientation"),path:R("path",S),point:R("point",T),polygon:R("polygon",E),polyline:R("polyline",x),polylineVolume:R("polylineVolume",P),properties:R("properties",D),position:function(e){return g(e,void 0,M)}("position"),rectangle:R("rectangle",I),viewFrom:g("viewFrom"),wall:R("wall",O)}),L.prototype.isAvailable=function(e){var t=this._availability;return!n(t)||t.contains(e)},L.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,v(e,!0))},L.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e]},L.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,r=n(e._propertyNames)?e._propertyNames:Object.keys(e),o=r.length,a=0;a<o;a++){var s=r[a];if("parent"!==s){var l=this[s],u=e[s];n(l)||-1!==t.indexOf(s)||this.addProperty(s),n(u)&&(n(l)?n(l.merge)&&l.merge(u):n(u.merge)&&n(u.clone)?this[s]=u.clone():this[s]=u)}}};var k=new l,F=new e,B=new c;return L.prototype.computeModelMatrix=function(e,r){t.typeOf.object("time",e);var i=A.getValueOrUndefined(this._position,e,F);if(n(i)){var o=A.getValueOrUndefined(this._orientation,e,B);return r=n(o)?u.fromRotationTranslation(l.fromQuaternion(o,k),i,r):d.eastNorthUpToFixedFrame(i,void 0,r)}},L}),define("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,r=e._removedEntities,i=e._changedEntities;if(0!==i.length||0!==t.length||0!==r.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=r.values.slice(0),a=i.values.slice(0);t.removeAll(),r.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function h(r){this._owner=r,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t(),this._show=!0,this._firing=!1,this._refire=!1}var p={id:void 0};return h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,d(this)},h.collectionChangedEventCallback=void 0,i(h.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e!==this._show){this.suspendEvents();var t,r=[],i=this._entities.values,n=i.length;for(t=0;t<n;t++)r.push(i[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=r[t],a=i[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._entities.values,n=0,o=i.length;n<o;n++){var l=i[n],c=l.availability;if(r(c)){var d=c.start,h=c.stop;s.lessThan(d,e)&&!d.equals(a.MINIMUM_VALUE)&&(e=d),s.greaterThan(h,t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},h.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,r=this._entities;if(r.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,r.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),e},h.prototype.remove=function(e){return!!r(e)&&this.removeById(e.id)},h.prototype.contains=function(e){return this._entities.get(e.id)===e},h.prototype.removeById=function(e){if(!r(e))return!1;var t=this._entities,i=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,i),this._changedEntities.remove(e)),this._entities.remove(e),i.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),!0)},h.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=i[a],l=s.id,u=n.get(l);r(u)||(s.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),d(this)},h.prototype.getById=function(e){return this._entities.get(e)},h.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return r(t)||(p.id=e,t=new c(p),this.add(t)),t},h.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),d(this)},h}),define("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;i<r;i++)e[t[i]]=void 0}function l(e,t,r,i){m[0]=r,m[1]=i.id,t[JSON.stringify(m)]=i.definitionChanged.addEventListener(d.prototype._onDefinitionChanged,e)}function u(e,t,r,i){m[0]=r,m[1]=i.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,c,h,p,m=e._collections,g=m.length,v=e._collectionsCopy,_=v.length,y=e._composite,b=new a(e),C=e._eventHash;for(r=0;r<_;r++)for(h=v[r],h.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,C,p,i);for(r=g-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,C,p,i);var w=b.getById(i.id);t(w)||(w=y.getById(i.id),t(w)?s(w):(f.id=i.id,w=new o(f)),b.add(w)),w.merge(i)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var S=b.values;for(r=0;r<S.length;r++)y.add(S[r]);y.resumeEvents()}}function d(r,i){this._owner=i,this._composite=new a(this),this._suspendCount=0,this._collections=t(r)?r.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function h(e,t){return e.indexOf(t)}function p(e,t,r){var i=e._collections;if(t=n.clamp(t,0,i.length-1),r=n.clamp(r,0,i.length-1),t!==r){var o=i[t];i[t]=i[r],i[r]=o,c(e)}}var f={id:void 0},m=new Array(2);return r(d.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),d.prototype.addCollection=function(e,r){t(r)?this._collections.splice(r,0,e):(r=this._collections.length,this._collections.push(e)),c(this)},d.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t&&(this._collections.splice(t,1),c(this),!0)},d.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},d.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},d.prototype.contains=function(e){return this._composite.contains(e)},d.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},d.prototype.getCollection=function(e){return this._collections[e]},d.prototype.getCollectionsLength=function(){return this._collections.length},d.prototype.raiseCollection=function(e){var t=h(this._collections,e);p(this,t,t+1)},d.prototype.lowerCollection=function(e){var t=h(this._collections,e);p(this,t,t-1)},d.prototype.raiseCollectionToTop=function(e){var t=h(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},d.prototype.lowerCollectionToBottom=function(e){var t=h(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},d.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},d.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},d.prototype.computeAvailability=function(){return this._composite.computeAvailability()},d.prototype.getById=function(e){return this._composite.getById(e)},d.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var d,h,p,m,g=i.length,v=this._eventHash,_=e.id;for(d=0;d<g;d++){var y=i[d];u(this,v,_,y);var b=y.id;for(h=a-1;h>=0;h--)p=n[h].getById(b),t(p)&&(t(m)||(m=c.getById(b),s(m)),m.merge(p));t(m)||c.removeById(b),m=void 0}var C=r.length;for(d=0;d<C;d++){var w=r[d];l(this,v,_,w);var S=w.id;for(h=a-1;h>=0;h--)p=n[h].getById(S),t(p)&&(t(m)||(m=c.getById(S),t(m)?s(m):(f.id=S,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,r,i,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[r],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[r];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&-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;l<s;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new i,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,r){var i=this._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),define("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getType(t)},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return r(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,r,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\n#ifdef GL_EXT_frag_depth\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),define("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),define("Scene/ClassificationType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2})}),define("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS})}),define("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP})}),define("Scene/ClassificationPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./ClassificationType","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function T(e){e=t(e,t.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=t(e.show,!0),this.classificationType=t(e.classificationType,v.BOTH),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=t(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=t(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._readyPromise=m.defer(),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive;var i,n=new y({flat:!0});r(this.geometryInstances)&&s(this.geometryInstances)&&this.geometryInstances.length>1&&(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){
  463. 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;o<n;o+=3){var d=i._va[s++];a=t[o],r(a)||(a=t[o]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsStencilPreloadPass,a.shaderProgram=e._sp,a.uniformMap=c,a.pass=u.TERRAIN_CLASSIFICATION,a=t[o+1],r(a)||(a=t[o+1]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsStencilDepthPass,a.shaderProgram=e._sp,a.uniformMap=c,a.pass=u.TERRAIN_CLASSIFICATION,a=t[o+2],r(a)||(a=t[o+2]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsColorPass,a.shaderProgram=e._sp,a.uniformMap=c,a.pass=u.TERRAIN_CLASSIFICATION}for(o=0;o<n;++o)a=t[n+o]=l.shallowClone(t[o],t[n+o]),a.pass=u.CESIUM_3D_TILE_CLASSIFICATION;var h=e._commandsIgnoreShow,p=e._spStencil,f=0;n=h.length=n/3*2;for(var m=0;m<n;m+=2){var g=h[m]=l.shallowClone(t[f],h[m]);g.shaderProgram=p,g.pass=u.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g=h[m+1]=l.shallowClone(t[f+1],h[m+1]),g.shaderProgram=p,g.pass=u.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,f+=3}}function M(e,t){var i=e._primitive,n=i._pickOffsets,o=3*n.length;t.length=2*o;var a,s,c=0,d=i._batchTable.getUniformMapCallback()(e._uniformMap);for(a=0;a<o;a+=3){var h=n[c++],p=h.offset,f=h.count,m=i._va[h.index];s=t[a],r(s)||(s=t[a]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=m,s.offset=p,s.count=f,s.renderState=e._rsStencilPreloadPass,s.shaderProgram=e._spStencil,s.uniformMap=d,s.pass=u.TERRAIN_CLASSIFICATION,s=t[a+1],r(s)||(s=t[a+1]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=m,s.offset=p,s.count=f,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._spStencil,s.uniformMap=d,s.pass=u.TERRAIN_CLASSIFICATION,s=t[a+2],r(s)||(s=t[a+2]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=m,s.offset=p,s.count=f,s.renderState=e._rsPickPass,s.shaderProgram=e._spPick,s.uniformMap=d,s.pass=u.TERRAIN_CLASSIFICATION}for(a=0;a<o;++a)s=t[o+a]=l.shallowClone(t[a],t[o+a]),s.pass=u.CESIUM_3D_TILE_CLASSIFICATION}function R(e,t,r,i,n,o,a){O(e,o),M(e,a)}function L(e,t){return Math.floor(e%(t/2)/3)}function N(e,t){var r,i;return e===v.TERRAIN?(r=0,i=t/2):e===v.CESIUM_3D_TILE?(r=t/2,i=t):(r=0,i=t),z.start=r,z.end=i,z}function k(e,t,i,n,o,a,s,l){var u=e._primitive;b._updateBoundingVolumes(u,t,o);var c;t.mode===C.SCENE3D?c=u._boundingSphereWC:t.mode===C.COLUMBUS_VIEW?c=u._boundingSphereCV:t.mode===C.SCENE2D&&r(u._boundingSphere2D)?c=u._boundingSphere2D:r(u._boundingSphereMorph)&&(c=u._boundingSphereMorph);var d,h,p,f,m=t.commandList,g=t.passes,v=e.classificationType;if(g.render){var _,y=i.length;for(h=N(v,y),p=h.start,f=h.end,d=p;d<f;++d)_=i[d],_.modelMatrix=o,_.boundingVolume=c[L(d,y)],_.cull=a,_.debugShowBoundingVolume=s,m.push(_);if(t.invertClassification){var w=e._commandsIgnoreShow;for(p=0,f=w.length,d=p;d<f;++d){var S=Math.floor(d/2);_=w[d],_.modelMatrix=o,_.boundingVolume=c[S],_.cull=a,_.debugShowBoundingVolume=s,m.push(_)}}}if(g.pick){var T=n.length;h=N(v,T),p=h.start,f=h.end;var E=u._pickOffsets;for(d=p;d<f;++d){var x=E[L(d,T)],P=n[d];P.modelMatrix=o,P.boundingVolume=c[x.index],P.cull=a,m.push(P)}}}var F=["color"];i(T.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),T.isSupported=function(e){return e.context.stencilBuffer};var B=15,U=0,V={stencilTest:{enabled:!0,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},z={start:0,end:0};return T.prototype.update=function(e){if(this.show&&(r(this._primitive)||r(this.geometryInstances))){var i=this,n=this._primitiveOptions;if(!r(this._primitive)){var o,l,u=s(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=u.length,h=new Array(d);for(o=0;o<d;++o)l=u[o],h[o]=new a({geometry:l.geometry,attributes:l.attributes,modelMatrix:l.modelMatrix,id:l.id,pickPrimitive:t(this._pickPrimitive,i)});n.geometryInstances=h,r(this._createBoundingVolumeFunction)&&(n._createBoundingVolumeFunction=function(e,t){i._createBoundingVolumeFunction(e,t)}),n._createRenderStatesFunction=function(e,t,r,n){A(i,t)},n._createShaderProgramFunction=function(e,t,r){I(i,t)},n._createCommandsFunction=function(e,t,r,n,o,a,s){R(i,void 0,void 0,!0,!1,a,s)},r(this._updateAndQueueCommandsFunction)?n._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){i._updateAndQueueCommandsFunction(e,t,r,n,o,a,s,l)}:n._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){k(i,t,r,n,o,a,s,l)},this._primitive=new b(n),this._primitive.readyPromise.then(function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;r(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=c.fromCache(E(!1)),this._rsStencilDepthPass=c.fromCache(x(!1)),this._rsColorPass=c.fromCache(P(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=c.fromCache(E(!0)),this._rsStencilDepthPass=c.fromCache(x(!0)),this._rsColorPass=c.fromCache(P(!0))),this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},T.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),n(this)},T}),define("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/loadJson","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../ThirdParty/when","./ClassificationPrimitive","./ClassificationType","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e){e=o(e,o.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=o(e.show,!0),this.classificationType=o(e.classificationType,y.BOTH),this.debugShowBoundingVolume=o(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=o(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=v.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=C._defaultMaxTerrainHeight,this._minTerrainHeight=C._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t=this;this._primitiveOptions={geometryInstances:void 0,vertexCacheOptimize:o(e.vertexCacheOptimize,!1),interleave:o(e.interleave,!1),releaseGeometryInstances:o(e.releaseGeometryInstances,!0),allowPicking:o(e.allowPicking,!0),asynchronous:o(e.asynchronous,!0),compressVertices:o(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:t,_extruded:!0,_uniformMap:M}}function w(e){return function(t,r){var i=r.maximumRadius,n=i/Math.cos(.5*t)-i;return e._maxHeight+n}}function S(e){return function(t,r){return e._minHeight}}function T(e,t){var r=e.mapProjection.ellipsoid;{if(a(t.attributes)&&a(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,s=n.length,l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;h<s;h+=3){var p=i.unpack(n,h,R),f=i.unpack(o,h,L),m=i.add(p,f,N),g=r.cartesianToCartographic(m,k),v=g.latitude,_=g.longitude;l=Math.min(l,v),u=Math.min(u,_),c=Math.max(c,v),d=Math.max(d,_)}var y=F;return y.north=c,y.south=l,y.east=d,y.west=u,y}if(a(t.rectangle))return t.rectangle}}function E(e){n.fromRadians(e.east,e.north,0,U[0]),n.fromRadians(e.west,e.north,0,U[1]),n.fromRadians(e.east,e.south,0,U[2]),n.fromRadians(e.west,e.south,0,U[3]);var t,r=0,i=0,o=0,a=0,s=C._terrainHeightsMaxLevel;for(t=0;t<=s;++t){for(var l=!1,u=0;u<4;++u){var c=U[u];if(B.positionToTileXY(c,t,V),0===u)o=V.x,a=V.y;else if(o!==V.x||a!==V.y){l=!0;break}}if(l)break;r=o,i=a}if(0!==t)return{x:r,y:i,level:t>s?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<f.PI){var s=m.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!r.scene3DOnly){var c=r.mapProjection,d=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);i.fromElements(d.center.z,d.center.x,d.center.y,d.center),t._boundingVolumes2D.push(d)}}function D(e,t){return Math.floor(e%(t/2)/3)}function I(e,t){var r,i;return e===y.TERRAIN?(r=0,i=t/2):e===y.CESIUM_3D_TILE?(r=t/2,i=t):(r=0,i=t),Y.start=r,Y.end=i,Y}function O(e,t,r,i,n,o,a,s){var l;l=t.mode===b.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;var u,c,d,h=e.classificationType,p=t.commandList,f=t.passes;if(f.render){var m=r.length;u=I(h,m),c=u.start,d=u.end;var g,v;for(g=c;g<d;++g)v=r[g],v.owner=e,v.modelMatrix=n,v.boundingVolume=l[D(g,m)],v.cull=o,v.debugShowBoundingVolume=a,p.push(v);if(t.invertClassification){var _=e._primitive._commandsIgnoreShow;for(c=0,d=_.length,g=c;g<d;++g){var y=Math.floor(g/2);v=_[g],v.modelMatrix=n,v.boundingVolume=l[y],v.cull=o,v.debugShowBoundingVolume=a,p.push(v)}}}if(f.pick){var C=i.length;u=I(h,C),c=u.start,d=u.end;for(var w=e._primitive._primitive,S=w._pickOffsets,T=c;T<d;++T){var E=S[D(T,C)],x=l[E.index],P=i[T];P.owner=e,P.modelMatrix=n,P.boundingVolume=x,P.cull=o,p.push(P)}}}var M={u_globeMinimumAltitude:function(){return 55e3}};s(C.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),C.isSupported=_.isSupported,C._defaultMaxTerrainHeight=9e3,C._defaultMinTerrainHeight=-1e5,C._terrainHeights=void 0,C._terrainHeightsMaxLevel=6;var R=new i,L=new i,N=new i,k=new n,F=new g,B=new c,U=[new n,new n,new n,new n],V=new r,z=new i,G=new i,H=new n,W=new i,j=new i,q=new e,Y={start:0,end:0};return C._initialized=!1,C._initPromise=void 0,C.initializeTerrainHeights=function(){var e=C._initPromise;return a(e)?e:(C._initPromise=p(t("Assets/approximateTerrainHeights.json")).then(function(e){C._initialized=!0,C._terrainHeights=e}),C._initPromise)},C.prototype.update=function(e){if(this.show&&(a(this._primitive)||a(this.geometryInstances))){if(!C._initialized)return void C.initializeTerrainHeights();var t=this,r=this._primitiveOptions;if(!a(this._primitive)){var i,n,o,s,l,u=e.mapProjection.ellipsoid,c=h(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],p=c.length,f=new Array(p);for(s=0;s<p;++s){i=c[s],n=i.geometry;var m=T(e,n);a(l)?a(m)&&g.union(l,m,l):l=m;var v=i.id;if(a(v)&&a(m)){var y=P(m,u);this._boundingSpheresKeys.push(v),this._boundingSpheres.push(y)}o=n.constructor,!a(o)||a(o.createShadowVolume)}x(this,l,e.mapProjection.ellipsoid);var b=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*b,this._maxHeight=this._maxTerrainHeight*b,s=0;s<p;++s)i=c[s],n=i.geometry,o=n.constructor,f[s]=new d({geometry:o.createShadowVolume(n,S(this),w(this)),attributes:i.attributes,id:i.id});r.geometryInstances=f,r._createBoundingVolumeFunction=function(e,r){A(t,e,r)},r._updateAndQueueCommandsFunction=function(e,r,i,n,o,a,s,l){O(t,r,i,n,o,a,s,l)},this._primitive=new _(r),this._primitive.readyPromise.then(function(e){t._ready=!0,t.releaseGeometryInstances&&(t.geometryInstances=void 0);var r=e._error;a(r)?t._readyPromise.reject(r):t._readyPromise.resolve(t)})}this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},C.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},C.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),l(this)},C}),define("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),O=new w(!0),M=new w(!1),R=new w(e.BLACK),L=new w(b.DISABLED),N=new w(new u),k=new e;return a(P,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),a(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayCondition}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(i){var n,a,s=this._entity,l=s.isAvailable(i),u=new m(l&&s.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(i));if(this._materialProperty instanceof C){var p=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(i)),a=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:a}}else n={show:u,distanceDisplayCondition:d};return new h({id:s,geometry:new r(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var n=this._entity,o=n.isAvailable(r),a=E.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);return new h({id:n,geometry:new i(this._options),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(r))}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),s(this)},P.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,h=a.show;if(o(h)&&h.isConstant&&!h.getValue(p.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=n(a.material,D),y=m instanceof C;this._materialProperty=m,this._fillProperty=n(s,O),this._showProperty=n(h,I),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,R):void 0,this._shadowsProperty=n(a.shadows,L),this._distanceDisplayCondition=n(a.distanceDisplayCondition,N);var b=a.height,w=a.extrudedHeight,S=a.granularity,T=a.width,x=a.outlineWidth,P=a.cornerType,A=l&&!o(b)&&!o(w)&&y&&g.isSupported(this._scene);if(c&&A&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=A,this._isClosed=o(w)||A,this._outlineEnabled=c,d.isConstant&&E.isConstant(b)&&E.isConstant(w)&&E.isConstant(S)&&E.isConstant(T)&&E.isConstant(x)&&E.isConstant(P)&&(!A||E.isConstant(m))){var k=this._options;k.vertexFormat=y?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,k.positions=d.getValue(p.MINIMUM_VALUE,k.positions),k.height=o(b)?b.getValue(p.MINIMUM_VALUE):void 0,k.extrudedHeight=o(w)?w.getValue(p.MINIMUM_VALUE):void 0,k.granularity=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,k.width=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,k.cornerType=o(P)?P.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(x)?x.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(n){var a=this._geometryUpdater,s=a._onTerrain,l=this._primitives,u=this._groundPrimitives;s?u.removeAndDestroy(this._primitive):(l.removeAndDestroy(this._primitive),l.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=a._entity,p=d.corridor;if(d.isShowing&&d.isAvailable(n)&&E.getValueOrDefault(p.show,n,!0)){var f=this._options,m=E.getValueOrUndefined(p.positions,n,f.positions),b=E.getValueOrUndefined(p.width,n);if(o(m)&&o(b)){f.positions=m,f.width=b,f.height=E.getValueOrUndefined(p.height,n),f.extrudedHeight=E.getValueOrUndefined(p.extrudedHeight,n),f.granularity=E.getValueOrUndefined(p.granularity,n),f.cornerType=E.getValueOrUndefined(p.cornerType,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty.getValue(n),S=c.fromDistanceDisplayCondition(w);if(!o(p.fill)||p.fill.getValue(n)){var x=a.fillMaterialProperty,P=T.getValue(n,x,this._material);if(this._material=P,s){var A=e.WHITE;o(x.color)&&(A=x.color.getValue(n)),this._primitive=u.add(new g({geometryInstances:new h({id:d,geometry:new r(f),attributes:{color:t.fromColor(A),distanceDisplayCondition:S}}),asynchronous:!1,shadows:C}))}else{var D=new v({material:P,translucent:P.isTranslucent(),closed:o(f.extrudedHeight)});f.vertexFormat=D.vertexFormat,this._primitive=l.add(new y({geometryInstances:new h({id:d,geometry:new r(f),attributes:{distanceDisplayCondition:S}}),appearance:D,asynchronous:!1,shadows:C}))}}if(!s&&o(p.outline)&&p.outline.getValue(n)){f.vertexFormat=_.VERTEX_FORMAT;var I=E.getValueOrClonedDefault(p.outlineColor,n,e.BLACK,k),O=E.getValueOrDefault(p.outlineWidth,n,1),M=1!==I.alpha;this._outlinePrimitive=l.add(new y({geometryInstances:new h({id:d,geometry:new i(f),attributes:{color:t.fromColor(I),distanceDisplayCondition:S}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:a._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:C}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},P}),define("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError},show:{get:t.throwInstantiationError},clustering:{get:t.throwInstantiationError}}),r.prototype.update=t.throwInstantiationError,r.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},r}),define("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/Transforms","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,i.fromElements(e.x,e.y,e.z,1,b),b),u=r.multiplyComponents(t,r.normalize(s,C),C);return s.x+=t.x+u.x,s.y+=t.y+u.y,s.z+=u.z,l.multiplyByVector(n.frustum.projectionMatrix,s,o)}var f={},m=new i(0,0,0,1),g=new i,v=new e,_=new t,y=new t;f.wgs84ToWindowCoordinates=function(e,t,i){return f.wgs84WithEyeOffsetToWindowCoordinates(e,t,r.ZERO,i)};var b=new i,C=new r,w=new n(Math.PI,s.PI_OVER_TWO),S=new r,T=new r;f.wgs84WithEyeOffsetToWindowCoordinates=function(e,i,n,a){var b=e.frameState,C=f.computeActualWgs84Position(b,i,m);if(o(C)){var E=e.canvas,x=v;x.x=0,x.y=0,x.width=E.clientWidth,x.height=E.clientHeight;var P=e.camera,A=!1;if(b.mode===h.SCENE2D){var D=e.mapProjection,I=w,O=D.project(I,S),M=r.clone(P.position,T),R=P.frustum.clone(),L=l.computeViewportTransformation(x,0,1,new l),N=P.frustum.projectionMatrix,k=P.positionWC.y,F=r.fromElements(s.sign(k)*O.x-k,0,-P.positionWC.x),B=d.pointToGLWindowCoordinates(N,L,F);if(0===k||B.x<=0||B.x>=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
  464. ;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;m<f;++m){var g=l[m];g.vertexBuffer?h.push(g):(d=g.usage,u=p[d],i(u)||(u=p[d]=[]),u.push(g))}this._allBuffers=[];for(d in p)if(p.hasOwnProperty(d)){u=p[d],u.sort(s);var v=c._vertexSizeInBytes(u),_=u[0].usage,y={vertexSizeInBytes:v,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(u,v)};this._allBuffers.push(y)}this._size=0,this._instanced=r(a,!1),this._precreated=h,this._context=e,this.writers=void 0,this.va=void 0,this.resize(o)}function d(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes<n)return o&&r.destroy(),t.vertexBuffer=s.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function h(e,t,r){if(e.needsCommit&&e.vertexSizeInBytes>0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function p(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n<r;++n)t[n].va.destroy();e.va=void 0}}c._verifyAttributes=function(e){for(var i=[],n=0;n<e.length;++n){var o=e[n],a={index:r(o.index,n),enabled:r(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:r(o.componentDatatype,t.FLOAT),normalize:r(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:r(o.usage,l.STATIC_DRAW)};i.push(a)}for(var s=new Array(i.length),u=0;u<i.length;++u){s[i[u].index]=!0}return i},c._vertexSizeInBytes=function(e){for(var r=0,i=e.length,n=0;n<i;++n){var o=e[n];r+=o.componentsPerAttribute*t.getSizeInBytes(o.componentDatatype)}var a=i>0?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;a<o;++a){var s=e[a],l=s.componentDatatype;i.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:r/t.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*t.getSizeInBytes(l)}return i},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var r=0,i=t.length;r<i;++r){var n=t[r];c._resize(n,this._size),c._appendWriters(this.writers,n)}p(this)},c._resize=function(e,r){if(e.vertexSizeInBytes>0){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<s;++l)o[l]=a[l];for(var u=e.arrayViews,c=u.length,d=0;d<c;++d){var h=u[d];h.view=t.createArrayBufferView(h.componentDatatype,n,h.offsetInBytes)}e.arrayBuffer=n}};var f=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;n<i;++n){var o=r[n];e[o.index]=f[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){var t,r,n,o=!1,s=this._allBuffers;for(r=0,n=s.length;r<n;++r)t=s[r],o=d(this,t)||o;if(o||!i(this.va)){p(this);for(var l=this.va=[],h=i(e)?Math.ceil(this._size/(a.SIXTY_FOUR_KILOBYTES-1)):1,f=0;f<h;++f){var m=[];for(r=0,n=s.length;r<n;++r){t=s[r];var g=f*(t.vertexSizeInBytes*(a.SIXTY_FOUR_KILOBYTES-1));c._appendAttributes(m,t,g,this._instanced)}m=m.concat(this._precreated),l.push({va:new u({context:this._context,attributes:m,indexBuffer:e}),indicesCount:1.5*(f!==h-1?a.SIXTY_FOUR_KILOBYTES-1:this._size%(a.SIXTY_FOUR_KILOBYTES-1))})}}},c._appendAttributes=function(e,t,r,i){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},c.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;i<n;++i)h(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t){var i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return p(this),n(this)},c}),define("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos( sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y) );\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate /= czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\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;a<c;++a)n=h[a],d=this._gl.COLOR_ATTACHMENT0+a,l(this,d,n),this._activeColorAttachments[a]=d,this._colorTextures[a]=n}if(r(e.colorRenderbuffers)){var p=e.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,a=0;a<c;++a)o=p[a],d=this._gl.COLOR_ATTACHMENT0+a,u(this,d,o),this._activeColorAttachments[a]=d,this._colorRenderbuffers[a]=o}r(e.depthTexture)&&(n=e.depthTexture,l(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),r(e.depthRenderbuffer)&&(o=e.depthRenderbuffer,u(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),r(e.stencilRenderbuffer)&&(o=e.stencilRenderbuffer,u(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),r(e.depthStencilTexture)&&(n=e.depthStencilTexture,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),r(e.depthStencilRenderbuffer)&&(o=e.depthStencilRenderbuffer,u(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(c.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),c.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},c.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},c.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},c.prototype.getColorTexture=function(e){return this._colorTextures[e]},c.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,t=this._colorTextures,i=t.length;e<i;++e){var o=t[e];r(o)&&o.destroy()}var a=this._colorRenderbuffers;for(i=a.length,e=0;e<i;++e){var s=a[e];r(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),n(this)},c}),define("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function m(e){e=i(e,i.EMPTY_OBJECT);var t=i(e.borderWidthInPixels,1),n=i(e.initialSize,y);this._context=e.context,this._pixelFormat=i(e.pixelFormat,u.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=r(),this._idHash={},this._initialSize=n,this._root=void 0}function g(e,r){var i=e._context,o=e.numberOfImages,a=e._borderWidthInPixels;if(o>0){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;b<e._textureCoordinates.length;b++){var C=e._textureCoordinates[b];n(C)&&(C.x*=p,C.y*=m,C.width*=p,C.height*=m)}var w=new h({context:e._context,width:u,height:c,pixelFormat:e._pixelFormat}),S=new d({context:i,colorTextures:[e._texture],destroyAttachments:!1});S._bind(),w.copyFromFramebuffer(0,0,0,0,u,c),S._unBind(),S.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=w,e._root=y}else{var T=2*(r.width+2*a),E=2*(r.height+2*a);T<e._initialSize.x&&(T=e._initialSize.x),E<e._initialSize.y&&(E=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new h({context:e._context,width:T,height:E,pixelFormat:e._pixelFormat}),e._root=new f(new t(a,a),new t(T,E))}}function v(e,r,i){if(n(r)){if(!n(r.childNode1)&&!n(r.childNode2)){if(n(r.imageIndex))return;var o=r.topRight.x-r.bottomLeft.x,a=r.topRight.y-r.bottomLeft.y,s=o-i.width,l=a-i.height;if(s<0||l<0)return;if(0===s&&0===l)return r;if(s>l){r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var u=r.bottomLeft.x+i.width+e._borderWidthInPixels;u<r.topRight.x&&(r.childNode2=new f(new t(u,r.bottomLeft.y),new t(r.topRight.x,r.topRight.y)))}else{r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.topRight.x,r.bottomLeft.y+i.height));var c=r.bottomLeft.y+i.height+e._borderWidthInPixels;c<r.topRight.y&&(r.childNode2=new f(new t(r.bottomLeft.x,c),new t(r.topRight.x,r.topRight.y)))}return v(e,r.childNode1,i)}return v(e,r.childNode1,i)||v(e,r.childNode2,i)}}function _(t,i,o){var a=v(t,t._root,i);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,d=a.bottomLeft.x/s,h=a.bottomLeft.y/l,p=u/s,f=c/l;t._textureCoordinates[o]=new e(d,h,p,f),t._texture.copyFrom(i,a.bottomLeft.x,a.bottomLeft.y)}else g(t,i),_(t,i,o);t._guid=r()}var y=new t(16,16);return o(m.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new h({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),m.prototype.addImage=function(e,t){var r=this._idHash[e];if(n(r))return r;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var i=this;return r=p(t,function(e){if(i.isDestroyed())return-1;var t=i.numberOfImages;return _(i,e,t),t}),this._idHash[e]=r,r},m.prototype.addSubRegion=function(t,i){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(-1===t)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+i.x/n,c=l.y+i.y/o,d=i.width/n,h=i.height/o;return a._textureCoordinates.push(new e(u,c,d,h)),a._guid=r(),s})},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},m}),define("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R){"use strict";function L(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,
  465. this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(ge),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.blendOption=a(e.blendOption,A.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=O.SCENE3D,this._buffersUsage=[v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW];var r=this;this._uniforms={u_atlas:function(){return r._textureAtlas.texture}};var i=this._scene;s(i)&&s(i.terrainProviderChanged)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,r=0;r<t;++r)e[r]._updateClamping()},this))}function N(e){for(var t=e.length,r=0;r<t;++r)e[r]&&e[r]._destroy()}function k(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function F(e){var t=e.cache.billboardCollection_indexBufferBatched;if(s(t))return t;for(var r=new Uint16Array(98298),i=0,n=0;i<98298;i+=6,n+=4)r[i]=n,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return t=g.createIndexBuffer({context:e,typedArray:r,usage:v.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function B(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=g.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function U(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=g.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:v.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function V(e,t,r,i){var n=[{index:$.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[te]},{index:$.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[te]},{index:$.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[re]},{index:$.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[he]},{index:$.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[le]},{index:$.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[ie]},{index:$.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[de]},{index:$.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[pe]},{index:$.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:o.FLOAT,usage:r[fe]}];return i&&n.push({index:$.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:U(e)}),new S(e,n,i?t:4*t,i)}function z(e,r,i,n,o){var a,s=n[$.positionHighAndScale],l=n[$.positionLowAndRotation],u=o._getActualPosition();e._mode===O.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),d.fromCartesian(u,be);var c=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=be.high,f=be.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,f.x,f.y,f.z,h)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,f.x,f.y,f.z,h),l(a+1,f.x,f.y,f.z,h),l(a+2,f.x,f.y,f.z,h),l(a+3,f.x,f.y,f.z,h))}function G(t,r,i,n,o){var a,s=n[$.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,d=o._translate,h=d.x,f=d.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+h),Math.abs(-c+f));var m=o.horizontalOrigin,g=o._verticalOrigin,v=o.show&&o.clusterShow;0===o.color.alpha&&(v=!1),g===R.BASELINE&&(g=R.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&m===I.CENTER,t._allVerticalCenter=t._allVerticalCenter&&g===R.CENTER;var _=0,y=0,b=0,C=0,w=o._imageIndex;if(-1!==w){var S=i[w];_=S.x,y=S.y,b=S.width,C=S.height}var T=_+b,E=y+C,x=Math.floor(p.clamp(u,-we,we)+we)*Ee;x+=(m+1)*xe,x+=(g+1)*Pe,x+=(v?1:0)*Ae;var P=Math.floor(p.clamp(c,-we,we)+we)*Te,A=Math.floor(p.clamp(h,-we,we)+we)*Te,D=(p.clamp(f,-we,we)+we)*De,O=Math.floor(D),M=Math.floor((D-O)*Te);P+=O,A+=M,Ce.x=_,Ce.y=y;var L=e.compressTextureCoordinates(Ce);Ce.x=T;var N=e.compressTextureCoordinates(Ce);Ce.y=E;var k=e.compressTextureCoordinates(Ce);Ce.x=_;var F=e.compressTextureCoordinates(Ce);t._instanced?(a=o._index,s(a,x,P,A,L)):(a=4*o._index,s(a+0,x+Ie,P,A,L),s(a+1,x+Oe,P,A,N),s(a+2,x+Me,P,A,k),s(a+3,x+Re,P,A,F))}function H(t,r,n,o,l){var u,c=o[$.compressedAttribute1],d=l.alignedAxis;i.equals(d,i.ZERO)||(t._shaderAlignedAxis=!0);var h=0,f=1,m=1,g=1,v=l.translucencyByDistance;s(v)&&(h=v.near,f=v.nearValue,m=v.far,g=v.farValue,1===f&&1===g||(t._shaderTranslucencyByDistance=!0));var _=0,y=l._imageIndex;if(-1!==y){_=n[y].width}var b=t._textureAtlas.texture.width,C=Math.round(a(l.width,b*_));t._maxSize=Math.max(t._maxSize,C);var w=p.clamp(C,0,Se),S=0;Math.abs(i.magnitudeSquared(d)-1)<p.EPSILON6&&(S=e.octEncodeFloat(d)),f=p.clamp(f,0,1),f=1===f?255:255*f|0,w=w*Te+f,g=p.clamp(g,0,1),g=1===g?255:255*g|0,S=S*Te+g,t._instanced?(u=l._index,c(u,w,S,h,m)):(u=4*l._index,c(u+0,w,S,h,m),c(u+1,w,S,h,m),c(u+2,w,S,h,m),c(u+3,w,S,h,m))}function W(e,t,r,o,s){var l,u=o[$.compressedAttribute2],c=s.color,d=s.getPickId(t).color,h=s.sizeInMeters?1:0,f=Math.abs(i.magnitudeSquared(s.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===h;var m=0,g=s._imageIndex;if(-1!==g){m=r[g].height}var v=e._textureAtlas.texture.dimensions,_=Math.round(a(s.height,v.y*m));e._maxSize=Math.max(e._maxSize,_);var y=n.floatToByte(c.red),b=n.floatToByte(c.green),C=n.floatToByte(c.blue),w=y*Se+b*Te+C;y=n.floatToByte(d.red),b=n.floatToByte(d.green),C=n.floatToByte(d.blue);var S=y*Se+b*Te+C,T=n.floatToByte(c.alpha)*Se+n.floatToByte(d.alpha)*Te;T+=2*h+f,e._instanced?(l=s._index,u(l,w,S,T,_)):(l=4*s._index,u(l+0,w,S,T,_),u(l+1,w,S,T,_),u(l+2,w,S,T,_),u(l+3,w,S,T,_))}function j(t,r,i,n,o){var a,s=n[$.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==D.NONE&&(u*=1.005),t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(u)),t._instanced){var c=0,d=0,h=o._imageIndex;if(-1!==h){var p=i[h];c=p.width,d=p.height}Ce.x=c,Ce.y=d;var f=e.compressTextureCoordinates(Ce);a=o._index,s(a,l.x,l.y,u,f)}else a=4*o._index,s(a+0,l.x,l.y,u,0),s(a+1,l.x,l.y,u,0),s(a+2,l.x,l.y,u,0),s(a+3,l.x,l.y,u,0)}function q(e,t,r,i,n){var o,a=i[$.scaleByDistance],l=0,u=1,c=1,d=1,h=n.scaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function Y(e,t,r,i,n){var o,a=i[$.pixelOffsetScaleByDistance],l=0,u=1,c=1,d=1,h=n.pixelOffsetScaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function X(e,t,r,i,n){var o,a=i[$.distanceDisplayConditionAndDisableDepth],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,l*=l,u*=u,e._shaderDistanceDisplayCondition=!0);var d=n.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),e._instanced?(o=n._index,a(o,l,u,d)):(o=4*n._index,a(o+0,l,u,d),a(o+1,l,u,d),a(o+2,l,u,d),a(o+3,l,u,d))}function Q(e,t,r,i,n){z(e,t,r,i,n),G(e,t,r,i,n),H(e,t,r,i,n),W(e,t,r,i,n),j(e,t,r,i,n),q(e,t,r,i,n),Y(e,t,r,i,n),X(e,t,r,i,n)}function Z(e,r,i,n,o,a){var l;n.mode===O.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<i;++c){var d=r[c],h=d.position,p=x._computeActualPosition(d,h,n,o);s(p)&&(d._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function K(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==O.SCENE3D&&!f.equals(o,e.modelMatrix)?(e._mode=r,f.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==O.SCENE3D&&r!==O.SCENE2D&&r!==O.COLUMBUS_VIEW||Z(e,i,i.length,t,o,!0)):r===O.MORPHING?Z(e,i,i.length,t,o,!0):r!==O.SCENE2D&&r!==O.COLUMBUS_VIEW||Z(e,n,e._billboardsToUpdateIndex,t,o,!1)}function J(e,t,r){var i=1;e._allSizedInMeters&&0===e._maxPixelOffset||(i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=i*e._maxPixelOffset+e._maxEyeOffset;r.radius+=n+o}var $,ee=x.SHOW_INDEX,te=x.POSITION_INDEX,re=x.PIXEL_OFFSET_INDEX,ie=x.EYE_OFFSET_INDEX,ne=x.HORIZONTAL_ORIGIN_INDEX,oe=x.VERTICAL_ORIGIN_INDEX,ae=x.SCALE_INDEX,se=x.IMAGE_INDEX_INDEX,le=x.COLOR_INDEX,ue=x.ROTATION_INDEX,ce=x.ALIGNED_AXIS_INDEX,de=x.SCALE_BY_DISTANCE_INDEX,he=x.TRANSLUCENCY_BY_DISTANCE_INDEX,pe=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,fe=x.DISTANCE_DISPLAY_CONDITION_INDEX,me=x.DISABLE_DEPTH_DISTANCE,ge=x.NUMBER_OF_PROPERTIES,ve={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayConditionAndDisableDepth:8},_e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayConditionAndDisableDepth:9};l(L.prototype,{length:{get:function(){return k(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),L.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},L.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},L.prototype.removeAll=function(){N(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},L.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},L.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},L.prototype.get=function(e){return k(this),this._billboards[e]};var ye;L.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<ge;++i){var n=0===r[i]?v.STATIC_DRAW:v.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var be=new d,Ce=new r,we=32768,Se=65536,Te=256,Ee=128,xe=32,Pe=8,Ae=4,De=1/256,Ie=0,Oe=2,Me=3,Re=1,Le=[];return L.prototype.update=function(e){k(this);var r=this._billboards,i=r.length,n=e.context;this._instanced=n.instancedArrays,$=this._instanced?_e:ve,ye=this._instanced?B:F;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new M({context:n});for(var a=0;a<i;++a)r[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){K(this,e),r=this._billboards,i=r.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,d=this._propertiesChanged,h=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;var g,v=e.passes,S=v.pick;if(p||!S&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<ge;++x)d[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=V(n,i,this._buffersUsage,this._instanced),g=this._vaf.writers;for(var D=0;D<i;++D){var I=this._billboards[D];I._dirty=!1,Q(this,n,l,g,I)}this._vaf.commit(ye(n))}this._billboardsToUpdateIndex=0}else if(c>0){var R=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;N<c;++N){var U=u[N];U._dirty=!1;for(var Z=0;Z<L;++Z)R[Z](this,n,l,g,U)}this._vaf.commit(ye(n))}else{for(var be=0;be<c;++be){var Ce=u[be];Ce._dirty=!1;for(var we=0;we<L;++we)R[we](this,n,l,g,Ce);this._instanced?this._vaf.subCommit(Ce._index,1):this._vaf.subCommit(4*Ce._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*i&&(u.length=i),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,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<Be;++Me){Oe=Ne[Me],s(Oe)||(Oe=Ne[Me]=new _);var Ue=ke||Fe&&Me%2==0;Oe.pass=Ue||!Fe?y.OPAQUE:y.TRANSLUCENT,Oe.owner=this;var Ve=Fe?Math.floor(Me/2):Me;Oe.boundingVolume=Se,Oe.modelMatrix=Te,Oe.count=De[Ve].indicesCount,Oe.shaderProgram=Ue?this._sp:this._spTranslucent,Oe.uniformMap=this._uniforms,Oe.vertexArray=De[Ve].va,Oe.renderState=Ue?this._rsOpaque:this._rsTranslucent,Oe.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Oe.count=6,Oe.instanceCount=i),Re.push(Oe)}}if(S){var ze=this._pickCommands;for(De=this._vaf.va,Ie=De.length,ze.length=Ie,Me=0;Me<Ie;++Me)Oe=ze[Me],s(Oe)||(Oe=ze[Me]=new _({pass:y.OPAQUE,owner:this})),Oe.boundingVolume=Se,Oe.modelMatrix=Te,Oe.count=De[Me].indicesCount,Oe.shaderProgram=this._spPick,Oe.uniformMap=this._uniforms,Oe.vertexArray=De[Me].va,Oe.renderState=this._rsOpaque,this._instanced&&(Oe.count=6,Oe.instanceCount=i),Re.push(Oe)}}}},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return s(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),N(this._billboards),u(this)},L}),define("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";return e({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2})}),define("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/freezeObject","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function v(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function _(e,a){e=n(e,n.EMPTY_OBJECT);var s=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,d=e.scaleByDistance,g=e.distanceDisplayCondition;o(s)&&(s=c.clone(s)),o(u)&&(u=c.clone(u)),o(d)&&(d=c.clone(d)),o(g)&&(g=l.clone(g)),this._renderedText=void 0,this._text=void 0,this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=i.clone(n(e.fillColor,i.WHITE)),this._outlineColor=i.clone(n(e.outlineColor,i.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new i(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,f.FILL),this._verticalOrigin=n(e.verticalOrigin,m.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,p.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=r.clone(n(e.eyeOffset,r.ZERO)),this._position=r.clone(n(e.position,r.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=s,this._pixelOffsetScaleByDistance=u,this._scaleByDistance=d,this._heightReference=n(e.heightReference,h.NONE),this._distanceDisplayCondition=g,this._disableDepthTestDistance=n(e.disableDepthTestDistance,0),this._labelCollection=a,this._glyphs=[],this._backgroundBillboard=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=n(e.text,""),this._updateClamping()}function y(e,t){for(var r=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,n=[],o="",a=T.LTR,s="",l=e.length,u=0;u<l;++u){var c=e.charAt(u);s=t.test(c)?T.RTL:r.test(c)?T.LTR:i.test(c)?T.BRACKETS:T.WEAK,0===u&&(a=s),a===s&&s!==T.BRACKETS?o+=c:(""!==o&&n.push({Type:a,Word:o}),a=s,o=c)}return n.push({Type:s,Word:o}),n}function b(e){return e.split("").reverse().join("")}function C(e,t,r){return e.slice(0,t)+r+e.slice(t)}function w(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}function S(e){for(var t=e.split("\n"),r="",i=0;i<t.length;i++){for(var n=t[i],o=E.test(n.charAt(0)),a=y(n,E),s=0,l="",u=0;u<a.length;++u){var c=a[u],d=c.Type===T.BRACKETS?w(c.Word):c.Word;o?c.Type===T.RTL?(l=b(c.Word)+l,s=0):c.Type===T.LTR?(l=C(l,s,c.Word),s+=c.Word.length):c.Type!==T.WEAK&&c.Type!==T.BRACKETS||(c.Type===T.WEAK&&a[u-1].Type===T.BRACKETS?l=b(c.Word)+l:a[u-1].Type===T.RTL?(l=d+l,s=0):a.length>u+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,i<t.length-1&&(r+="\n")}return r}var T=u({LTR:0,RTL:1,WEAK:2,BRACKETS:3});a(_.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].billboard;o(n)&&(n.show=e)}var a=this._backgroundBillboard;o(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].billboard;o(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;o(a)&&(a.heightReference=e),v(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._renderedText=_.enableRightToLeftDetection?S(e):e,g(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,g(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),g(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),g(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,g(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,g(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!i.equals(t,e)){i.clone(e,t);var r=this._backgroundBillboard;o(r)&&(r.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var r=this._backgroundPadding;t.equals(r,e)||(t.clone(e,r),v(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,g(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n];o(s.billboard)&&(s.billboard.pixelOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!c.equals(t,e)){this._translucencyByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.translucencyByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!c.equals(t,e)){this._pixelOffsetScaleByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;if(!c.equals(t,e)){this._scaleByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.scaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n];o(s.billboard)&&(s.billboard.eyeOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,v(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;o(a)&&(a.verticalOrigin=e),v(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.scale=e)}var a=this._backgroundBillboard;o(a)&&(a.scale=e),v(this)}}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!l.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var a=this._backgroundBillboard;o(a)&&(a.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;o(a)&&(a.id=e)}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=r.clone(e,this._actualClampedPosition);for(var t=this._glyphs,i=0,n=t.length;i<n;i++){var a=t[i];o(a.billboard)&&(a.billboard._clampedPosition=e)}var s=this._backgroundBillboard;o(s)&&(s._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),_.prototype._updateClamping=function(){d._updateClamping(this._labelCollection,this)},_.prototype.computeScreenSpacePosition=function(e,r){o(r)||(r=new t);var i=this._labelCollection,n=i.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position;return d._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,r)},_.getScreenSpaceBoundingBox=function(t,r,i){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,d=t._backgroundBillboard;if(o(d))n=r.x+d._translate.x/c,a=r.y-d._translate.y/c,s=d.width*u,l=d.height*u,t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?a-=l:t.verticalOrigin===m.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var h=0,p=0,f=t._glyphs,g=f.length,v=0;v<g;++v){var _=f[v],y=_.billboard;if(o(y)){var b=r.x+y._translate.x/c,C=r.y-y._translate.y/c,w=y.width*u,S=y.height*u;t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?C-=S:t.verticalOrigin===m.CENTER&&(C-=.5*S),n=Math.min(n,b),a=Math.min(a,C),h=Math.max(h,b+w),p=Math.max(p,C+S)}}s=h-n,l=p-a}return o(i)||(i=new e),i.x=n,i.y=a,i.width=s,i.height=l,i},_.prototype.equals=function(e){
  466. return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&r.equals(this._position,e._position)&&i.equals(this._fillColor,e._fillColor)&&i.equals(this._outlineColor,e._outlineColor)&&i.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&r.equals(this._eyeOffset,e._eyeOffset)&&c.equals(this._translucencyByDistance,e._translucencyByDistance)&&c.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&c.equals(this._scaleByDistance,e._scaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},_.prototype.isDestroyed=function(){return!1},_.enableRightToLeftDetection=!1;var E=new RegExp("[א-ת؀-ۿݐ–ݿࢠ–ࣿ]");return _}),define("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./BlendOption","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function v(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function _(e,t){var r=document.createElement("canvas");r.width=D.x,r.height=D.y;var i=r.getContext("2d");i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),e.addImage(A,r).then(function(e){t._whitePixelIndex=e})}function y(e,t,r,i,n,o,a){return O.font=t,O.fillColor=r,O.strokeColor=i,O.strokeWidth=n,a===m.CENTER?O.textBaseline="middle":a===m.TOP?O.textBaseline="top":O.textBaseline="bottom",O.fill=o===p.FILL||o===p.FILL_AND_OUTLINE,O.stroke=o===p.OUTLINE||o===p.FILL_AND_OUTLINE,l(e,O)}function b(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.show=!1,r.image=void 0,i(r._removeCallbackFunc)&&(r._removeCallbackFunc(),r._removeCallbackFunc=void 0),e._spareBillboards.push(r),t.billboard=void 0)}function C(e,t,r,i){e.addImage(t,r).then(function(e,t){i.index=e})}function w(e,t){var r,n,o,a=t._renderedText,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(n=s;n<u;++n)b(e,l[n]);l.length=s;var c=t._showBackground&&a.split("\n").join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(i(h)||(h=p.add({collection:e,image:A,imageSubRegion:I}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance):i(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache;for(o=0;o<s;++o){var m=a.charAt(o),_=t._font,w=t._fillColor,S=t._outlineColor,T=t._outlineWidth,E=t._style,x=t._verticalOrigin,P=JSON.stringify([m,_,w.toRgba(),S.toRgba(),T,+E,+x]),D=f[P];if(!i(D)){var O=y(m,_,w,S,T,E,x);D=new v(e,-1,O.dimensions),f[P]=D,O.width>0&&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;g<v;++g)"\n"===s.charAt(g)?(c.push(l),++f,l=0):(n=a[g],o=n.dimensions,p=Math.max(p,o.height-o.descent),h=Math.max(h,o.descent),l+=o.width-o.bounds.minx,g<v-1&&(l+=a[g+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var b=p+h,C=e._scale,w=e._horizontalOrigin,T=e._verticalOrigin,E=0,x=c[E],A=S(x,w,y),D=P*b,I=D*(f-1);M.x=A*C*r,M.y=0;var O=0;for(g=0;g<v;++g)if("\n"===s.charAt(g))++E,O+=D,x=c[E],A=S(x,w,y),M.x=A*C*r;else if(n=a[g],o=n.dimensions,T===m.TOP?M.y=o.height-p-y.y:T===m.CENTER?M.y=(I+o.height-p)/2:T===m.BASELINE?M.y=I:M.y=I+h+y.y,M.y=(M.y-o.descent-O)*C*r,i(n.billboard)&&n.billboard._setTranslate(M),g<v-1){var L=a[g+1];M.x+=(o.width-o.bounds.minx+L.dimensions.bounds.minx)*C*r}i(_)&&s.split("\n").join("").length>0&&(A=w===d.CENTER?-u/2-y.x:w===d.RIGHT?-(u+2*y.x):0,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;n<a;++n)b(e,r[n]);i(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,i(t._removeCallbackFunc)&&t._removeCallbackFunc(),o(t)}function x(e){e=r(e,r.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new u({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new u({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=s.clone(r(e.modelMatrix,s.IDENTITY)),this.debugShowBoundingVolume=r(e.debugShowBoundingVolume,!1),this.blendOption=r(e.blendOption,c.OPAQUE_AND_TRANSLUCENT)}var P=1.2,A="ID_WHITE_PIXEL",D=new t(4,4),I=new e(1,1,1,1),O={},M=new t,R=new t;return n(x.prototype,{length:{get:function(){return this._labels.length}}}),x.prototype.add=function(e){var t=new h(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},x.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),E(this,e),!0}return!1},x.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;t<r;++t)E(this,e[t]);e.length=0},x.prototype.contains=function(e){return i(e)&&e._labelCollection===this},x.prototype.get=function(e){return this._labels[e]},x.prototype.update=function(e){var t=this._billboardCollection,r=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,r.modelMatrix=this.modelMatrix,r.debugShowBoundingVolume=this.debugShowBoundingVolume;var n=e.context;i(this._textureAtlas)||(this._textureAtlas=new f({context:n}),t.textureAtlas=this._textureAtlas),i(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new f({context:n,initialSize:D}),r.textureAtlas=this._backgroundTextureAtlas,_(this._backgroundTextureAtlas,this));var o=n.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,d=0;d<u;++d){var h=l[d];if(!h.isDestroyed()){var p=h._glyphs.length;h._rebindAllGlyphs&&(w(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(T(h,a),h._repositionAllGlyphs=!1);var m=h._glyphs.length-p;this._totalGlyphCount+=m}}var g=r.length>0?c.TRANSLUCENT:this.blendOption;t.blendOption=g,r.blendOption=g,this._labelsToUpdate.length=0,r.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),o(this)},x}),define("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT);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;r<t;++r)e[r]&&e[r]._destroy()}function D(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],r=e._pointPrimitives,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function I(e,t,i){return new b(e,[{index:K.positionHighAndSize,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.positionLowAndShow,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.compressedAttribute0,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[G]},{index:K.compressedAttribute1,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[Y]},{index:K.scaleByDistance,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[q]},{index:K.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:r.FLOAT,usage:i[X]}],t)}function O(t,r,i,n){var o=n._index,a=n._getActualPosition();t._mode===x.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,J);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=i[K.positionHighAndSize],d=J.high;c(o,d.x,d.y,d.z,s);var h=i[K.positionLowAndOutline],p=J.low;h(o,p.x,p.y,p.z,u)}function M(e,r,i,n){var o=n._index,a=n.color,s=n.getPickId(r).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),d=t.floatToByte(a.blue),h=u*$+c*ee+d;u=t.floatToByte(l.red),c=t.floatToByte(l.green),d=t.floatToByte(l.blue);var p=u*$+c*ee+d;u=t.floatToByte(s.red),c=t.floatToByte(s.green),d=t.floatToByte(s.blue);var f=u*$+c*ee+d,m=t.floatToByte(a.alpha)*$+t.floatToByte(l.alpha)*ee+t.floatToByte(s.alpha);(0,i[K.compressedAttribute0])(o,h,p,f,m)}function R(e,t,r,i){var o=i._index,a=0,s=1,l=1,c=1,d=i.translucencyByDistance;n(d)&&(a=d.near,s=d.nearValue,l=d.far,c=d.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var h=i.show&&i.clusterShow;0===i.color.alpha&&0===i.outlineColor.alpha&&(h=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(h?1:0)*ee+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var f=c;(0,r[K.compressedAttribute1])(o,p,f,a,l)}function L(e,t,r,i){var o=i._index,a=r[K.scaleByDistance],s=0,l=1,u=1,c=1,d=i.scaleByDistance;n(d)&&(s=d.near,l=d.nearValue,u=d.far,c=d.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function N(e,t,r,i){var o=i._index,a=r[K.distanceDisplayConditionAndDisableDepth],s=0,l=Number.MAX_VALUE,u=i.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var c=i.disableDepthTestDistance;c*=c,c>0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),a(o,s,l,c)}function 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;c<i;++c){var d=r[c],h=d.position,p=E._computeActualPosition(h,o,a);n(p)&&(d._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function B(e,t){var r=t.mode,i=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==x.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=r,c.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==x.SCENE3D&&r!==x.SCENE2D&&r!==x.COLUMBUS_VIEW||F(e,i,i.length,t,o,!0)):r===x.MORPHING?F(e,i,i.length,t,o,!0):r!==x.SCENE2D&&r!==x.COLUMBUS_VIEW||F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function U(e,t,r){var i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=i*e._maxPixelSize;r.radius+=n}var V=E.SHOW_INDEX,z=E.POSITION_INDEX,G=E.COLOR_INDEX,H=E.OUTLINE_COLOR_INDEX,W=E.OUTLINE_WIDTH_INDEX,j=E.PIXEL_SIZE_INDEX,q=E.SCALE_BY_DISTANCE_INDEX,Y=E.TRANSLUCENCY_BY_DISTANCE_INDEX,X=E.DISTANCE_DISPLAY_CONDITION_INDEX,Q=E.DISABLE_DEPTH_DISTANCE_INDEX,Z=E.NUMBER_OF_PROPERTIES,K={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};o(P.prototype,{length:{get:function(){return D(this),this._pointPrimitives.length}}}),P.prototype.add=function(e){var t=new E(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},P.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},P.prototype.removeAll=function(){A(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},P.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},P.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},P.prototype.get=function(e){return D(this),this._pointPrimitives[e]},P.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<Z;++i){var n=0===r[i]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var J=new l,$=65536,ee=256,te=[];return P.prototype.update=function(t){D(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var r,i=this._pointPrimitives,o=i.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,b=t.passes,E=b.pick;if(u||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var P=0;P<Z;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=I(p,o,this._buffersUsage),r=this._vaf.writers;for(var A=0;A<o;++A){var F=this._pointPrimitives[A];F._dirty=!1,k(this,p,r,F)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var J=te;J.length=0,(l[z]||l[W]||l[j])&&J.push(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;ee<s;++ee){var re=a[ee];re._dirty=!1;for(var ie=0;ie<$;++ie)J[ie](this,p,r,re)}this._vaf.commit()}else{for(var ne=0;ne<s;++ne){var oe=a[ne];oe._dirty=!1;for(var ae=0;ae<$;++ae)J[ae](this,p,r,oe);this._vaf.subCommit(oe._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var se,le=c.IDENTITY;t.mode===x.SCENE3D?(le=this.modelMatrix,se=e.clone(this._baseVolumeWC,this._boundingVolume)):se=e.clone(this._baseVolume2D,this._boundingVolume),U(this,t,se);var ue=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,ue&&(this._blendOption===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,
  467. 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<be;++me){var Ce=_e||ye&&me%2==0;fe=ve[me],n(fe)||(fe=ve[me]=new m),fe.primitiveType=d.POINTS,fe.pass=Ce||!ye?g.OPAQUE:g.TRANSLUCENT,fe.owner=this;var we=ye?Math.floor(me/2):me;fe.boundingVolume=se,fe.modelMatrix=le,fe.shaderProgram=Ce?this._sp:this._spTranslucent,fe.uniformMap=this._uniforms,fe.vertexArray=he[we].va,fe.renderState=Ce?this._rsOpaque:this._rsTranslucent,fe.debugShowBoundingVolume=this.debugShowBoundingVolume,ge.push(fe)}}if(E){var Se=this._pickCommands;for(he=this._vaf.va,pe=he.length,Se.length=pe,me=0;me<pe;++me)fe=Se[me],n(fe)||(fe=Se[me]=new m({primitiveType:d.POINTS,pass:g.OPAQUE,owner:this})),fe.boundingVolume=se,fe.modelMatrix=le,fe.shaderProgram=this._spPick,fe.uniformMap=this._uniforms,fe.vertexArray=he[me].va,fe.renderState=this._rsOpaque,ge.push(fe)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),A(this._pointPrimitives),a(this)},P}),define("ThirdParty/kdbush",[],function(){"use strict";function e(e,r,i,n,o){return new t(e,r,i,n,o)}function t(e,t,n,a,s){t=t||r,n=n||i,s=s||Array,this.nodeSize=a||64,this.points=e,this.ids=new s(e.length),this.coords=new s(2*e.length);for(var l=0;l<e.length;l++)this.ids[l]=l,this.coords[2*l]=t(e[l]),this.coords[2*l+1]=n(e[l]);o(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function r(e){return e[0]}function i(e){return e[1]}function n(e,t,r,i,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var d=u.pop(),h=u.pop(),p=u.pop();if(h-p<=a)for(var f=p;f<=h;f++)s=t[2*f],l=t[2*f+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[m]);var g=(d+1)%2;(0===d?r<=s:i<=l)&&(u.push(p),u.push(m-1),u.push(g)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}function o(e,t,r,i,n,s){if(!(n-i<=r)){var l=Math.floor((i+n)/2);a(e,t,l,i,n,s%2),o(e,t,r,i,l-1,s+1),o(e,t,r,l+1,n,s+1)}}function a(e,t,r,i,n,o){for(;n>i;){if(n-i>600){var l=n-i+1,u=r-i+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1);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);f<m;){for(s(e,t,f,m),f++,m--;t[2*f+o]<p;)f++;for(;t[2*m+o]>p;)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<a;++s){var l=e.get(s);if(l.clusterShow=!1,l.show&&(o._scene.mode!==m.SCENE3D||i.isPointVisible(l.position))){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),d=o._clusterPoints&&n(l.id._point);if(!u||!d&&!c){var h=l.computeScreenSpacePosition(r);n(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}}}function x(i){return function(o){if(!(n(o)&&o<.05)&&i.enabled){var s=i._scene,d=i._labelCollection,p=i._billboardCollection,m=i._pointCollection;if((n(d)||n(p)||n(m))&&(i._clusterBillboards||i._clusterLabels||i._clusterPoints)){var v=i._clusterLabelCollection,b=i._clusterBillboardCollection,T=i._clusterPointCollection;n(v)?v.removeAll():v=i._clusterLabelCollection=new h({scene:s}),n(b)?b.removeAll():b=i._clusterBillboardCollection=new c({scene:s}),n(T)?T.removeAll():T=i._clusterPointCollection=new f;var x=i._pixelRange,P=i._minimumClusterSize,A=i._previousClusters,D=[],I=i._previousHeight,O=s.camera.positionCartographic.height,N=s.mapProjection.ellipsoid,k=s.camera.positionWC,F=new a(N,k),B=[];i._clusterLabels&&E(d,B,s,F,i),i._clusterBillboards&&E(p,B,s,F,i),i._clusterPoints&&E(m,B,s,F,i);var U,V,z,G,H,W,j,q,Y,X,Q,Z,K=g(B,_,y,64,Int32Array);if(O<I)for(z=A.length,U=0;U<z;++U){var J=A[U];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,r.ZERO,t.ZERO,s);if(n($)){var ee=1-O/I,te=J.width=J.width*ee,re=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),re=Math.max(re,J.minimumHeight);var ie=$.x-.5*te,ne=$.y-.5*re,oe=$.x+te,ae=$.y+re;for(H=K.range(ie,ne,oe,ae),W=H.length,X=0,Y=[],V=0;V<W;++V)j=H[V],q=B[j],q.clustered||(++X,Q=q.collection,Z=q.index,Y.push(Q.get(Z).id));if(X>=P)for(S(J.position,X,Y,i),D.push(J),V=0;V<W;++V)B[H[V]].clustered=!0}}}for(z=B.length,U=0;U<z;++U){var se=B[U];if(!se.clustered){se.clustered=!0,Q=se.collection,Z=se.index;var le=Q.get(Z);G=C(le,se.coord,x,i,M);var ue=e.clone(G,R);H=K.range(G.x,G.y,G.x+G.width,G.y+G.height),W=H.length;var ce=r.clone(le.position);for(X=1,Y=[le.id],V=0;V<W;++V)if(j=H[V],q=B[j],!q.clustered){var de=q.collection.get(q.index),he=C(de,q.coord,x,i,L);r.add(de.position,ce,ce),e.union(ue,he,ue),++X,Y.push(de.id)}if(X>=P){var pe=r.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,i),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),V=0;V<W;++V)B[H[V]].clustered=!0}else w(le,i)}}0===v.length&&(v.destroy(),i._clusterLabelCollection=void 0),0===b.length&&(b.destroy(),i._clusterBillboardCollection=void 0),0===T.length&&(T.destroy(),i._clusterPointCollection=void 0),i._previousClusters=D,i._previousHeight=O}}}}function P(e,t,r,i){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[i]))return a.get(s[i]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[r];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[i]=l,this._clusterDirty=!0,u}}function A(e,t){var r=e._collectionIndicesByEntity[t];n(r.billboardIndex)||n(r.labelIndex)||n(r.pointIndex)||delete e._collectionIndicesByEntity[t]}function D(e){if(n(e))for(var t=e.length,r=0;r<t;++r)e.get(r).clusterShow=!0}function I(e){e.enabled||(n(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),n(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),n(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,D(e._labelCollection),D(e._billboardCollection),D(e._pointCollection))}var O=new e,M=new e,R=new e,L=new e;return v.prototype._initialize=function(e){this._scene=e;var t=x(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},o(v.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),v.prototype.getLabel=P("_labelCollection",h,"_unusedLabelIndices","labelIndex"),v.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var r=t.labelIndex;t.labelIndex=void 0,A(this,e.id);var i=this._labelCollection.get(r);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(r),this._clusterDirty=!0}},v.prototype.getBillboard=P("_billboardCollection",c,"_unusedBillboardIndices","billboardIndex"),v.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._billboardCollection)&&n(t)&&n(t.billboardIndex)){var r=t.billboardIndex;t.billboardIndex=void 0,A(this,e.id);var i=this._billboardCollection.get(r);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(r),this._clusterDirty=!0}},v.prototype.getPoint=P("_pointCollection",f,"_unusedPointIndices","pointIndex"),v.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var r=t.pointIndex;t.pointIndex=void 0,A(this,e.id);var i=this._pointCollection.get(r);i.show=!1,i.id=void 0,this._unusedPointIndices.push(r),this._clusterDirty=!0}},v.prototype.update=function(e){var t;n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),n(this._billboardCollection)&&this._billboardCollection.length>0&&!n(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,I(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},v.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},v}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new i,this._error=new i,this._isLoading=!1,this._loading=new i,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),define("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function 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,
  468. 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<r;i++)if(!s.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._value;if(t(n)){var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i}},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;n<i;n++){var o=e[n];t(o)&&r.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new i,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var r=t.length,i=0;i<r;i++)if(!o.isConstant(t[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,r){var i=this._value;if(e(i)){var n=i.length;e(r)||(r=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,r[o]);e(l)&&(r[a]=l,a++),o++}return r.length=a,r}},a.prototype.setValue=function(t){var r=this._eventHelper;if(r.removeAll(),e(t)){this._value=t.slice();for(var i=t.length,n=0;n<i;n++){var o=t[n];e(o)&&r.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,r,i,n,o){"use strict";function a(t){var r=!0;if(t._resolveEntity){var i=t._targetCollection.getById(t._targetId);if(e(i)?(i.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=i,t._resolveEntity=!1):(i=t._targetEntity,r=!1),!e(i))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return r}function s(t){var r=t._targetProperty;if(t._resolveProperty){var i=a(t),o=t._targetPropertyNames;r=t._targetEntity;for(var s=o.length,l=0;l<s&&e(r);l++)r=r[o[l]];if(e(r))t._targetProperty=r,t._resolveProperty=!i;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return r}function l(e,t,r){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=r,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new i,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var r,i=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(r=a,n=!1,a=""):n||"."!==u?a+=u:(i.push(a),a="")}return i.push(a),new l(e,r,i)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s(this).getValueInReferenceFrame(e,t,r)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,r=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==r.length)return!1;for(var i=this._targetPropertyNames.length,n=0;n<i;n++)if(t[n]!==r[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,r,i){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,r,i){var n=this._targetEntity;e(n)&&(-1!==i.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),define("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,r,i){"use strict";return{packedLength:1,pack:function(t,r,i){return i=e(i,0),r[i]=t,r},unpack:function(t,r,i){return r=e(r,0),t[r]},convertPackedArrayForInterpolation:function(t,r,n,o){r=e(r,0),n=e(n,t.length);for(var a,s=0,l=n-r+1;s<l;s++){var u=t[r+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-i.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,r,n,o){return o=e[0],o<0?o+i.TWO_PI:o}}}),define("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<o;i++)e[t++]=r[i]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function d(t,i,n,o,a){for(var l,d,h,p,g,v,_=0;_<o.length;){g=c(o[_],t),h=e(i,g,s.compare);var y=0,b=0;if(h<0){for(h=~h,p=h*a,d=void 0,v=i[h];_<o.length&&(g=c(o[_],t),!(r(d)&&s.compare(d,g)>=0||r(v)&&s.compare(g,v)>=0));){for(f[y++]=g,_+=1,l=0;l<a;l++)m[b++]=o[_],_+=1;d=g}y>0&&(m.length=b,u(n,p,m),f.length=y,u(i,h,f))}else{for(l=0;l<a;l++)_++,n[h*a+l]=o[_];_++}}}function h(e,i){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),d=0;if(r(i)){var h=i.length;s=new Array(h);for(var f=0;f<h;f++){var m=i[f];m===Number&&(m=p);var g=m.packedLength;u+=g,c+=t(m.packedInterpolationLength,g),s[f]=m}d=h}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=i,this._innerDerivativeTypes=s,this._inputOrder=d,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r,i){return r=t(r,0),e[r]}},f=[],m=[];return i(h.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),h.prototype.getValue=function(t,i){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,d=e(n,t,s.compare);if(d<0){if(0===(d=~d)){var h=n[d];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(h,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,i)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,i)}var f=this._xTable,m=this._yTable,g=this._interpolationAlgorithm,v=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(g.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*v)}var b=this._numberOfPoints-1;if(b<1)return;var C=0,w=o-1;if(w-C+1>=b+1){var S=d-(b/2|0)-1;S<C&&(S=C);var T=S+b;T>w&&(T=w,(S=T-b)<C&&(S=C)),C=S,w=T}for(var E=w-C+1,x=0;x<E;++x)f[x]=s.secondsDifference(n[C+x],n[w]);if(r(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,C,w,m);else for(var P=0,A=this._packedLength,D=C*A,I=(w+1)*A;D<I;)m[P]=c[D],D++,P++;var O,M=s.secondsDifference(t,n[w]);if(0!==_&&r(g.interpolate)){var R=Math.floor(v/(_+1));O=g.interpolate(M,f,m,R,_,_,this._interpolationResult)}else O=g.interpolateOrderZero(M,f,m,v,this._interpolationResult);return r(u.unpackInterpolationResult)?u.unpackInterpolationResult(O,c,C,w,i):u.unpack(O,0,i)}return u.unpack(c,d*this._packedLength,i)}},h.prototype.setInterpolationOptions=function(e){if(r(e)){var t=!1,i=e.interpolationAlgorithm,n=e.interpolationDegree;r(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),r(n)&&this._interpolationDegree!==n&&(this._interpolationDegree=n,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},h.prototype.addSample=function(e,t,i){var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(i[u],s,s.length);d(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamples=function(e,t,i){for(var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=e.length,l=[],u=0;u<s;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=i[u],h=n.length,p=0;p<h;p++)n[p].pack(c[p],l,l.length);d(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamplesPackedArray=function(e,t){d(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes;if(i!==r(n))return!1;var o,a;if(i){if((a=t.length)!==n.length)return!1;for(o=0;o<a;o++)if(t[o]!==n[o])return!1}var l=this._times,u=e._times;if((a=l.length)!==u.length)return!1;for(o=0;o<a;o++)if(!s.equals(l[o],u[o]))return!1;var c=this._values,d=e._values;for(o=0;o<a;o++)if(c[o]!==d[o])return!1;return!0},h._mergeNewSamples=d,h}),define("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r,i){i=t(i,0);var n;if(i>0){n=new Array(i);for(var s=0;s<i;s++)n[s]=e}this._numberOfDerivatives=i,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(r,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return i(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,i){if(i=this._property.getValue(e,i),r(i))return s.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,r){this._numberOfDerivatives;this._property.addSample(e,t,r)},c.prototype.addSamples=function(e,t,r){this._property.addSamples(e,t,r)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),define("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";return e({HORIZONTAL:0,VERTICAL:1})}),define("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,d=e.BLACK;return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,d,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,0),t.repeat=a.getValueOrDefault(this._repeat,e,1),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),define("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return r(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,r,i)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),define("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)&&"function"==typeof i.clone?i.clone(r):i},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(r,!0),this.position=e}i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(r(t)&&this._subscription(),this._position=e,r(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var u=new e,c=new e,d=new a;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,i,n){r(i)||(i=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,i);var l=o.getValue(t,u),h=o.getValue(a.addSeconds(t,1/60,d),c);if(r(l)&&(r(h)||(h=l,l=o.getValue(a.addSeconds(t,-1/60,d),c),r(l)))){if(e.equals(l,h))return this._normalize?void 0:e.clone(e.ZERO,i);r(n)&&l.clone(n);var p=e.subtract(h,l,i);return this._normalize?e.normalize(p,i):e.divideByScalar(p,1/60,i)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),define("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,r){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(r,n.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){i._definitionChanged.raiseEvent(i)})}i(d.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var h=new e,p=new e,f=new a;return d.prototype.getValue=function(e,t){var i=this._velocityVectorProperty._getValue(e,p,h);if(r(i))return l.rotationMatrixFromPositionVelocity(h,i,this._ellipsoid,f),s.fromRotationMatrix(f,t)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),define("DataSources/CzmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/CornerType","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/NearFarScalar","../Core/objectToQuery","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineDashMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityOrientationProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,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){"use strict";function Le(){}function Ne(e,t){return"#"===t[0]&&(t=Bt+t),Se.fromString(e,t)}function ke(e,t,i){if(c(i.reference))return Ne(t,i.reference);if(c(i.velocityReference)){var n=Ne(t,i.velocityReference);switch(e){case r:case Le:return new Me(n,e===Le);case D:return new Oe(n)}}throw new M(JSON.stringify(i)+" is not valid CZML.")}function Fe(e){var t=e.rgbaf;if(c(t))return t;var r=e.rgba;if(c(r)){var i=r.length;if(i===a.packedLength)return[a.byteToFloat(r[0]),a.byteToFloat(r[1]),a.byteToFloat(r[2]),a.byteToFloat(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=a.byteToFloat(r[n+1]),t[n+2]=a.byteToFloat(r[n+2]),t[n+3]=a.byteToFloat(r[n+3]),t[n+4]=a.byteToFloat(r[n+4]);return t}}function Be(e,t,r){var i=u(e.uri,e);return c(t)&&(i=g(i,g(t)),c(r)&&(i=C(i,"?"+r,!1))),i}function Ue(e){var t=e.wsen;if(c(t))return t;var r=e.wsenDegrees;if(c(r)){var i=r.length;if(i===I.packedLength)return[x.toRadians(r[0]),x.toRadians(r[1]),x.toRadians(r[2]),x.toRadians(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=x.toRadians(r[n+1]),t[n+2]=x.toRadians(r[n+2]),t[n+3]=x.toRadians(r[n+3]),t[n+4]=x.toRadians(r[n+4]);return t}}function Ve(e){var t=e.length;if(Vt.magnitude=1,2===t)return Vt.clock=e[0],Vt.cone=e[1],r.fromSpherical(Vt,Ut),[Ut.x,Ut.y,Ut.z];for(var i=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)i[o]=e[n],Vt.clock=e[n+1],Vt.cone=e[n+2],r.fromSpherical(Vt,Ut),i[o+1]=Ut.x,i[o+2]=Ut.y,i[o+3]=Ut.z;return i}function ze(e){var t=e.length;if(3===t)return Vt.clock=e[0],Vt.cone=e[1],Vt.magnitude=e[2],r.fromSpherical(Vt,Ut),[Ut.x,Ut.y,Ut.z];for(var i=new Array(t),n=0;n<t;n+=4)i[n]=e[n],Vt.clock=e[n+1],Vt.cone=e[n+2],Vt.magnitude=e[n+3],r.fromSpherical(Vt,Ut),i[n+1]=Ut.x,i[n+2]=Ut.y,i[n+3]=Ut.z;return i}function Ge(e){var t=e.length;if(3===t)return zt.longitude=e[0],zt.latitude=e[1],zt.height=e[2],p.WGS84.cartographicToCartesian(zt,Ut),[Ut.x,Ut.y,Ut.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],zt.longitude=e[i+1],zt.latitude=e[i+2],zt.height=e[i+3],p.WGS84.cartographicToCartesian(zt,Ut),r[i+1]=Ut.x,r[i+2]=Ut.y,r[i+3]=Ut.z;return r}function He(e){var t=e.length;if(3===t)return zt.longitude=x.toRadians(e[0]),zt.latitude=x.toRadians(e[1]),zt.height=e[2],p.WGS84.cartographicToCartesian(zt,Ut),[Ut.x,Ut.y,Ut.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],zt.longitude=x.toRadians(e[i+1]),zt.latitude=x.toRadians(e[i+2]),zt.height=e[i+3],p.WGS84.cartographicToCartesian(zt,Ut),r[i+1]=Ut.x,r[i+2]=Ut.y,r[i+3]=Ut.z;return r}function We(e){var t=e.cartesian;if(c(t))return t;var r=e.cartesianVelocity;if(c(r))return r;var i=e.unitCartesian;if(c(i))return i;var n=e.unitSpherical;if(c(n))return Ve(n);var o=e.spherical;if(c(o))return ze(o);var a=e.cartographicRadians;if(c(a))return Ge(a);var s=e.cartographicDegrees;if(c(s))return He(s);throw new M(JSON.stringify(e)+" is not a valid CZML interval.")}function je(e,t){r.unpack(e,t,Ut),r.normalize(Ut,Ut),r.pack(Ut,e,t)}function qe(e){var t=We(e);if(3===t.length)return je(t,0),t;for(var r=1;r<t.length;r+=4)je(t,r);return t}function Ye(e,t){D.unpack(e,t,Ht),D.normalize(Ht,Ht),D.pack(Ht,e,t)}function Xe(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return Ye(t,0),t;for(var r=1;r<t.length;r+=5)Ye(t,r)}return t}function Qe(i){return"boolean"==typeof i?Boolean:"number"==typeof i?Number:"string"==typeof i?String:i.hasOwnProperty("array")?Array:i.hasOwnProperty("boolean")?Boolean:i.hasOwnProperty("boundingRectangle")?e:i.hasOwnProperty("cartesian2")?t:i.hasOwnProperty("cartesian")||i.hasOwnProperty("spherical")||i.hasOwnProperty("cartographicRadians")||i.hasOwnProperty("cartographicDegrees")?r:i.hasOwnProperty("unitCartesian")||i.hasOwnProperty("unitSpherical")?Le:i.hasOwnProperty("rgba")||i.hasOwnProperty("rgbaf")?a:i.hasOwnProperty("colorBlendMode")?k:i.hasOwnProperty("cornerType")?s:i.hasOwnProperty("heightReference")?F:i.hasOwnProperty("horizontalOrigin")?B:i.hasOwnProperty("date")?w:i.hasOwnProperty("labelStyle")?U:i.hasOwnProperty("number")?Number:i.hasOwnProperty("nearFarScalar")?P:i.hasOwnProperty("object")||i.hasOwnProperty("value")?Object:i.hasOwnProperty("unitQuaternion")?D:i.hasOwnProperty("shadowMode")?V:i.hasOwnProperty("string")?String:i.hasOwnProperty("stripeOrientation")?Ae:i.hasOwnProperty("wsen")||i.hasOwnProperty("wsenDegrees")?I:i.hasOwnProperty("uri")?G:i.hasOwnProperty("verticalOrigin")?z:Object}function Ze(i,n,o,l){switch(i){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case r:return We(n);case Le:return qe(n);case a:return Fe(n);case k:return k[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case F:return F[u(n.heightReference,n)];case B:return B[u(n.horizontalOrigin,n)];case Image:return Be(n,o,l);case w:return w.fromIso8601(u(n.date,n));case U:return U[u(n.labelStyle,n)];case Number:return u(n.number,n);case P:return n.nearFarScalar;case Object:return u(u(n.object,n.value),n);case D:return Xe(n);case Te:return u(n.number,n);case V:return V[u(u(n.shadowMode,n.shadows),n)];case String:return u(n.string,n);case Ae:return Ae[u(n.stripeOrientation,n)];case I:return Ue(n);case G:return Be(n,o,l);case z:return z[u(n.verticalOrigin,n)];default:throw new M(i)}}function Ke(e,t){var r=e.interpolationAlgorithm;(c(r)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Wt[r],interpolationDegree:e.interpolationDegree});var i=e.forwardExtrapolationType;c(i)&&(t.forwardExtrapolationType=m[i]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=m[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function Je(e,t,r,i,n,o,a,s){var l,d=i.interval;c(d)?(jt.iso8601=d,l=L.fromIso8601(jt),c(n)&&(l=L.intersect(l,n,Gt))):c(n)&&(l=n);var h,p,f,m,g=!c(i.reference)&&!c(i.velocityReference),v=c(l)&&!l.equals(b.MAXIMUM_INTERVAL);g&&(f=Ze(e,i,o,s),h=u(e.packedLength,1),m=u(f.length,1),p=!c(i.array)&&"string"!=typeof f&&m>h&&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),
  469. 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;l<u;l++)Je(e,t,r,i[l],n,o,a,s);else Je(e,t,r,i,n,o,a,s)}function et(e,t,i,n,o,a,s){var l,d=i.interval;c(d)?(jt.iso8601=d,l=L.fromIso8601(jt),c(n)&&(l=L.intersect(l,n,Gt))):c(n)&&(l=n);var h,p,f,m=!1,g=c(i.cartesianVelocity)?1:0,v=r.packedLength*(g+1),_=!c(i.reference),y=c(l)&&!l.equals(b.MAXIMUM_INTERVAL);if(_&&(c(i.referenceFrame)&&(h=O[i.referenceFrame]),h=u(h,O.FIXED),p=We(i),f=u(p.length,1),m=f>v),!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<l;s++)et(e,t,r[s],i,n,o,a);else et(e,t,r,i,n,o,a)}function rt(e,r,i,n,o,s,l){var u,d=i.interval;c(d)?(jt.iso8601=d,u=L.fromIso8601(jt),c(n)&&(u=L.intersect(u,n,Gt))):c(n)&&(u=n);var h,p,f=e[r];if(c(u)){f instanceof Y||(f=new Y,e[r]=f);var m=f.intervals;p=m.findInterval({start:u.start,stop:u.stop}),c(p)?h=p.data:(p=u.clone(),m.addInterval(p))}else h=f;var g;c(i.solidColor)?(h instanceof q||(h=new q),g=i.solidColor,$e(a,h,"color",g.color,void 0,void 0,s)):c(i.grid)?(h instanceof ae||(h=new ae),g=i.grid,$e(a,h,"color",g.color,void 0,o,s,l),$e(Number,h,"cellAlpha",g.cellAlpha,void 0,o,s,l),$e(t,h,"lineCount",g.lineCount,void 0,o,s,l),$e(t,h,"lineThickness",g.lineThickness,void 0,o,s,l),$e(t,h,"lineOffset",g.lineOffset,void 0,o,s,l)):c(i.image)?(h instanceof se||(h=new se),g=i.image,$e(Image,h,"image",g.image,void 0,o,s,l),$e(t,h,"repeat",g.repeat,void 0,o,s,l),$e(a,h,"color",g.color,void 0,o,s,l),$e(Boolean,h,"transparent",g.transparent,void 0,o,s,l)):c(i.stripe)?(h instanceof Pe||(h=new Pe),g=i.stripe,$e(Ae,h,"orientation",g.orientation,void 0,o,s,l),$e(a,h,"evenColor",g.evenColor,void 0,o,s,l),$e(a,h,"oddColor",g.oddColor,void 0,o,s,l),$e(Number,h,"offset",g.offset,void 0,o,s,l),$e(Number,h,"repeat",g.repeat,void 0,o,s,l)):c(i.polylineOutline)?(h instanceof _e||(h=new _e),g=i.polylineOutline,$e(a,h,"color",g.color,void 0,o,s,l),$e(a,h,"outlineColor",g.outlineColor,void 0,o,s,l),$e(Number,h,"outlineWidth",g.outlineWidth,void 0,o,s,l)):c(i.polylineGlow)?(h instanceof ge||(h=new ge),g=i.polylineGlow,$e(a,h,"color",g.color,void 0,o,s,l),$e(Number,h,"glowPower",g.glowPower,void 0,o,s,l)):c(i.polylineArrow)?(h instanceof fe||(h=new fe),g=i.polylineArrow,$e(a,h,"color",g.color,void 0,void 0,s)):c(i.polylineDash)&&(h instanceof me||(h=new me),g=i.polylineDash,$e(a,h,"color",g.color,void 0,void 0,s),$e(a,h,"gapColor",g.gapColor,void 0,void 0,s),$e(Number,h,"dashLength",g.dashLength,void 0,o,s,l),$e(Number,h,"dashPattern",g.dashPattern,void 0,o,s,l)),c(p)?p.data=h:e[r]=h}function it(e,t,r,i,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s<l;s++)rt(e,t,r[s],i,n,o,a);else rt(e,t,r,i,n,o,a)}function nt(e,t,r,i,n){e.name=u(t.name,e.name)}function ot(e,t,r,i,n){var o=t.description;c(o)&&$e(String,e,"description",o,void 0,i,r,n)}function at(e,t,r,i,n){var o=t.position;c(o)&&tt(e,"position",o,void 0,i,r,n)}function st(e,t,i,n,o){var a=t.viewFrom;c(a)&&$e(r,e,"viewFrom",a,void 0,n,i,o)}function lt(e,t,r,i,n){var o=t.orientation;c(o)&&$e(D,e,"orientation",o,void 0,i,r,n)}function ut(e,t,r,i,n){var o=t.properties;if(c(o)){c(e.properties)||(e.properties=new Ce);for(var a in o)if(o.hasOwnProperty(a)){e.properties.hasProperty(a)||e.properties.addProperty(a);var s=o[a];if(y(s))for(var l=0,u=s.length;l<u;l++)Je(Qe(s[l]),e.properties,a,s[l],void 0,i,r,n);else Je(Qe(s),e.properties,a,s,void 0,i,r,n)}}}function ct(e,t,r,i){var n=r.references;if(c(n)){var o=n.map(function(e){return Ne(i,e)}),a=r.interval;if(c(a)){if(a=L.fromIso8601(a),!(e[t]instanceof X)){a.data=new be(o);var s=new Q;s.intervals.addInterval(a),e[t]=s}}else e[t]=new be(o)}else $e(Array,e,t,r,void 0,void 0,i)}function dt(e,t,r,i){if(c(r))if(y(r))for(var n=0,o=r.length;n<o;++n)ct(e,t,r[n],i);else ct(e,t,r,i)}function ht(e,t,i,n){if(c(i.references)){var o=i.references.map(function(e){return Ne(n,e)}),a=i.interval;if(c(a)){if(a=L.fromIso8601(a),!(e[t]instanceof X)){a.data=new ye(o);var s=new X;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ye(o)}else c(i.cartesian)?i.array=r.unpackArray(i.cartesian):c(i.cartographicRadians)?i.array=r.fromRadiansArrayHeights(i.cartographicRadians):c(i.cartographicDegrees)&&(i.array=r.fromDegreesArrayHeights(i.cartographicDegrees)),c(i.array)&&$e(Array,e,t,i,void 0,void 0,n)}function pt(e,t,r,i){if(c(r))if(y(r))for(var n=0,o=r.length;n<o;n++)ht(e,t,r[n],i);else ht(e,t,r,i)}function ft(e,t,r,i,n){var o,a=t.availability;if(c(a)){var s;if(y(a))for(var l=a.length,u=0;u<l;u++)c(s)||(s=new N),jt.iso8601=a[u],o=L.fromIso8601(jt),s.addInterval(o);else jt.iso8601=a,o=L.fromIso8601(jt),s=new N,s.addInterval(o);e.availability=s}}function mt(e,t,r,i,n,o){c(t)&&$e(Le,e,"alignedAxis",t,r,i,n,o)}function gt(i,n,o,s,l){var u=n.billboard;if(c(u)){var d,h=u.interval;c(h)&&(jt.iso8601=h,d=L.fromIso8601(jt));var p=i.billboard;c(p)||(i.billboard=p=new W),$e(Boolean,p,"show",u.show,d,s,o,l),$e(Image,p,"image",u.image,d,s,o,l),$e(Number,p,"scale",u.scale,d,s,o,l),$e(t,p,"pixelOffset",u.pixelOffset,d,s,o,l),$e(r,p,"eyeOffset",u.eyeOffset,d,s,o,l),$e(B,p,"horizontalOrigin",u.horizontalOrigin,d,s,o,l),$e(z,p,"verticalOrigin",u.verticalOrigin,d,s,o,l),$e(F,p,"heightReference",u.heightReference,d,s,o,l),$e(a,p,"color",u.color,d,s,o,l),$e(Te,p,"rotation",u.rotation,d,s,o,l),mt(p,u.alignedAxis,d,s,o,l),$e(Boolean,p,"sizeInMeters",u.sizeInMeters,d,s,o,l),$e(Number,p,"width",u.width,d,s,o,l),$e(Number,p,"height",u.height,d,s,o,l),$e(P,p,"scaleByDistance",u.scaleByDistance,d,s,o,l),$e(P,p,"translucencyByDistance",u.translucencyByDistance,d,s,o,l),$e(P,p,"pixelOffsetScaleByDistance",u.pixelOffsetScaleByDistance,d,s,o,l),$e(e,p,"imageSubRegion",u.imageSubRegion,d,s,o,l)}}function vt(e,t,i,n,o){var s=t.box;if(c(s)){var l,u=s.interval;c(u)&&(jt.iso8601=u,l=L.fromIso8601(jt));var d=e.box;c(d)||(e.box=d=new j),$e(Boolean,d,"show",s.show,l,n,i,o),$e(r,d,"dimensions",s.dimensions,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(V,d,"shadows",s.shadows,l,n,i,o)}}function _t(e,t,r,i,n){var o=t.corridor;if(c(o)){var l,u=o.interval;c(u)&&(jt.iso8601=u,l=L.fromIso8601(jt));var d=e.corridor;c(d)||(e.corridor=d=new J),$e(Boolean,d,"show",o.show,l,i,r,n),pt(d,"positions",o.positions,r),$e(Number,d,"width",o.width,l,i,r,n),$e(Number,d,"height",o.height,l,i,r,n),$e(Number,d,"extrudedHeight",o.extrudedHeight,l,i,r,n),$e(s,d,"cornerType",o.cornerType,l,i,r,n),$e(Number,d,"granularity",o.granularity,l,i,r,n),$e(Boolean,d,"fill",o.fill,l,i,r,n),it(d,"material",o.material,l,i,r,n),$e(Boolean,d,"outline",o.outline,l,i,r,n),$e(a,d,"outlineColor",o.outlineColor,l,i,r,n),$e(Number,d,"outlineWidth",o.outlineWidth,l,i,r,n),$e(V,d,"shadows",o.shadows,l,i,r,n)}}function yt(e,t,r,i,n){var o=t.cylinder;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.cylinder;c(u)||(e.cylinder=u=new $),$e(Boolean,u,"show",o.show,s,i,r,n),$e(Number,u,"length",o.length,s,i,r,n),$e(Number,u,"topRadius",o.topRadius,s,i,r,n),$e(Number,u,"bottomRadius",o.bottomRadius,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(Number,u,"slices",o.slices,s,i,r,n),$e(V,u,"shadows",o.shadows,s,i,r,n)}}function bt(e,t){var r=e.version;if(c(r)&&"string"==typeof r){var i=r.split(".");if(2===i.length){if("1"!==i[0])throw new M("Cesium only supports CZML version 1.");t._version=r}}if(!c(t._version))throw new M("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function 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<p;h++)Et(u,d[h],s,i,r,n);else Et(u,d,s,i,r,n)}}function Et(e,t,i,n,o,a){var s,l=t.interval;c(l)?(jt.iso8601=l,s=L.fromIso8601(jt),c(i)&&(s=L.intersect(s,i,Gt))):c(i)&&(s=i);for(var u=e.nodeTransformations,d=Object.keys(t),h=0,p=d.length;h<p;++h){var f=d[h];if("interval"!==f){var m=t[f];if(c(m)){c(u)||(e.nodeTransformations=u=new Ce),u.hasProperty(f)||u.addProperty(f);var g=u[f];c(g)||(u[f]=g=new ce),$e(r,g,"translation",m.translation,s,n,o,a),$e(D,g,"rotation",m.rotation,s,n,o,a),$e(r,g,"scale",m.scale,s,n,o,a)}}}}function xt(e,t,r,i,n){var o=t.path;if(c(o)){var a,s=o.interval;c(s)&&(jt.iso8601=s,a=L.fromIso8601(jt));var l=e.path;c(l)||(e.path=l=new de),$e(Boolean,l,"show",o.show,a,i,r,n),$e(Number,l,"width",o.width,a,i,r,n),$e(Number,l,"resolution",o.resolution,a,i,r,n),$e(Number,l,"leadTime",o.leadTime,a,i,r,n),$e(Number,l,"trailTime",o.trailTime,a,i,r,n),it(l,"material",o.material,a,i,r,n)}}function Pt(e,t,r,i,n){var o=t.point;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.point;c(u)||(e.point=u=new he),$e(Boolean,u,"show",o.show,s,i,r,n),$e(Number,u,"pixelSize",o.pixelSize,s,i,r,n),$e(F,u,"heightReference",o.heightReference,s,i,r,n),$e(a,u,"color",o.color,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(P,u,"scaleByDistance",o.scaleByDistance,s,i,r,n),$e(P,u,"translucencyByDistance",o.translucencyByDistance,s,i,r,n)}}function At(e,t,r,i,n){var o=t.polygon;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.polygon;c(u)||(e.polygon=u=new pe),$e(Boolean,u,"show",o.show,s,i,r,n),pt(u,"hierarchy",o.positions,r),$e(Number,u,"height",o.height,s,i,r,n),$e(Number,u,"extrudedHeight",o.extrudedHeight,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(Boolean,u,"perPositionHeight",o.perPositionHeight,s,i,r,n),$e(Boolean,u,"closeTop",o.closeTop,s,i,r,n),$e(Boolean,u,"closeBottom",o.closeBottom,s,i,r,n),$e(V,u,"shadows",o.shadows,s,i,r,n)}}function Dt(e,t,r,i,n){var o=t.polyline;if(c(o)){var a,s=o.interval;c(s)&&(jt.iso8601=s,a=L.fromIso8601(jt));var l=e.polyline;c(l)||(e.polyline=l=new ve),$e(Boolean,l,"show",o.show,a,i,r,n),pt(l,"positions",o.positions,r),$e(Number,l,"width",o.width,a,i,r,n),$e(Number,l,"granularity",o.granularity,a,i,r,n),it(l,"material",o.material,a,i,r,n),$e(Boolean,l,"followSurface",o.followSurface,a,i,r,n),$e(V,l,"shadows",o.shadows,a,i,r,n)}}function It(e,t,r,i,n){var o=t.rectangle;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.rectangle;c(u)||(e.rectangle=u=new we),$e(Boolean,u,"show",o.show,s,i,r,n),$e(I,u,"coordinates",o.coordinates,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(Boolean,u,"closeTop",o.closeTop,s,i,r,n),$e(Boolean,u,"closeBottom",o.closeBottom,s,i,r,n),$e(V,u,"shadows",o.shadows,s,i,r,n)}}function Ot(e,t,r,i,n){var o=t.wall;if(c(o)){var s,l=o.interval;c(l)&&(jt.iso8601=l,s=L.fromIso8601(jt));var u=e.wall;c(u)||(e.wall=u=new Re),$e(Boolean,u,"show",o.show,s,i,r,n),pt(u,"positions",o.positions,r),dt(u,"minimumHeights",o.minimumHeights,r),dt(u,"maximumHeights",o.maximumHeights,r),$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(V,u,"shadows",o.shadows,s,i,r,n)}}function Mt(e,t,r,i,n,o){var a=e.id;if(c(a)||(a=l()),Bt=a,!c(n._version)&&"document"!==a)throw new M("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(a);else if("document"===a)bt(e,n);else{var s=t.getOrCreateEntity(a),u=e.parent;c(u)&&(s.parent=t.getOrCreateEntity(u));for(var d=r.length-1;d>-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<s;a++)Mt(e[a],t,i,r,n,o);else Mt(e,t,i,r,n,o)},Ft}),define("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return r(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,r=this._dataSources;return a(e,function(e){return r===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,r){r=e(r,!1);var i=this._dataSources.indexOf(t);return-1!==i&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,t),r&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var r=this._dataSources,i=0,n=r.length;i<n;++i){var o=r[i];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return-1!==this.indexOf(e)},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),i(this)},s}),define("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),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),c=new m(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof C){var f=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(r)),o=t.fromColor(f),n={show:c,distanceDisplayCondition:p,color:o}}else n={show:c,distanceDisplayCondition:p};return new h({id:a,geometry:new u(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=E.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new h({id:i,geometry:new c(this._options),attributes:{show:new m(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),o(this)},P.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=this._entity.position,h=a.semiMajorAxis,m=a.semiMinorAxis,y=a.show;if(i(y)&&y.isConstant&&!y.getValue(p.MINIMUM_VALUE)||!i(d)||!i(h)||!i(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var b=r(a.material,D),w=b instanceof C;this._materialProperty=b,this._fillProperty=r(s,O),this._showProperty=r(y,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 S=a.rotation,T=a.height,x=a.extrudedHeight,P=a.granularity,A=a.stRotation,k=a.outlineWidth,F=a.numberOfVerticalLines,B=l&&!i(T)&&!i(x)&&w&&g.isSupported(this._scene);if(c&&B&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=B,this._isClosed=i(x)||B,this._outlineEnabled=c,d.isConstant&&h.isConstant&&m.isConstant&&E.isConstant(S)&&E.isConstant(T)&&E.isConstant(x)&&E.isConstant(P)&&E.isConstant(A)&&E.isConstant(k)&&E.isConstant(F)&&(!B||E.isConstant(b))){var U=this._options;U.vertexFormat=w?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,U.center=d.getValue(p.MINIMUM_VALUE,U.center),U.semiMajorAxis=h.getValue(p.MINIMUM_VALUE,U.semiMajorAxis),U.semiMinorAxis=m.getValue(p.MINIMUM_VALUE,U.semiMinorAxis),U.rotation=i(S)?S.getValue(p.MINIMUM_VALUE):void 0,U.height=i(T)?T.getValue(p.MINIMUM_VALUE):void 0,U.extrudedHeight=i(x)?x.getValue(p.MINIMUM_VALUE):void 0,U.granularity=i(P)?P.getValue(p.MINIMUM_VALUE):void 0,U.stRotation=i(A)?A.getValue(p.MINIMUM_VALUE):void 0,U.numberOfVerticalLines=i(F)?F.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=i(k)?k.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=n._entity,p=d.ellipse;if(d.isShowing&&d.isAvailable(r)&&E.getValueOrDefault(p.show,r,!0)){var f=this._options,m=E.getValueOrUndefined(d.position,r,f.center),b=E.getValueOrUndefined(p.semiMajorAxis,r),C=E.getValueOrUndefined(p.semiMinorAxis,r);if(i(m)&&i(b)&&i(C)){f.center=m,f.semiMajorAxis=b,f.semiMinorAxis=C,f.rotation=E.getValueOrUndefined(p.rotation,r),f.height=E.getValueOrUndefined(p.height,r),f.extrudedHeight=E.getValueOrUndefined(p.extrudedHeight,r),f.granularity=E.getValueOrUndefined(p.granularity,r),f.stRotation=E.getValueOrUndefined(p.stRotation,r),f.numberOfVerticalLines=E.getValueOrUndefined(p.numberOfVerticalLines,r);var w=this._geometryUpdater.shadowsProperty.getValue(r),S=this._geometryUpdater.distanceDisplayConditionProperty,x=S.getValue(r),P=l.fromDistanceDisplayCondition(x);if(E.getValueOrDefault(p.fill,r,!0)){var A=n.fillMaterialProperty,D=T.getValue(r,A,this._material);if(this._material=D,o){var I=e.WHITE;i(A.color)&&(I=A.color.getValue(r)),this._primitive=s.add(new g({geometryInstances:new h({id:d,geometry:new u(f),attributes:{color:t.fromColor(I),distanceDisplayCondition:P}}),asynchronous:!1,shadows:w}))}else{var O=new v({material:D,translucent:D.isTranslucent(),closed:i(f.extrudedHeight)});f.vertexFormat=O.vertexFormat,this._primitive=a.add(new y({geometryInstances:new h({id:d,geometry:new u(f)}),attributes:{distanceDisplayCondition:P},appearance:O,asynchronous:!1,shadows:w}))}}if(!o&&E.getValueOrDefault(p.outline,r,!1)){f.vertexFormat=_.VERTEX_FORMAT;var M=E.getValueOrClonedDefault(p.outlineColor,r,e.BLACK,k),R=E.getValueOrDefault(p.outlineWidth,r,1),L=1!==M.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new h({id:d,geometry:new c(f),attributes:{color:t.fromColor(M),distanceDisplayCondition:P}}),appearance:new _({flat:!0,translucent:L,renderState:{lineWidth:n._scene.clampLineWidth(R)}}),asynchronous:!1,shadows:w}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},P}),
  470. define("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function A(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new P(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function D(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity),this._modelMatrix=new m,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var I=new w(t.WHITE),O=new S(!0),M=new S(!0),R=new S(!1),L=new S(t.BLACK),N=new S(C.DISABLED),k=new S(new l),F=new e,B=new t,U=new e(1,1,1);return o(A,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),o(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(e){var i,o,a=this._entity,s=a.isAvailable(e),l=new g(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),d=this._distanceDisplayConditionProperty.getValue(e),h=u.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),o=r.fromColor(m),i={show:l,distanceDisplayCondition:h,color:o}}else i={show:l,distanceDisplayCondition:h};return new p({id:a,geometry:new c(this._options),modelMatrix:a.computeModelMatrix(f.MINIMUM_VALUE),attributes:i})},A.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),o=x.getValueOrDefault(this._outlineColorProperty,e,t.BLACK),a=this._distanceDisplayConditionProperty.getValue(e);return new p({id:i,geometry:new d(this._options),modelMatrix:i.computeModelMatrix(f.MINIMUM_VALUE),attributes:{show:new g(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),a(this)},A.prototype._onEntityPropertyChanged=function(e,t,r,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!n(s)||!s.isConstant||s.getValue(f.MINIMUM_VALUE),u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(f.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(f.MINIMUM_VALUE)||!n(d)||!n(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,I),g=m instanceof w;this._materialProperty=m,this._fillProperty=i(s,M),this._showProperty=i(p,O),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,k),this._fillEnabled=l,this._outlineEnabled=c;var y=a.stackPartitions,b=a.slicePartitions,C=a.outlineWidth,S=a.subdivisions;if(d.isConstant&&x.isConstant(e.orientation)&&h.isConstant&&x.isConstant(y)&&x.isConstant(b)&&x.isConstant(C)&&x.isConstant(S)){var T=this._options;T.vertexFormat=g?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,T.radii=h.getValue(f.MINIMUM_VALUE,T.radii),T.stackPartitions=n(y)?y.getValue(f.MINIMUM_VALUE):void 0,T.slicePartitions=n(b)?b.getValue(f.MINIMUM_VALUE):void 0,T.subdivisions=n(S)?S.getValue(f.MINIMUM_VALUE):void 0,this._outlineWidth=n(C)?C.getValue(f.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new D(e,this)},D.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!x.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=x.getValueOrUndefined(a.radii,e,F),h=o.computeModelMatrix(e,this._modelMatrix);if(!n(h)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var f,C=x.getValueOrDefault(a.fill,e,!0),w=x.getValueOrDefault(a.outline,e,!1),S=x.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,B),T=E.getValue(e,i(a.material,I),this._material);this._material=T;var P=x.getValueOrUndefined(a.stackPartitions,e),A=x.getValueOrUndefined(a.slicePartitions,e),D=x.getValueOrUndefined(a.subdivisions,e),O=x.getValueOrDefault(a.outlineWidth,e,1),M=this._scene.mode,R=M===b.SCENE3D,L=this._options,N=this._geometryUpdater.shadowsProperty.getValue(e),k=this._geometryUpdater.distanceDisplayConditionProperty,V=k.getValue(e),z=u.fromDistanceDisplayCondition(V);if(R&&this._lastSceneMode===M&&n(this._primitive)&&L.stackPartitions===P&&L.slicePartitions===A&&L.subdivisions===D&&this._lastOutlineWidth===O){if(this._primitive.ready){var G=this._primitive,H=this._outlinePrimitive;G.show=!0,H.show=!0,f=G.appearance,f.material=T;var W=this._attributes;n(W)||(W=G.getGeometryInstanceAttributes(o),this._attributes=W),C!==this._lastShow&&(W.show=g.toValue(C,W.show),this._lastShow=C);var j=this._outlineAttributes;n(j)||(j=H.getGeometryInstanceAttributes(o),this._outlineAttributes=j),w!==this._lastOutlineShow&&(j.show=g.toValue(w,j.show),this._lastOutlineShow=w),t.equals(S,this._lastOutlineColor)||(j.color=r.toValue(S,j.color),t.clone(S,this._lastOutlineColor)),l.equals(V,this._lastDistanceDisplayCondition)||(W.distanceDisplayCondition=u.toValue(V,W.distanceDisplayCondition),j.distanceDisplayCondition=u.toValue(V,j.distanceDisplayCondition),l.clone(V,this._lastDistanceDisplayCondition))}}else{var q=this._primitives;q.removeAndDestroy(this._primitive),q.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=M,this._lastOutlineWidth=O,L.stackPartitions=P,L.slicePartitions=A,L.subdivisions=D,L.radii=R?U:s,f=new v({material:T,translucent:T.isTranslucent(),closed:!0}),L.vertexFormat=f.vertexFormat,this._primitive=q.add(new y({geometryInstances:new p({id:o,geometry:new c(L),modelMatrix:R?void 0:h,attributes:{show:new g(C),distanceDisplayCondition:z}}),appearance:f,asynchronous:!1,shadows:N})),L.vertexFormat=_.VERTEX_FORMAT,this._outlinePrimitive=q.add(new y({geometryInstances:new p({id:o,geometry:new d(L),modelMatrix:R?void 0:h,attributes:{show:new g(w),color:r.fromColor(S),distanceDisplayCondition:z}}),appearance:new _({flat:!0,translucent:1!==S.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:N})),this._lastShow=C,this._lastOutlineShow=w,this._lastOutlineColor=t.clone(S,this._lastOutlineColor),this._lastDistanceDisplayCondition=V}R&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),h=m.multiplyByScale(h,s,h),this._primitive.modelMatrix=h,this._outlinePrimitive.modelMatrix=h)},D.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},A}),define("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,n,o,a,s,l){this.translucent=r,this.appearanceType=n,this.depthFailAppearanceType=o,this.depthFailMaterialProperty=a,this.depthFailMaterial=void 0,this.closed=s,this.shadows=l,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.invalidated=!1;var u;i(a)&&(u=a.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=u}function p(e,t,r,i,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}function f(e,t){for(var r=e.length,i=r-1;i>=0;i--){var n=e[i];if(n.remove(t)&&0===n.updaters.length)return e.splice(i,1),n.destroy(),!0}return!1}function m(e,t,r){for(var i=!1,n=t.length,o=0;o<n;++o){var a=t[o],s=a.itemsToRemove,l=s.length;if(l>0)for(o=0;o<l;o++){var u=s[o];a.remove(u),e.add(r,u),i=!0}}return i}function g(e,t,r,i){var n,o=t.length;for(n=o-1;n>=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u<l;u++)e.add(r,s[u]);a.destroy()}}for(o=t.length,n=0;n<o;++n)i=t[n].update(r)&&i;return i}function v(e,t,r){for(var i=e.length,n=0;n<i;n++){var o=e[n];if(o.contains(t))return o.getBoundingSphere(t,r)}return l.FAILED}function _(e){for(var t=e.length,r=0;r<t;r++)e[r].destroy();e.length=0}var y=new t,b=new n;return h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;return r===t||!!i(t)&&t.equals(r)},h.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&d.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}},h.prototype.update=function(e){var l,h,p=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,_=v.length;if(_>0){for(i(m)&&(i(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),h=0;h<_;h++){var C=v[h],w=C.attributes;l=this.attributes.get(C.id.id),i(l)&&(i(w.show)&&(w.show.value=l.show),i(w.color)&&(w.color.value=l.color),i(w.depthFailColor)&&(w.depthFailColor.value=l.depthFailColor))}var S;i(this.depthFailAppearanceType)&&(i(this.depthFailMaterialProperty)&&(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),S=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),m=new s({asynchronous:!0,geometryInstances:v,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:S,shadows:this.shadows}),g.add(m),p=!1}else{i(m)&&(g.remove(m),m=void 0);var 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;h<x;h++){var A=E[h],D=this.geometry.get(A.entity.id);if(l=this.attributes.get(D.id.id),i(l)||(l=m.getGeometryInstanceAttributes(D.id),this.attributes.set(D.id.id,l)),!A.fillMaterialProperty.isConstant||P){var I=A.fillMaterialProperty.color;I.getValue(e,y),t.equals(l._lastColor,y)||(l._lastColor=t.clone(y,l._lastColor),l.color=r.toValue(y,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[f++]=A))}if(i(this.depthFailAppearanceType)&&this.depthFailAppearanceType instanceof u&&(!A.depthFailMaterialProperty.isConstant||P)){var O=A.depthFailMaterialProperty.color;O.getValue(e,y),t.equals(l._lastDepthFailColor,y)||(l._lastDepthFailColor=t.clone(y,l._lastDepthFailColor),l.depthFailColor=r.toValue(y,l.depthFailColor))}var M=A.entity.isShowing&&(A.hasConstantFill||A.isFilled(e)),R=1===l.show[0];M!==R&&(l.show=a.toValue(M,l.show));var L=A.distanceDisplayConditionProperty;if(!d.isConstant(L)){var N=L.getValue(e,b);n.equals(N,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(N,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(N,l.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else i(m)&&!m.ready&&(p=!1);return this.itemsToRemove.length=f,p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing;u!==(1===l.show[0])&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),i(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},p.prototype.add=function(e,t){var r,i,n=t.createFillGeometryInstance(e);255===n.attributes.color.value[3]?(r=this._solidItems,i=!1):(r=this._translucentItems,i=!0);for(var o=r.length,a=0;a<o;a++){var s=r[a];if(s.isMaterial(t))return void s.add(t,n)}var l=new h(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l.add(t,n),r.push(l)},p.prototype.remove=function(e){f(this._solidItems,e)||f(this._translucentItems,e)},p.prototype.update=function(e){var t=g(this,this._solidItems,e,!0);t=g(this,this._translucentItems,e,t)&&t;var r=m(this,this._solidItems,e),i=m(this,this._translucentItems,e);return(r||i)&&(t=g(this,this._solidItems,e,t)&&t,t=g(this,this._translucentItems,e,t)&&t),t},p.prototype.getBoundingSphere=function(e,t){var r=v(this._solidItems,e,t);return r===l.FAILED?v(this._translucentItems,e,t):r},p.prototype.removeAllPrimitives=function(){_(this._solidItems),_(this._translucentItems)},p}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,i,n,o,a,s){this.primitives=t,this.appearanceType=r,this.materialProperty=i,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=o,this.closed=a,this.shadows=s,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function p(e,t,r,i,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}var f=new n;h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.materialProperty,r=e.fillMaterialProperty,n=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(r===t&&o===n)return!0;var a=i(t)&&t.equals(r);return a=(!i(n)&&!i(o)||i(n)&&n.equals(o))&&a},h.prototype.add=function(e,t){var r=t.entity.id;if(this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&d.isConstant(t.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,r,n,o){"isShowing"===r&&i.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}return this.createPrimitive};var m=new t;return h.prototype.update=function(e){var l,h,p=!0,g=this.primitive,v=this.primitives,_=this.geometry.values;if(this.createPrimitive){var y=_.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),h=0;h<y;h++){var b=_[h],C=b.attributes;l=this.attributes.get(b.id.id),i(l)&&(i(C.show)&&(C.show.value=l.show),i(C.color)&&(C.color.value=l.color),i(C.depthFailColor)&&(C.depthFailColor.value=l.depthFailColor))}this.material=c.getValue(e,this.materialProperty,this.material);var w;if(i(this.depthFailMaterialProperty)){var S;this.depthFailMaterialProperty instanceof c?(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),S=this.depthFailMaterial.isTranslucent()):S=this.material.isTranslucent(),w=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:S,closed:this.closed})}g=new s({asynchronous:!0,geometryInstances:_,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:w,shadows:this.shadows}),v.add(g),p=!1}else{i(g)&&(v.remove(g),g=void 0);var T=this.oldPrimitive;i(T)&&(v.remove(T),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=c.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var E=this.updatersWithAttributes.values,x=E.length;for(h=0;h<x;h++){var P=E[h],A=P.entity,D=this.geometry.get(A.id);if(l=this.attributes.get(D.id.id),i(l)||(l=g.getGeometryInstanceAttributes(D.id),this.attributes.set(D.id.id,l)),i(this.depthFailAppearanceType)&&this.depthFailAppearanceType instanceof u&&!P.depthFailMaterialProperty.isConstant){var I=P.depthFailMaterialProperty.color;I.getValue(e,m),t.equals(l._lastDepthFailColor,m)||(l._lastDepthFailColor=t.clone(m,l._lastDepthFailColor),l.depthFailColor=r.toValue(m,l.depthFailColor))}var O=A.isShowing&&(P.hasConstantFill||P.isFilled(e)),M=1===l.show[0];O!==M&&(l.show=a.toValue(O,l.show));var R=P.distanceDisplayConditionProperty;if(!d.isConstant(R)){var L=R.getValue(e,f);n.equals(L,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(L,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(L,l.distanceDisplayCondition))}}this.updateShows(g)}else i(g)&&!g.ready&&(p=!1);return p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=o.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);i(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing;c!==(1===u.show[0])&&(u.show=a.toValue(c,u.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),this.removeMaterialSubscription()},p.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new h(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(e,t),r.push(a)},p.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},p.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s<a;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;t<i;t++)l=r[t].update(e)&&l;return l},p.prototype.getBoundingSphere=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return l.FAILED},p.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;r<t;r++)e[r].destroy();this._items.length=0},p}),define("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i){this.primitives=t,this.color=r,this.key=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.isDirty=!1}function c(t){this._batches=new e,this._primitives=t}var d=new t,h=new i;u.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},u.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var p=new Array(4);return u.prototype.update=function(e){var s,u,c=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,_=v.length;if(_>0){for(r(m)&&(r(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),u=0;u<_;u++){var y=v[u],b=y.attributes;s=this.attributes.get(y.id.id),r(s)&&(r(b.show)&&(b.show.value=s.show),r(b.color)&&(b.color.value=s.color))}m=new a({asynchronous:!0,geometryInstances:v}),g.add(m),c=!1}else{r(m)&&(g.remove(m),m=void 0);var C=this.oldPrimitive;r(C)&&(g.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(m)&&m.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var w=this.updatersWithAttributes.values,S=w.length,T=this.waitingOnCreate;for(u=0;u<S;u++){var E=w[u],x=this.geometry.get(E.entity.id);if(s=this.attributes.get(x.id.id),r(s)||(s=m.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,s)),!E.fillMaterialProperty.isConstant||T){var P=E.fillMaterialProperty.color;if(P.getValue(e,d),!t.equals(s._lastColor,d)){s._lastColor=t.clone(d,s._lastColor);var A=this.color,D=d.toBytes(p);A[0]===D[0]&&A[1]===D[1]&&A[2]===D[2]&&A[3]===D[3]||(this.itemsToRemove[f++]=E)}}var I=E.entity.isShowing&&(E.hasConstantFill||E.isFilled(e)),O=1===s.show[0];I!==O&&(s.show=o.toValue(I,s.show));var M=E.distanceDisplayConditionProperty;if(!l.isConstant(M)){var R=M.getValue(e,h);i.equals(R,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=i.clone(R,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(R,s.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else r(m)&&!m.ready&&(c=!1);return this.itemsToRemove.length=f,c},u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var a=t[n],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing;u!==(1===l.show[0])&&(l.show=o.toValue(u,l.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getBoundingSphere(e);return r(n)?(n.clone(t),s.DONE):s.FAILED},u.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},c.prototype.add=function(e,t){var r,i=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(i.attributes.color.value.buffer)[0];return n.contains(o)?r=n.get(o):(r=new u(this._primitives,i.attributes.color.value,o),n.set(o,r)),r.add(t,i),r},c.prototype.remove=function(e){for(var t=this._batches.values,r=t.length,i=0;i<r;++i)if(t[i].remove(e))return},c.prototype.update=function(e){var t,r,i=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)i=o[t].update(e)&&i;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){r=l[c],s.remove(r);var d=this.add(e,r);s.isDirty=!0,d.isDirty=!0}var h=o.slice(),p=h.length;for(t=0;t<p;++t){var f=h[t];f.isDirty&&(i=h[t].update(e)&&i,f.isDirty=!1),0===f.geometry.length&&n.remove(f.key)}return i},c.prototype.getBoundingSphere=function(e,t){for(var r=this._batches.values,i=r.length,n=0;n<i;++n){var o=r[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return s.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._batches.values,t=e.length,r=0;r<t;++r)e[r].removeAllPrimitives()},c}),define("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(t,r,i,n){this.translucent=r,this.width=i,this.shadows=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.subscriptions=new e,this.showsUpdated=new e}function h(t,r,i){this._primitives=t,this._scene=r,this._shadows=i,this._solidBatches=new e,this._translucentBatches=new e}d.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},d.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var p=new t,f=new n;return d.prototype.update=function(e){var u,d,h=!0,m=0,g=this.primitive,v=this.primitives;if(this.createPrimitive){var _=this.geometry.values,y=_.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),d=0;d<y;d++){var b=_[d],C=b.attributes;u=this.attributes.get(b.id.id),i(u)&&(i(C.show)&&(C.show.value=u.show),i(C.color)&&(C.color.value=u.color))}g=new l({asynchronous:!0,geometryInstances:_,appearance:new s({flat:!0,
  471. translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),v.add(g),h=!1}else{i(g)&&(v.remove(g),g=void 0);var w=this.oldPrimitive;i(w)&&(v.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,T=S.length,E=this.waitingOnCreate;for(d=0;d<T;d++){var x=S[d],P=this.geometry.get(x.entity.id);if(u=this.attributes.get(P.id.id),i(u)||(u=g.getGeometryInstanceAttributes(P.id),this.attributes.set(P.id.id,u)),!x.outlineColorProperty.isConstant||E){var A=x.outlineColorProperty;A.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=r.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[m++]=x))}var D=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),I=1===u.show[0];D!==I&&(u.show=a.toValue(D,u.show));var O=x.distanceDisplayConditionProperty;if(!c.isConstant(O)){var M=O.getValue(e,f);n.equals(M,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(M,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(M,u.distanceDisplayCondition))}}this.updateShows(g),this.waitingOnCreate=!1}else i(g)&&!g.ready&&(h=!1);return this.itemsToRemove.length=m,h},d.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing;u!==(1===l.show[0])&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},d.prototype.contains=function(e){return this.updaters.contains(e.id)},d.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return u.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},d.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},h.prototype.add=function(e,t){var r,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(r=this._solidBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!1,a,this._shadows),r.set(a,n)),n.add(t,o)):(r=this._translucentBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!0,a,this._shadows),r.set(a,n)),n.add(t,o))},h.prototype.remove=function(e){var t,r=this._solidBatches.values,i=r.length;for(t=0;t<i;t++)if(r[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},h.prototype.update=function(e){var t,r,i,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,d=!1;do{for(d=!1,r=0;r<s;r++){n=a[r],c=n.update(e),o=n.itemsToRemove;var h=o.length;if(h>0)for(d=!0,t=0;t<h;t++)i=o[t],n.remove(i),this.add(e,i)}for(r=0;r<u;r++){n=l[r],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(d=!0,t=0;t<p;t++)i=o[t],n.remove(i),this.add(e,i)}}while(d);return c},h.prototype.getBoundingSphere=function(e,t){var r,i=this._solidBatches.values,n=i.length;for(r=0;r<n;r++){var o=i[r];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(r=0;r<s;r++){var l=a[r];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},h.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var i=this._translucentBatches.values,n=i.length;for(e=0;e<n;e++)i[e].removeAllPrimitives()},h}),define("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this._primitives=t,this._groundPrimitives=r,this._dynamicUpdaters=new e}function p(e,t){for(var r=e._batches,i=r.length,n=0;n<i;n++)r[n].remove(t)}function f(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);var n;(i.outlineEnabled||i.fillEnabled)&&(n=i.shadowsProperty.getValue(t)),i.outlineEnabled&&e._outlineBatches[n].add(t,i);var a=0;r(i.depthFailMaterialProperty)&&(a=i.depthFailMaterialProperty instanceof s?1:2);var l;r(n)&&(l=n+a*o.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.onTerrain?e._groundColorBatch.add(t,i):i.isClosed?i.fillMaterialProperty instanceof s?e._closedColorBatches[l].add(t,i):e._closedMaterialBatches[l].add(t,i):i.fillMaterialProperty instanceof s?e._openColorBatches[l].add(t,i):e._openMaterialBatches[l].add(t,i))}function m(t,r,i){this._type=t;var n=r.primitives,a=r.groundPrimitives;this._scene=r,this._primitives=n,this._groundPrimitives=a,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var s=o.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(s),this._closedColorBatches=new Array(3*s),this._closedMaterialBatches=new Array(3*s),this._openColorBatches=new Array(3*s),this._openMaterialBatches=new Array(3*s);for(var p=0;p<s;++p)this._outlineBatches[p]=new d(n,r,p),this._closedColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,void 0,!0,p),this._closedMaterialBatches[p]=new u(n,t.materialAppearanceType,void 0,!0,p),this._openColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,void 0,!1,p),this._openMaterialBatches[p]=new u(n,t.materialAppearanceType,void 0,!1,p),this._closedColorBatches[p+s]=new l(n,t.perInstanceColorAppearanceType,t.perInstanceColorAppearanceType,!0,p),this._closedMaterialBatches[p+s]=new u(n,t.materialAppearanceType,t.perInstanceColorAppearanceType,!0,p),this._openColorBatches[p+s]=new l(n,t.perInstanceColorAppearanceType,t.perInstanceColorAppearanceType,!1,p),this._openMaterialBatches[p+s]=new u(n,t.materialAppearanceType,t.perInstanceColorAppearanceType,!1,p),this._closedColorBatches[p+2*s]=new l(n,t.perInstanceColorAppearanceType,t.materialAppearanceType,!0,p),this._closedMaterialBatches[p+2*s]=new u(n,t.materialAppearanceType,t.materialAppearanceType,!0,p),this._openColorBatches[p+2*s]=new l(n,t.perInstanceColorAppearanceType,t.materialAppearanceType,!1,p),this._openMaterialBatches[p+2*s]=new u(n,t.materialAppearanceType,t.materialAppearanceType,!1,p);this._groundColorBatch=new c(a),this._dynamicBatch=new h(n,a),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatch,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=i,i.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._onCollectionChanged(i,i.values,g)}var g=[];h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},h.prototype.remove=function(e){var t=e.entity.id,i=this._dynamicUpdaters.get(t);r(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;r<i;r++)t[r].update(e);return!0},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;t<r;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},h.prototype.getBoundingSphere=function(e,t){var i=this._dynamicUpdaters.get(e.id);return r(i)&&r(i.getBoundingSphere)?i.getBoundingSphere(e,t):a.FAILED},m.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),n.entity===r?(p(this,n),f(this,e,n)):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaters.get(i),p(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene),this._updaters.set(i,n),f(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,g=h.length;for(t=0;t<g;t++)d=h[t].update(e)&&d;return d};var v=[],_=new t;return m.prototype.getBoundingSphere=function(e,r){for(var i=v,n=_,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c<u;c++){if((s=l[c].getBoundingSphere(e,n))===a.PENDING)return a.PENDING;s===a.DONE&&(i[o]=t.clone(n,i[o]),o++)}return 0===o?a.FAILED:(i.length=o,t.fromBoundingSpheres(i,r),a.DONE)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(r=n.length,e=0;e<r;e++)n[e]();return this._subscriptions.removeAll(),i(this)},m._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,n=e.entity,o=n.id;r(t.get(o))||r(i.get(o))||i.set(o,n)},m.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),define("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){this.entity=e,this.label=void 0,this.index=void 0}function v(t,r){r.collectionChanged.addEventListener(v.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function _(e,t,r){o(e)&&(e.label=void 0,r.removeLabel(t))}var y=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<n;i++){var a,s=t[i],l=s.entity,u=l._label,c=s.label,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);d&&(D=m.getValueOrUndefined(l._position,e,D),a=m.getValueOrUndefined(u._text,e),d=o(D)&&o(a)),d?(m.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=D,c.text=a,c.scale=m.getValueOrDefault(u._scale,e,1),c.font=m.getValueOrDefault(u._font,e,"30px sans-serif"),c.style=m.getValueOrDefault(u._style,e,y),c.fillColor=m.getValueOrDefault(u._fillColor,e,b,I),c.outlineColor=m.getValueOrDefault(u._outlineColor,e,C,O),c.outlineWidth=m.getValueOrDefault(u._outlineWidth,e,1),c.showBackground=m.getValueOrDefault(u._showBackground,e,!1),c.backgroundColor=m.getValueOrDefault(u._backgroundColor,e,w,M),c.backgroundPadding=m.getValueOrDefault(u._backgroundPadding,e,S,R),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,T,N),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,E,L),c.heightReference=m.getValueOrDefault(u._heightReference,e,x),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,P),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,A),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,k),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,F),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,B),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,U),c.disableDepthTestDistance=m.getValueOrDefault(u._disableDepthTestDistance,e,0)):_(s,l,r)}return!0},v.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.label))return f.FAILED;var a=i.label;return t.center=r.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,f.DONE},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(v.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return a(this)},v.prototype._onCollectionChanged=function(e,t,r,i){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new g(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new g(a)):(_(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],_(s.get(a.id),a,l),s.remove(a.id)},v}),define("ThirdParty/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;i<t.length;i++){var n=t[i],o=r(n,i);if("number"==typeof o)i+=o;else if(o)break}},t.topLevel=function(e,r,i){var n=e[r];t.object(n,i)},t.accessor=function(e,r){t.topLevel(e,"accessors",r)},t.accessorWithSemantic=function(e,r,i){t.mesh(e,function(e){t.meshPrimitive(e,function(e){t.meshPrimitiveAttribute(e,function(t,n){0===n.indexOf(r)&&i(t,n,e)})})})},t.animation=function(e,r){t.topLevel(e,"animations",r)},t.animationSampler=function(r,i){var n=r.samplers;e(n)&&t.object(n,i)},t.buffer=function(e,r){t.topLevel(e,"buffers",r)},t.bufferView=function(e,r){t.topLevel(e,"bufferViews",r)},t.camera=function(e,r){t.topLevel(e,"cameras",r)},t.image=function(e,r){t.topLevel(e,"images",r)},t.material=function(e,r){t.topLevel(e,"materials",r)},t.materialValue=function(t,r){var i=t.values;if(e(i))for(var n in i)i.hasOwnProperty(n)&&r(i[n],n)},t.mesh=function(e,r){t.topLevel(e,"meshes",r)},t.meshPrimitive=function(t,r){var i=t.primitives;if(e(i))for(var n=i.length,o=0;o<n;o++){var a=i[o];r(a,o)}},t.meshPrimitiveAttribute=function(t,r){var i=t.attributes;if(e(i))for(var n in i)i.hasOwnProperty(n)&&r(i[n],n)},t.meshPrimitiveTargetAttribute=function(t,r){var i=t.targets;if(e(i))for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];for(var a in o)o.hasOwnProperty(a)&&"extras"!==a&&r(o[a],a)}},t.node=function(e,r){t.topLevel(e,"nodes",r)},t.nodeInTree=function(r,i,n){var o=r.nodes;if(e(o))for(var a=0;a<i.length;a++){var s=i[a],l=o[s];if(e(l)){n(l,s);var u=l.children;e(u)&&t.nodeInTree(r,u,n)}}},t.nodeInScene=function(r,i,n){var o=i.nodes;e(o)&&t.nodeInTree(r,o,n)},t.program=function(e,r){t.topLevel(e,"programs",r)},t.sampler=function(e,r){t.topLevel(e,"samplers",r)},t.scene=function(e,r){t.topLevel(e,"scenes",r)},t.shader=function(e,r){t.topLevel(e,"shaders",r)},t.skin=function(e,r){t.topLevel(e,"skins",r)},t.techniqueAttribute=function(t,r){var i=t.attributes;if(e(i))for(var n in i)if(i.hasOwnProperty(n)&&r(i[n],n))break},t.techniqueParameter=function(t,r){var i=t.parameters;if(e(i))for(var n in i)if(i.hasOwnProperty(n)&&r(i[n],n))break},t.technique=function(e,r){t.topLevel(e,"techniques",r)},t.texture=function(e,r){t.topLevel(e,"textures",r)},t}),define("ThirdParty/GltfPipeline/addDefaults",["./addToArray","./ForEach","../../Core/clone","../../Core/defaultValue","../../Core/defined","../../Core/WebGLConstants"],function(e,t,r,i,n,o){"use strict";function a(e,t){for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if("function"==typeof o&&(o=o(e)),n(o))if("object"==typeof o)if(Array.isArray(o)){var s=i(e[r],[]);if(o.length>0){var l=o[0];if("object"==typeof l)for(var u=s.length,c=0;c<u;c++)a(s[c],l);else s=i(e[r],o)}e[r]=s}else{var d=o["*"];e[r]=i(e[r],{});var h=e[r];if(n(d)){for(var p in h)if(h.hasOwnProperty(p)&&"extras"!==p){var f=h[p];a(f,d)}}else a(h,o)}else e[r]=i(e[r],o)}}function s(t){for(var i,o=t.materials,a=t.meshes,s=a.length,l=0;l<s;l++)for(var u=a[l],c=u.primitives,d=c.length,h=0;h<d;h++){var p=c[h];n(p.material)||(n(i)||(i=e(o,r(m,!0))),p.material=i)}}function l(t){for(var o,a=t.materials,s=t.techniques,l=t.programs,u=t.shaders,c=a.length,d=0;d<c;d++){var h=a[d],p=h.technique,f=i(h.extensions,{}),m=f.KHR_materials_common;if(!n(p)){if(!n(o)&&!n(m)){var b=r(g,!0);o=e(s,b);var C=r(v,!0);b.program=e(l,C);var w=r(_,!0);C.vertexShader=e(u,w);var S=r(y,!0);C.fragmentShader=e(u,S)}h.technique=o}}}function u(e){for(var t=e.accessors,r=t.length,i=0;i<r;i++){var o=t[i];n(o.byteOffset)||(o.byteOffset=0)}for(var a=e.bufferViews,s=a.length,l=0;l<s;l++){var u=a[l];n(u.byteOffset)||(u.byteOffset=0)}}function c(e){n(e.scenes)&&!n(e.scene)&&(e.scene=0)}function d(e){for(var t=e.techniques,r=t.length,i=0;i<r;i++){var o=t[i],a=o.parameters;n(a.diffuse)&&(a.diffuse.semantic="_3DTILESDIFFUSE")}}function h(e){var r={},i=0;if(t.bufferView(e,function(e,t){n(e.target)||(r[t]=!0,i++)}),i>0){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;l<s;l++){var u=a[l];t(u)&&"object"==typeof u&&(u.extras=e(u.extras,{}),u.extras._pipeline=e(u.extras._pipeline,{}),n.push(u))}for(;n.length>0;){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;a<o;a++){var s=n[a],l=u(s.primitive,h.TRIANGLES);s.mode=u(s.mode,l),delete s.primitive}}}function g(e){var t=e.nodes,r=new o,i=new d;for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];if(c(a.rotation)){var s=a.rotation;o.fromArray(s,0,r),d.fromAxisAngle(r,s[3],i),a.rotation=[i.x,i.y,i.z,i.w]}var l=a.instanceSkin;c(l)&&(a.skeletons=l.skeletons,a.skin=l.skin,a.meshes=l.meshes,delete a.instanceSkin)}}function v(e){var t=e.animations,r=e.accessors,i=e.bufferViews,a=e.buffers,s={},u=new o,h=new d;for(var p in t)if(t.hasOwnProperty(p)){var f=t[p],m=f.channels,g=f.parameters,v=f.samplers;if(c(m))for(var _=m.length,y=0;y<_;++y){var b=m[y];if("rotation"===b.target.path){var C=g[v[b.sampler].output];if(c(s[C]))continue;s[C]=!0;for(var w=r[C],S=i[w.bufferView],T=a[S.buffer],E=T.extras._pipeline.source,x=E.byteOffset+S.byteOffset+w.byteOffset,P=w.componentType,A=w.count,D=n(w.type),I=w.count*D,O=l.createArrayBufferView(P,E.buffer,x,I),M=0;M<A;M++){var R=M*D;o.unpack(O,R,u);var L=O[R+3];d.fromAxisAngle(u,L,h),d.pack(h,O,R)}}}}}function _(e){var t=e.techniques;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.passes;if(c(n)){var o=u(i.pass,"defaultPass");if(n.hasOwnProperty(o)){var a=n[o],s=a.instanceProgram;i.attributes=u(i.attributes,s.attributes),i.program=u(i.program,s.program),i.uniforms=u(i.uniforms,s.uniforms),i.states=u(i.states,a.states)}delete i.passes,delete i.pass}}}function y(e){c(e.asset)||(e.asset={});var t=e.asset;if(t.version="1.0",c(t.profile)&&"string"!=typeof t.profile||(t.profile={}),c(e.version)&&delete e.version,f(e),m(e),g(e),v(e),_(e),c(e.lights)){var r=u(e.extensions,{});e.extensions=r;var i=u(r.KHR_materials_common,{});r.KHR_materials_common=i,i.lights=e.lights,delete e.lights}c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0)}function b(e){var t=e.animations;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.parameters;if(c(n)){var o=i.samplers;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];s.input=n[s.input],s.output=n[s.output]}delete i.parameters}}}function C(e,t){var r=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];t[i]=r.length,r.push(n),c(n.name)||"object"!=typeof n||(n.name=i)}return r}function w(e){var i,n,o={accessors:{},animations:{},bufferViews:{},buffers:{},cameras:{},materials:{},meshes:{},nodes:{},programs:{},shaders:{},skins:{},techniques:{}},a={},s=e.nodes;for(var l in s)s.hasOwnProperty(l)&&(n=s[l].jointName,c(n)&&(a[n]=l));for(var u in e)if(e.hasOwnProperty(u)&&"extras"!==u&&"asset"!==u&&"extensions"!==u){var d={},h=e[u];"object"!=typeof h||Array.isArray(h)||(e[u]=C(h,d),o[u]=d,"animations"===u&&(d={},h.samplers=C(h.samplers,d),o[u].samplers=d))}for(n in a)a.hasOwnProperty(n)&&(a[n]=o.nodes[a[n]]);c(e.scene)&&(e.scene=o.scenes[e.scene]),r.bufferView(e,function(e){c(e.buffer)&&(e.buffer=o.buffers[e.buffer])}),r.accessor(e,function(e){c(e.bufferView)&&(e.bufferView=o.bufferViews[e.bufferView])}),r.shader(e,function(e){var t=e.extensions;if(c(t)){var r=t.KHR_binary_glTF;c(r)&&(e.bufferView=o.bufferViews[r.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),r.program(e,function(e){c(e.vertexShader)&&(e.vertexShader=o.shaders[e.vertexShader]),c(e.fragmentShader)&&(e.fragmentShader=o.shaders[e.fragmentShader])}),r.technique(e,function(e){c(e.program)&&(e.program=o.programs[e.program]),r.techniqueParameter(e,function(e){c(e.node)&&(e.node=o.nodes[e.node]);var t=e.value;if(c(t))if(Array.isArray(t)){if(1===t.length){var r=t[0];"string"==typeof r&&(t[0]=o.textures[r])}}else"string"==typeof t&&(e.value=[o.textures[t]])})}),r.mesh(e,function(e){r.meshPrimitive(e,function(e){c(e.indices)&&(e.indices=o.accessors[e.indices]),r.meshPrimitiveAttribute(e,function(t,r){e.attributes[r]=o.accessors[t]}),c(e.material)&&(e.material=o.materials[e.material])})}),r.node(e,function(r){var n=r.children;if(c(n)){var a=n.length;for(i=0;i<a;i++)n[i]=o.nodes[n[i]]}if(c(r.meshes)){var s=r.meshes,l=s.length;if(l>0)for(r.mesh=o.meshes[s[0]],i=1;i<l;i++){var u={mesh:o.meshes[s[i]],extras:{_pipeline:{}}},d=t(e.nodes,u);c(n)||(n=[],r.children=n),n.push(d)}delete r.meshes}if(c(r.camera)&&(r.camera=o.cameras[r.camera]),c(r.skeletons)){var h=r.skeletons;if(h.length>0&&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<r.length;i++)t[i]=a[r[i]];e.joints=t,delete e.jointNames}}),r.scene(e,function(e){var t=e.nodes;if(c(t)){var r=t.length;for(i=0;i<r;i++)t[i]=o.nodes[t[i]]}}),r.animation(e,function(e){var t={};e.samplers=C(e.samplers,t),r.animationSampler(e,function(e){e.input=o.accessors[e.input],e.output=o.accessors[e.output]});var n=e.channels;if(c(n)){var a=n.length;for(i=0;i<a;i++){var s=n[i];s.sampler=t[s.sampler];var l=s.target;c(l)&&(l.node=o.nodes[l.id],delete l.id)}}}),r.material(e,function(e){c(e.technique)&&(e.technique=o.techniques[e.technique]),r.materialValue(e,function(t,r){if(Array.isArray(t)){if(1===t.length){var i=t[0];"string"==typeof i&&(t[0]=o.textures[i])}}else"string"==typeof t&&(e.values[r]={index:o.textures[t]})});var t=e.extensions;if(c(t)){var i=t.KHR_materials_common;c(i)&&r.materialValue(i,function(e,t){if(Array.isArray(e)){if(1===e.length){var r=e[0];"string"==typeof r&&(e[0]=o.textures[r])}}else"string"==typeof e&&(i.values[t]={index:o.textures[e]})})}}),r.image(e,function(e){var t=e.extensions;if(c(t)){var r=t.KHR_binary_glTF;c(r)&&(e.bufferView=o.bufferViews[r.bufferView],e.mimeType=r.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}if(c(e.extras)){var i=e.extras.compressedImage3DTiles;for(var n in i)if(i.hasOwnProperty(n)){var a=i[n],s=a.extensions;if(c(s)){var l=s.KHR_binary_glTF;c(l)&&(a.bufferView=o.bufferViews[l.bufferView],a.mimeType=l.mimeType,delete s.KHR_binary_glTF),0===Object.keys(s).length&&delete a.extensions}}}}),r.texture(e,function(e){c(e.sampler)&&(e.sampler=o.samplers[e.sampler]),c(e.source)&&(e.source=o.images[e.source])})}function S(e){delete e.asset.profile}function T(e){var t=e.extensionsUsed;if(e.extensionsRequired=u(e.extensionsRequired,[]),c(t))for(var r=t.length,i=0;i<r;i++){var n=t[i];c(B[n])&&e.extensionsRequired.push(n)}}function E(e){r.buffer(e,function(e){delete e.type})}function x(e){r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(t,r){"TEXCOORD"===r?e.attributes.TEXCOORD_0=t:"COLOR"===r&&(e.attributes.COLOR_0=t)}),delete e.attributes.TEXCOORD,delete e.attributes.COLOR})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var t=e.semantic;c(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})})}function P(e){var t={};r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(e,r){if("_"!==r.charAt(0)){var i=r.search(/_[0-9]+/g),n=r;if(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)}})}
  472. 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;C<f;){var w=i.createArrayBufferView(l.INT,u.buffer,u.byteOffset+C,2),S=w[0],T=w[1];C+=8;var E=u.subarray(C,C+S);if(C+=S,1313821514===T){var x=s(E);h=JSON.parse(x),e(h)}else 5130562===T&&(b=E)}if(n(h)&&n(b)&&(p=h.buffers,n(p)&&p.length>0)){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;U<z;U++)for(V=0;V<z;V++)B+=0===U&&0===V?" mat4 skinMat = ":" skinMat += ",B+="a_weight["+U+"]["+V+"] * u_jointMatrix[int(a_joint["+U+"]["+V+"])];\n";else for(U=0;U<z;U++)B+=0===U?" mat4 skinMat = ":" skinMat += ",B+="a_weight["+U+"] * u_jointMatrix[int(a_joint["+U+"])];\n"}var H={a_position:"position"};A.position={semantic:"POSITION",type:u.FLOAT_VEC3},E+="attribute vec3 a_position;\n",E+="varying vec3 v_positionEC;\n",B+=S?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",B+=" v_positionEC = pos.xyz;\n",B+=" gl_Position = u_projectionMatrix * pos;\n",x+="varying vec3 v_positionEC;\n",P&&(H.a_normal="normal",A.normal={semantic:"NORMAL",type:u.FLOAT_VEC3},E+="attribute vec3 a_normal;\n",E+="varying vec3 v_normal;\n",B+=S?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",x+="varying vec3 v_normal;\n");var W;if(I&&(H.a_texcoord_0="texcoord_0",A.texcoord_0={semantic:"TEXCOORD_0",type:u.FLOAT_VEC2},W="v_texcoord_0",E+="attribute vec2 a_texcoord_0;\n",E+="varying vec2 "+W+";\n",B+=" "+W+" = a_texcoord_0;\n",x+="varying vec2 "+W+";\n"),S){H.a_joint="joint";var j=g(T.type),q=o(j);A.joint={semantic:"JOINT",type:q},H.a_weight="weight",A.weight={semantic:"WEIGHT",type:q},E+="attribute "+j+" a_joint;\n",E+="attribute "+j+" a_weight;\n"}m&&(H.a_batchId="batchId",A.batchId={semantic:"_BATCHID",type:u.FLOAT},E+="attribute float a_batchId;\n");var Y=P&&("BLINN"===b||"PHONG"===b)&&s(A.specular)&&s(A.shininess)&&A.shininess>0,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;o<n;++o){var a=i[o];r.hasOwnProperty(a)&&(t+=a+":"+p(a,r[a]),t+=";")}t+=l(e.doubleSided,l(e.values.doubleSided,!1)).toString()+";",t+=l(e.transparent,l(e.values.transparent,!1)).toString()+";";var s=l(e.jointCount,0);if(t+=s.toString()+";",s>0){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<n;o++){var a=i[o];if("ambient"===a.type){s(a.ambient)||(a.ambient={});var u=a.ambient;s(u.color)||(u.color=[1,1,1])}else if("directional"===a.type){s(a.directional)||(a.directional={});var c=a.directional;s(c.color)||(c.color=[1,1,1])}else if("point"===a.type){s(a.point)||(a.point={});var d=a.point;s(d.color)||(d.color=[1,1,1]),d.constantAttenuation=l(d.constantAttenuation,1),d.linearAttenuation=l(d.linearAttenuation,0),d.quadraticAttenuation=l(d.quadraticAttenuation,0)}else if("spot"===a.type){s(a.spot)||(a.spot={});var h=a.spot;s(h.color)||(h.color=[1,1,1]),h.constantAttenuation=l(h.constantAttenuation,1),h.fallOffAngle=l(h.fallOffAngle,3.14159265),h.fallOffExponent=l(h.fallOffExponent,0),h.linearAttenuation=l(h.linearAttenuation,0),h.quadraticAttenuation=l(h.quadraticAttenuation,0)}}}function g(e){return"SCALAR"===e?"float":e.toLowerCase()}function v(e,t){var r=e.accessors,n=e.materials,o=e.techniques,a=e.programs,l=e.shaders,u=t.attributes,c=n[t.material],d=o[c.technique],h=a[d.program],p=l[h.vertexShader];for(var f in u)if(u.hasOwnProperty(f)&&!s(i(d,f))){var m=u[f],v=r[m],_=f.toLowerCase();"_"===_.charAt(0)&&(_=_.slice(1));var y="a_"+_;d.parameters[_]={semantic:f,type:v.componentType},d.attributes[y]=_,h.attributes.push(y);var b=p.extras._pipeline,C=b.source;C="attribute "+g(v.type)+" "+y+";\n"+C,b.source=C}}function _(e){t.mesh(e,function(r){t.meshPrimitive(r,function(t){v(e,t)})})}function y(r){var i=r.accessors,n=r.materials;t.mesh(r,function(r){t.meshPrimitive(r,function(t){var r=t.material,o=n[r];if(s(o.extensions)&&s(o.extensions.KHR_materials_common)){var l,u,c=o.extensions.KHR_materials_common,d=t.attributes.JOINT;if(s(d)){var h=i[d];l=h.componentType,u=h.type}var p=s(d),f=c.extras._pipeline.skinning;if(s(f)){if(f.skinned!==p||f.type!==u){var m=a(o,!0);m.extensions.KHR_materials_common.extras._pipeline.skinning={skinned:p,componentType:l,type:u},r=e(n,m),t.material=r}}else c.extras._pipeline.skinning={skinned:p,componentType:l,type:u}}})})}return c}),define("ThirdParty/GltfPipeline/processPbrMetallicRoughness",["./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){r=l(r,{});var i=!1;if(t.material(e,function(e){s(e.pbrMetallicRoughness)&&(i=!0)}),i){s(e.programs)||(e.programs=[]),s(e.shaders)||(e.shaders=[]),s(e.techniques)||(e.techniques=[]),g(e),s(e.techniques)||(e.techniques=[]);var n=[];t.material(e,function(t){if(s(t.pbrMetallicRoughness)){var i=t.pbrMetallicRoughness,o=d(e,t,r),a={values:i,technique:o};n.push(a)}}),e.materials=n,m(e)}return e}function d(i,a,c){var d=l(c.optimizeForCesium,!1),f=s(i.extensions)&&s(i.extensions.CESIUM_RTC),m=l(c.addBatchIdToGeneratedShaders,!1),g=i.techniques,v=i.shaders,_=i.programs,y=a.pbrMetallicRoughness;for(var b in a)(a.hasOwnProperty(b)&&(b.indexOf("Texture")>=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<G;V++)for(z=0;z<G;z++)U+=0===V&&0===z?" mat4 skinMatrix = ":" skinMatrix += ",U+="a_weight["+V+"]["+z+"] * u_jointMatrix[int(a_joint["+V+"]["+z+"])];\n";else for(V=0;V<G;V++)U+=0===V?" mat4 skinMatrix = ":" skinMatrix += ",U+="a_weight["+V+"] * u_jointMatrix[int(a_joint["+V+"])];\n"}var W={a_position:"position"};if(O.position={semantic:"POSITION",type:u.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",d&&(w+="varying vec3 v_positionWC;\n"),U+=" vec3 weightedPosition = a_position;\n",U+=" vec3 weightedNormal = a_normal;\n",D&&(U+=" vec3 weightedTangent = a_tangent;\n"),I)for(var j=0;j<T.length;j++){var q=T[j];for(var Y in q)if(q.hasOwnProperty(Y)&&"extras"!==Y){var X=Y.toLowerCase()+"_"+j;W["a_"+X]=X,O[X]={semantic:Y+"_"+j,type:u.FLOAT_VEC3},w+="attribute vec3 a_"+X+";\n","POSITION"===Y?U+=" weightedPosition += u_morphWeights["+j+"] * a_"+X+";\n":"NORMAL"===Y?U+=" weightedNormal += u_morphWeights["+j+"] * a_"+X+";\n":"TANGENT"===Y&&(U+=" weightedTangent += u_morphWeights["+j+"] * a_"+X+";\n")}}U+=A?" vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":" vec4 position = vec4(weightedPosition, 1.0);\n",d&&(U+=" v_positionWC = (czm_model * position).xyz;\n"),U+=" position = u_modelViewMatrix * position;\n",U+=" v_positionEC = position.xyz;\n",U+=" gl_Position = u_projectionMatrix * position;\n",S+="varying vec3 v_positionEC;\n",d&&(S+="varying vec3 v_positionWC;\n"),W.a_normal="normal",O.normal={semantic:"NORMAL",type:u.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",U+=A?" v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":" v_normal = u_normalMatrix * weightedNormal;\n",S+="varying vec3 v_normal;\n",D&&(W.a_tangent="tangent",O.tangent={semantic:"TANGENT",type:u.FLOAT_VEC3},w+="attribute vec3 a_tangent;\n",w+="varying vec3 v_tangent;\n",U+=" v_tangent = (u_modelViewMatrix * vec4(weightedTangent, 1.0)).xyz;\n",S+="varying vec3 v_tangent;\n");var Q;if(M&&(W.a_texcoord_0="texcoord_0",O.texcoord_0={semantic:"TEXCOORD_0",type:u.FLOAT_VEC2},Q="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+Q+";\n",U+=" "+Q+" = a_texcoord_0;\n",S+="varying vec2 "+Q+";\n"),A){W.a_joint="joint";var Z=p(P.type),K=o(Z);O.joint={semantic:"JOINTS_0",type:K},W.a_weight="weight",O.weight={semantic:"WEIGHTS_0",type:K},w+="attribute "+Z+" a_joint;\n",w+="attribute "+Z+" a_weight;\n"}m&&(W.a_batchId="batchId",O.batchId={semantic:"_BATCHID",type:u.FLOAT},w+="attribute float a_batchId;\n"),w+="void main(void) \n{\n",w+=U,w+="}\n",S+="const float M_PI = 3.141592653589793;\n",S+="vec3 lambertianDiffuse(vec3 baseColor) \n{\n return baseColor / M_PI;\n}\n\n",S+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",S+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",S+="float smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",S+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",S+="float GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\n\n",S+="void main(void) \n{\n",S+=" vec3 ng = normalize(v_normal);\n",s(y.normalTexture)?D?(S+=" vec3 t = normalize(v_tangent);\n",S+=" vec3 b = normalize(cross(ng, t));\n",S+=" mat3 tbn = mat3(t, b, ng);\n",S+=" vec3 n = texture2D(u_normalTexture, "+Q+").rgb;\n",S+=" n = normalize(tbn * (2.0 * n - 1.0));\n"):(S="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+S,S+="#ifdef GL_OES_standard_derivatives\n",S+=" vec3 pos_dx = dFdx(v_positionEC);\n",S+=" vec3 pos_dy = dFdy(v_positionEC);\n",S+=" vec3 tex_dx = dFdx(vec3("+Q+",0.0));\n",S+=" vec3 tex_dy = dFdy(vec3("+Q+",0.0));\n",S+=" vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",S+=" t = normalize(t - ng * dot(ng, t));\n",S+=" vec3 b = normalize(cross(ng, t));\n",S+=" mat3 tbn = mat3(t, b, ng);\n",S+=" vec3 n = texture2D(u_normalTexture, "+Q+").rgb;\n",S+=" n = normalize(tbn * (2.0 * n - 1.0));\n",S+="#else\n",S+=" vec3 n = ng;\n",S+="#endif\n"):S+=" vec3 n = ng;\n",y.doubleSided&&(S+=" if (!gl_FrontFacing)\n",S+=" {\n",S+=" n = -n;\n",S+=" }\n"),s(y.baseColorTexture)?(S+=" vec4 baseColorWithAlpha = texture2D(u_baseColorTexture, "+Q+");\n",s(y.baseColorFactor)&&(S+=" baseColorWithAlpha *= u_baseColorFactor;\n")):s(y.baseColorFactor)?S+=" vec4 baseColorWithAlpha = u_baseColorFactor;\n":S+=" vec4 baseColorWithAlpha = vec4(1.0);\n",S+=" vec3 baseColor = baseColorWithAlpha.rgb;\n",s(y.metallicRoughnessTexture)?(S+=" vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+Q+").rgb;\n",S+=" float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",S+=" float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",s(y.metallicFactor)&&(S+=" metalness *= u_metallicFactor;\n"),s(y.roughnessFactor)&&(S+=" roughness *= u_roughnessFactor;\n")):(s(y.metallicFactor)?S+=" float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":S+=" float metalness = 1.0;\n",s(y.roughnessFactor)?S+=" float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":S+=" float roughness = 1.0;\n"),S+=" vec3 v = -normalize(v_positionEC);\n",S+=" vec3 lightColor = vec3(1.0, 1.0, 1.0);\n",S+=d?" vec3 l = normalize(czm_sunDirectionEC);\n":" vec3 l = vec3(0.0, 0.0, 1.0);\n",S+=" vec3 h = normalize(v + l);\n",d?(S+=" vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",S+=" czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n",S+=" float vertexRadius = length(v_positionWC);\n",S+=" float horizonDotNadir = 1.0 - ellipsoid.radii.x / vertexRadius;\n",S+=" float reflectionDotNadir = dot(r, normalize(v_positionWC));\n",S+=" r.x = -r.x;\n",S+=" r = -normalize(czm_temeToPseudoFixed * r);\n",S+=" r.x = -r.x;\n"):S+=" vec3 r = normalize(reflect(v, n));\n",S+=" float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",S+=" float NdotV = abs(dot(n, v)) + 0.001;\n",S+=" float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",S+=" float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",S+=" float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",S+=" vec3 f0 = vec3(0.04);\n",S+=" float alpha = roughness * roughness;\n",S+=" vec3 diffuseColor = baseColor * (1.0 - metalness);\n",S+=" vec3 specularColor = mix(f0, baseColor, metalness);\n",S+=" float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",S+=" vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",S+=" vec3 r0 = specularColor.rgb;\n",S+=" vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",S+=" float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",S+=" float D = GGX(alpha, NdotH);\n",S+=" vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(baseColor);\n",S+=" vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",S+=" vec3 color = NdotL * lightColor * (diffuseContribution + specularContribution);\n",d&&(S+=" float inverseRoughness = 1.0 - roughness;\n",S+=" inverseRoughness *= inverseRoughness;\n",S+=" vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",S+=" float atmosphereHeight = 0.05;\n",S+=" float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",S+=" float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",S+=" float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",S+=" float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",S+=" float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",S+=" float lightScale = smoothstepHeight * 1.5 + 1.0;\n",S+=" vec3 diffuseIrradiance = mix(vec3(0.5), vec3(0.05), smoothstepHeight);\n",S+=" vec3 belowHorizonColor = mix(vec3(0.1, 0.2, 0.4), vec3(0.2, 0.5, 0.7), smoothstepHeight);\n",S+=" vec3 nadirColor = belowHorizonColor * 0.5;\n",S+=" vec3 aboveHorizonColor = vec3(0.8, 0.9, 0.95);\n",S+=" vec3 blueSkyColor = mix(vec3(0.09, 0.13, 0.24), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.5);\n",S+=" vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",S+=" vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * inverseRoughness);\n",S+=" specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",S+=" specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",S+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n",S+=" vec3 IBLColor = (diffuseIrradiance * diffuseColor) + (specularIrradiance * (specularColor * brdfLut.x + brdfLut.y));\n",S+=" color = color * lightScale + IBLColor;\n"),s(y.occlusionTexture)&&(S+=" color *= texture2D(u_occlusionTexture, "+Q+").r;\n"),s(y.emissiveTexture)?(S+=" vec3 emissive = texture2D(u_emissiveTexture, "+Q+").rgb;\n",s(y.emissiveFactor)&&(S+=" emissive *= u_emissiveFactor;\n"),S+=" color += emissive;\n"):s(y.emissiveFactor)&&(S+=" color += u_emissiveFactor;\n");var J=a.alphaMode;if(s(J))if("MASK"===J){var $=a.alphaCutoff;s($)?S+=" gl_FragColor = vec4(color, int(baseColorWithAlpha.a >= "+$+"));\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){
  473. 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<S;P++){var A=r.createArrayBufferView(b,y.buffer,y.byteOffset+x,w);"SCALAR"===C?l[P]=A[0]:"VEC3"===C?l[P]=t.fromArray(A):"VEC4"===C&&(l[P]=s.unpack(A)),x+=T}n(e.cacheKey)&&(_[a]=l)}return l};var y={};g.prototype.evaluate=function(e,t){return this._value},p.getAnimationSpline=function(e,t,r,i,a,s,u,d){var h=m(e,t,i),p=y[h];if(!n(p)){var f=s,v=d;1===f.length&&1===v.length?p=new g(v[0]):"LINEAR"===a.interpolation&&("translation"===u||"scale"===u?p=new o({times:f,points:v}):"rotation"===u?p=new l({times:f,points:v}):"weights"===u&&(p=new c({times:f,weights:v}))),n(e.cacheKey)&&(y[h]=p)}return p};var b={};return p.getSkinInverseBindMatrices=function(t,i){var o=f(t,i),s=b[o];if(!n(s)){var l=t.gltf,c=l.buffers,p=l.bufferViews,m=i.bufferView,g=p[m],v=g.buffer,_=c[v],y=_.extras._pipeline.source,C=i.componentType,w=i.type,S=i.count,T=d(l,i),E=g.byteOffset+i.byteOffset,x=h(w);if(s=new Array(S),C===u.FLOAT&&w===e.MAT4)for(var P=0;P<S;++P){var A=r.createArrayBufferView(C,y.buffer,y.byteOffset+E,x);s[P]=a.fromArray(A),E+=T}b[o]=s}return s},p}),define("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,REPEAT:1,MIRRORED_REPEAT:2})}),define("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),define("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o){"use strict";function a(t,a,s){this._name=s.name,this._startTime=i.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new r,this.update=new r,this.stop=new r,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),define("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function h(e,t,r){var i=e._model,n=i._runtime.animations,o=n[t],a=new l(r,i,o);return e._scheduledAnimations.push(a),e.animationAdded.raiseEvent(i,a),a}function p(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;n<i;++n)r[n](t)}function f(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}i(d.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),d.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,n=i._runtime.animations;if(r(e.index))return h(this,e.index,e);for(var o,a=n.length,s=0;s<a;++s)if(n[s].name===e.name){o=s;break}return h(this,o,e)},d.prototype.addAll=function(e){e=t(e,t.EMPTY_OBJECT);for(var r=[],i=this._model,n=i._runtime.animations,o=n.length,a=0;a<o;++a)r.push(h(this,a,e));return r},d.prototype.remove=function(e){if(r(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},d.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;i<r;++i)this.animationRemoved.raiseEvent(e,t[i])},d.prototype.contains=function(e){return!!r(e)&&-1!==this._scheduledAnimations.indexOf(e)},d.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return d.prototype.update=function(e){var i=this._scheduledAnimations,n=i.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,d=this._model,h=0;h<n;++h){var g=i[h],v=g._runtimeAnimation;r(g._computedStartTime)||(g._computedStartTime=a.addSeconds(t(g.startTime,l),g.delay,new a)),r(g._duration)||(g._duration=v.stopTime*(1/g.speedup));var _=g._computedStartTime,y=g._duration,b=g.stopTime,C=0!==y?a.secondsDifference(l,_)/y:0,w=C>=0,S=g.loop===u.REPEAT||g.loop===u.MIRRORED_REPEAT;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;P<n;++P){var A=m[P];i.splice(i.indexOf(A),1),e.afterRender.push(f(this,d,A))}return m.length=0,o},d}),define("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";function i(e,t,r){this._name=t.name,this._id=r,this._uniformMap=e._uniformMaps[r]}return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),i.prototype.setValue=function(e,t){var r=this._uniformMap.values[e];r.value=r.clone(t,r.value)},i.prototype.getValue=function(t){var r=this._uniformMap.values[t];if(e(r))return r.value},i}),define("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,r){for(var i=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];i[a]=t[s.material]}this._name=e.name,this._materials=i,this._id=r}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),define("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function r(e,r,i,n,o){this._model=e,this._runtimeNode=i,this._name=r.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=t.clone(e,this._matrix),this.useMatrix=!0;var r=this._model;r._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=r._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){t.clone(e,this._matrix)},r}),define("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/joinUrls","../Core/loadArrayBuffer","../Core/loadCRN","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadKTX","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../ThirdParty/GltfPipeline/addDefaults","../ThirdParty/GltfPipeline/addPipelineExtras","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType","../ThirdParty/GltfPipeline/parseBinaryGltf","../ThirdParty/GltfPipeline/processModelMaterialsCommon","../ThirdParty/GltfPipeline/processPbrMetallicRoughness","../ThirdParty/GltfPipeline/removePipelineExtras","../ThirdParty/GltfPipeline/updateVersion","../ThirdParty/Uri","../ThirdParty/when","./AttributeType","./Axis","./BlendingState","./ColorBlendMode","./getAttributeOrUniformBySemantic","./HeightReference","./JobType","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./ModelMesh","./ModelNode","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,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){"use strict";function we(){this.vertexBuffersToCreate=new L,this.indexBuffersToCreate=new L,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new L,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new L,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new L,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesIds=[]}function Se(e,t){e._cachedGltf=t}function Te(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function Ee(t){t=l(t,l.EMPTY_OBJECT);var r=t.cacheKey;this._cacheKey=r,this._cachedGltf=void 0,this._releaseGltfJson=l(t.releaseGltfJson,!1);var i;if(u(r)&&u(Dr[r])&&Dr[r].ready)i=Dr[r],++i.count;else{var n=t.gltf;if(u(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){i=new Te({gltf:te(n),ready:!0})}else i=new Te({gltf:t.gltf,ready:!0});i.count=1,u(r)&&(Dr[r]=i)}}Se(this,i),this._basePath=l(t.basePath,"");var o=g(document.location.href);this._baseUri=b(o,this._basePath),this.show=l(t.show,!0),this.silhouetteColor=l(t.silhouetteColor,a.RED),this._silhouetteColor=new a,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=l(t.silhouetteSize,0),this.modelMatrix=I.clone(l(t.modelMatrix,I.IDENTITY)),this._modelMatrix=I.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=l(t.scale,1),this._scale=this.scale,this.minimumPixelSize=l(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.heightReference=l(t.heightReference,pe.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var s=t.scene;this._scene=s,u(s)&&u(s.terrainProviderChanged)&&(this._terrainProviderChangedCallback=s.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=t.pickObject,this._allowPicking=l(t.allowPicking,!0),this._ready=!1,this._readyPromise=se.defer(),this.activeAnimations=new ge(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=l(t.incrementallyLoadTextures,!0),this._asynchronous=l(t.asynchronous,!0),this.shadows=l(t.shadows,Ce.ENABLED),this._shadows=this.shadows,this.color=l(t.color,a.WHITE),this._color=new a,this._colorPreviousAlpha=1,this.colorBlendMode=l(t.colorBlendMode,de.HIGHLIGHT),this.colorBlendAmount=l(t.colorBlendAmount,.5),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=t.addBatchIdToGeneratedShaders,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=l(t.ignoreCommands,!1),this._requestType=t.requestType,this._upAxis=l(t.upAxis,ue.Y),this.cull=l(t.cull,!0),this.opaquePass=l(t.opaquePass,z.OPAQUE),this._computedModelMatrix=new I,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=Ar.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._updatedGltfVersion=!1,this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function xe(e){return e.stencilBuffer}function Pe(e,t,r){return e.subarray(t,t+r)}function Ae(e){return"glTF"===v(e)}function De(e,t,r){return e._runtime[t][r]}function Ie(e,t){var r=e.accessors[t],i=r.extensions,n=r.min,o=r.max;if(u(i)){var a=i.WEB3D_quantized_attributes;u(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}}function Oe(t){for(var i=t.gltf,n=i.nodes,o=i.meshes,a=i.scenes[i.scene].nodes,s=a.length,l=[],c=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new r(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<s;++h){var p=n[a[h]];for(p._transformToRoot=Ge(p),l.push(p);l.length>0;){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;x<E;++x){var P=n[T[x]];P._transformToRoot=Ge(P),I.multiplyTransformation(f,P._transformToRoot,P._transformToRoot),l.push(P)}delete p._transformToRoot}}var A=e.fromCornerPoints(c,d);return t._upAxis===ue.Y?e.transformWithoutScale(A,ue.Y_UP_TO_Z_UP,A):t._upAxis===ue.X&&e.transformWithoutScale(A,ue.X_UP_TO_Z_UP,A),A}function Me(e,t,r){return function(){e._state=Ar.FAILED,e._readyPromise.reject(new N("Failed to load "+t+": "+r))}}function Re(e){var t=e.gltf,r=e._loadResources;J.buffer(t,function(e,t){r.buffers[t]=e.extras._pipeline.source})}function Le(e,t){return function(r){var i=e._loadResources,n=new Uint8Array(r);--i.pendingBufferLoads,e.gltf.buffers[t].extras._pipeline.source=n}}function Ne(e){var t=e._loadResources,r=e.gltf.buffers;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];if(n.extras=l(n.extras,{}),n.extras._pipeline=l(n.extras._pipeline,{}),u(n.extras._pipeline.source))t.buffers[i]=n.extras._pipeline.source;else{var o=b(e._baseUri,n.uri);++t.pendingBufferLoads,C(o).then(Le(e,i)).otherwise(Me(e,"buffer",o))}}}function ke(e){var t=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;J.bufferView(e.gltf,function(e,t){e.target===F.ARRAY_BUFFER&&r.enqueue(t)});var i=e._loadResources.indexBuffersToCreate,n={};J.accessor(e.gltf,function(e){var r=e.bufferView;t[r].target!==F.ELEMENT_ARRAY_BUFFER||u(n[r])||(n[r]=!0,i.enqueue({id:r,componentType:e.componentType}))})}function Fe(e,t,r){return function(i){var n=e._loadResources;n.shaders[r]={source:i,type:t,bufferView:void 0},--n.pendingShaderLoads,e.gltf.shaders[r].extras._pipeline.source=i}}function Be(e){var t=e.gltf,r=t.buffers,i=t.bufferViews;J.shader(t,function(t,n){if(u(t.bufferView)){var o=t.bufferView,a=i[o],s=a.buffer,l=r[s],c=_(l.extras._pipeline.source,a.byteOffset,a.byteLength);e._loadResources.shaders[n]={source:c,bufferView:void 0},t.extras._pipeline.source=c}else if(u(t.extras._pipeline.source))e._loadResources.shaders[n]={source:t.extras._pipeline.source,bufferView:void 0};else{++e._loadResources.pendingShaderLoads;var d=b(e._baseUri,t.uri);x(d).then(Fe(e,t.type,n)).otherwise(Me(e,"shader",d))}})}function Ue(e){J.program(e.gltf,function(t,r){e._loadResources.programsToCreate.enqueue(r)})}function Ve(e,t,r){return function(i){var n=e.gltf,o=e._loadResources;--o.pendingTextureLoads,o.texturesToCreate.enqueue({id:t,image:i,bufferView:i.bufferView,width:i.width,height:i.height,internalFormat:i.internalFormat}),n.images[r].extras._pipeline.source=i}}function ze(e,t){var r,i=e.gltf,n=i.images;J.texture(i,function(i,o){var a=i.source,s=n[a],l=s.extras,c=s.bufferView,d=s.mimeType;if(r=s.uri,u(l)&&u(l.compressedImage3DTiles)){var h=l.compressedImage3DTiles.crunch,p=l.compressedImage3DTiles.s3tc,f=l.compressedImage3DTiles.pvrtc1,m=l.compressedImage3DTiles.etc1;t.s3tc&&u(h)?(d=h.mimeType,u(h.bufferView)?c=h.bufferView:r=h.uri):t.s3tc&&u(p)?(d=p.mimeType,u(p.bufferView)?c=p.bufferView:r=p.uri):t.pvrtc&&u(f)?(d=f.mimeType,u(f.bufferView)?c=f.bufferView:r=f.uri):t.etc1&&u(m)&&(d=m.mimeType,u(m.bufferView)?c=m.bufferView:r=m.uri)}if(u(c))e._loadResources.texturesToCreateFromBufferView.enqueue({id:o,image:void 0,bufferView:c,mimeType:d});else{++e._loadResources.pendingTextureLoads,r=new ae(r);var g,v=b(e._baseUri,r);g=Mr.test(v)?E(v):Rr.test(v)?w(v):S(v),g.then(Ve(e,o,a)).otherwise(Me(e,"image",v))}})}function Ge(e){return u(e.matrix)?I.fromArray(e.matrix):I.fromTranslationQuaternionRotationScale(r.fromArray(e.translation,0,Lr),R.unpack(e.rotation,0,Nr),r.fromArray(e.scale,0,kr))}function He(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesIds;J.node(e.gltf,function(o,a){var s={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new I,computedMatrix:new I,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:o.jointName,weights:[],children:[],parents:[],publicNode:void 0};s.publicNode=new ye(e,o,s,a,Ge(o)),t[a]=s,r[o.name]=s,u(o.skin)&&(n.push(a),i.push(s))}),e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function We(e){var t={},r={},i=e._uniformMaps;J.material(e.gltf,function(n,o){i[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var a=new ve(e,n,o);t[n.name]=a,r[o]=a}),e._runtime.materialsByName=t,e._runtime.materialsById=r}function je(e){var t={},r=e._runtime.materialsById;J.mesh(e.gltf,function(i,n){if(t[i.name]=new _e(i,r,n),u(e.extensionsUsed.WEB3D_quantized_attributes))for(var o=i.primitives,a=o.length,s=0;s<a;s++){var l=o[s],c=$e(e,l),d=e._programPrimitives[c];u(d)||(d=[],e._programPrimitives[c]=d),d.push(l)}}),e._runtime.meshesByName=t}function qe(e){var t=e.gltf.extensionsUsed,r={};if(u(t))for(var i=t.length,n=0;n<i;n++){var o=t[n];r[o]=!0}return r}function Ye(e){var t=e.gltf.extensionsRequired,r={};if(u(t))for(var i=t.length,n=0;n<i;n++){var o=t[n];r[o]=!0}return r}function Xe(e,t,r){var i=t._loadResources,n=t.gltf.bufferViews,o=n[e],a=B.createVertexBuffer({context:r,typedArray:i.getBuffer(o),usage:U.STATIC_DRAW});a.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=a,t._geometryByteLength+=a.sizeInBytes}function Qe(e,t,r,i){var n=r._loadResources,o=r.gltf.bufferViews,a=o[e],s=B.createIndexBuffer({context:i,typedArray:n.getBuffer(a),usage:U.STATIC_DRAW,indexDatatype:t});s.vertexArrayDestroyable=!1,r._rendererResources.buffers[e]=s,r._geometryByteLength+=s.sizeInBytes}function Ze(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){var i,n=t.context,o=r.vertexBuffersToCreate,a=r.indexBuffersToCreate;if(e.asynchronous){for(;o.length>0&&(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;r<n;++r){var o=t[r];if(/pos/i.test(o)){t[r]=t[0],t[0]=o;break}}for(r=0;r<n;++r)i[t[r]]=r;return i}function Je(e,t,r){var i=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t,n){return i===t?e:r})}function $e(e,t){var r=e.gltf,i=t.material,n=r.materials[i],o=n.technique;return r.techniques[o].program}function et(e,t){var r=e.gltf,i=r.accessors[t],n=i.extensions;if(u(n))return n.WEB3D_quantized_attributes}function tt(e,t,r){var i=e.gltf,n=t.material,o=i.materials[n],a=o.technique,s=i.techniques[a];for(var l in s.parameters)if(s.parameters.hasOwnProperty(l)){var u=s.parameters[l].semantic;if(u===r){var c=s.attributes;for(var d in c)if(c.hasOwnProperty(d)){var h=c[d];if(h===l)return d}}}}function rt(e,t,r,i){var n={};r._quantizedUniforms[t]=n;for(var o=r._programPrimitives[t],a=0;a<o.length;a++){var s=o[a];if($e(r,s)===t)for(var l in s.attributes)if(s.attributes.hasOwnProperty(l)){var c=tt(r,s,l),d=s.attributes[l];"_"===l.charAt(0)&&(l=l.substring(1));var h="gltf_u_dec_"+l.toLowerCase(),p=h+"_scale",f=h+"_translate";if(!u(n[h])&&!u(n[p])){var m=et(r,d);if(u(m)){var g=m.decodeMatrix,v="gltf_decoded_"+l,_=c.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(g.length));e=Je(e,c,_);var b;b=y>2?"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;n<r;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=t[a];u(s)&&(i[a]=a);for(var l=s.children,c=l.length,d=0;d<c;++d)o.push(l[d])}return i}function mt(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var c=a[l],d=o[c],h=n[c],p=t[h.skin];d.inverseBindMatrices=p.inverseBindMatrices,d.bindShapeMatrix=p.bindShapeMatrix;var f=[],m=i[h.skin];u(m.skeleton)&&f.push(m.skeleton);for(var g=ft(f,n),v=i[h.skin].joints,_=v.length,y=0;y<_;++y){var b=v[y],C=g[b],w=o[C];d.joints.push(w)}}}function gt(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=r.accessors,n={};J.skin(r,function(t,r){var o,a=i[t.inverseBindMatrices];I.equals(t.bindShapeMatrix,I.IDENTITY)||(o=I.clone(t.bindShapeMatrix)),n[r]={inverseBindMatrices:me.getSkinInverseBindMatrices(e,a),bindShapeMatrix:o}}),mt(e,n)}}function vt(e,t,r,i){return function(n){u(i)&&(t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber)}}function _t(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations=[];for(var r=e._runtime.nodes,i=e.gltf.animations,n=e.gltf.accessors,o=i.length,a=0;a<o;++a){for(var s=i[a],l=s.channels,u=s.samplers,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=l.length,p=new Array(h),f=0;f<h;++f){var m=l[f],g=m.target,v=g.path,_=u[m.sampler],y=me.getAnimationParameterValues(e,n[_.input]),b=me.getAnimationParameterValues(e,n[_.output]);c=Math.min(c,y[0]),d=Math.max(d,y[y.length-1]);var C=me.getAnimationSpline(e,a,s,m.sampler,_,y,v,b);p[f]=vt(e,r[g.node],g.path,C)}e._runtime.animations[a]={name:s.name,startTime:c,stopTime:d,channelEvaluators:p}}}}function yt(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var l in s)if(s.hasOwnProperty(l))for(var c=s[l].primitives,d=c.length,h=0;h<d;++h){var p,f,m,g=c[h],v=pt(e,g),_=[],y=g.attributes;for(p in y)if(y.hasOwnProperty(p)&&(f=v[p],u(f))){var b=a[y[p]],C=!1;u(b.normalized)&&b.normalized&&(C=!0),_.push({index:f,vertexBuffer:i[b.bufferView],componentsPerAttribute:ee(b.type),componentDatatype:b.componentType,
  474. normalize:C,offsetInBytes:b.byteOffset,strideInBytes:$(o,b)})}var w=e._precreatedAttributes;if(u(w))for(p in w)w.hasOwnProperty(p)&&(f=v[p],u(f)&&(m=w[p],m.index=f,_.push(m)));var S;if(u(g.indices)){var T=a[g.indices];S=i[T.bufferView]}n[l+".primitive."+h]=new Q({context:t,attributes:_,indexBuffer:S})}}}function bt(e){var t={};t[F.BLEND]=!1,t[F.CULL_FACE]=!1,t[F.DEPTH_TEST]=!1,t[F.POLYGON_OFFSET_FILL]=!1;var r,i=e.enable,n=i.length;for(r=0;r<n;++r)t[i[r]]=!0;return t}function Ct(e,t){var r=e._loadResources,i=e.gltf.techniques;if(r.createRenderStates){r.createRenderStates=!1;for(var n in i)i.hasOwnProperty(n)&&wt(e,n,t)}}function wt(e,t,r){var i=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=bt(a),c=l(a.functions,l.EMPTY_OBJECT),d=l(c.blendColor,[0,0,0,0]),h=l(c.blendEquationSeparate,[F.FUNC_ADD,F.FUNC_ADD]),p=l(c.blendFuncSeparate,[F.ONE,F.ZERO,F.ONE,F.ZERO]),f=l(c.colorMask,[!0,!0,!0,!0]),m=l(c.depthRange,[0,1]),g=l(c.polygonOffset,[0,0]);s[F.BLEND]&&it(e)&&p[0]===F.ONE&&p[1]===F.ONE_MINUS_SRC_ALPHA&&(p[0]=F.SRC_ALPHA,p[1]=F.ONE_MINUS_SRC_ALPHA,p[2]=F.SRC_ALPHA,p[3]=F.ONE_MINUS_SRC_ALPHA),i[t]=G.fromCache({frontFace:u(c.frontFace)?c.frontFace[0]:F.CCW,cull:{enabled:s[F.CULL_FACE],face:u(c.cullFace)?c.cullFace[0]:F.BACK},lineWidth:u(c.lineWidth)?c.lineWidth[0]:1,polygonOffset:{enabled:s[F.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},depthRange:{near:m[0],far:m[1]},depthTest:{enabled:s[F.DEPTH_TEST],func:u(c.depthFunc)?c.depthFunc[0]:F.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:!u(c.depthMask)||c.depthMask[0],blending:{enabled:s[F.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:h[0],equationAlpha:h[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function St(e,t){var r={value:e,clone:function(e,t){return e},func:function(){return r.value}};return r}function Tt(e,r){var i={value:t.fromArray(e),clone:t.clone,func:function(){return i.value}};return i}function Et(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function xt(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function Pt(e,t){var r={value:A.fromColumnMajorArray(e),clone:A.clone,func:function(){return r.value}};return r}function At(e,t){var r={value:D.fromColumnMajorArray(e),clone:D.clone,func:function(){return r.value}};return r}function Dt(e,t){var r={value:I.fromColumnMajorArray(e),clone:I.clone,func:function(){return r.value}};return r}function It(e,t){this._value=void 0,this._textureId=e.index,this._model=t}function Ot(e,t){var r=new It(e,t);return r.func=function(){return r.value},r}function Mt(e,t,r,i){var n=t._runtime.nodes[e];return Xr[r](i,t,n)}function Rt(e,t){var r=e._loadResources;if(r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,o=i.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var l,c=n[s];l=c.values;var d,h,p=o[c.technique],f=p.parameters,m=p.uniforms,g={},v={};for(var _ in m)if(m.hasOwnProperty(_)&&"extras"!==_){var y=m[_],b=f[y];if(u(l[y])){var C=Yr[b.type](l[y],e);g[_]=C.func,v[y]=C}else if(u(b.node))g[_]=Mt(b.node,e,b.semantic,t.uniformState);else if(u(b.semantic))"JOINTMATRIX"===b.semantic?d=_:"MORPHWEIGHTS"===b.semantic?h=_:g[_]=qr[b.semantic](t.uniformState,e);else if(u(b.value)){var w=Yr[b.type](b.value,e);g[_]=w.func,v[y]=w}}var S=a[s];S.uniformMap=g,S.values=v,S.jointMatrixUniformName=d,S.morphWeightsUniformName=h}}}function Lt(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function Nt(e){return[e[20],e[21],e[22],e[23]]}function kt(e,t,r){var i=e.gltf,n=i.accessors,o=$e(e,t),a=e._quantizedUniforms[o],s={},l={};for(var c in t.attributes)if(t.attributes.hasOwnProperty(c)){var d=t.attributes[c],h=n[d],p=h.extensions;if("_"===c.charAt(0)&&(c=c.substring(1)),u(p)){var f=p.WEB3D_quantized_attributes;if(u(f)){var m=f.decodeMatrix,g="gltf_u_dec_"+c.toLowerCase();switch(h.type){case le.SCALAR:l[g]=Pt(m,e).func,s[g]=!0;break;case le.VEC2:l[g]=At(m,e).func,s[g]=!0;break;case le.VEC3:l[g]=Dt(m,e).func,s[g]=!0;break;case le.VEC4:var v=g+"_scale",_=g+"_translate";l[v]=Dt(Lt(m),e).func,l[_]=xt(Nt(m),e).func,s[v]=!0,s[_]=!0}}}}for(var y in a)if(a.hasOwnProperty(y)&&!s[y]){var b=a[y];u(b.mat)&&(2===b.mat?l[y]=Pt(A.IDENTITY,e).func:3===b.mat?l[y]=At(D.IDENTITY,e).func:4===b.mat&&(l[y]=Dt(I.IDENTITY,e).func)),u(b.vec)&&4===b.vec&&(l[y]=xt([0,0,0,0],e).func)}return l}function Ft(e){return function(){return e}}function Bt(e){return function(){return e.computedJointMatrices}}function Ut(e){return function(){return e.weights}}function Vt(e){return function(){return e.silhouetteColor}}function zt(e){return function(){return e.silhouetteSize}}function Gt(e){return function(){return e.color}}function Ht(e){return function(){return de.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Wt(e,t){switch(e.mode){case M.TRIANGLES:return t/3;case M.TRIANGLE_STRIP:case M.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function jt(t,i,n,o,a){for(var l=t._nodeCommands,c=t._pickIds,d=t.allowPicking,h=t._runtime.meshesByName,p=t._rendererResources,f=p.vertexArrays,m=p.programs,g=p.pickPrograms,v=p.renderStates,_=t._uniformMaps,b=t.gltf,C=b.accessors,w=b.meshes,S=b.techniques,T=b.materials,E=i.mesh,x=w[E],P=x.primitives,A=P.length,D=0;D<A;++D){var O,M=P[D],R=C[M.indices],L=T[M.material],N=S[L.technique],k=N.program,F=M.attributes.POSITION;if(u(F)){var B=Ie(b,F);O=e.fromCornerPoints(r.fromArray(B.min),r.fromArray(B.max))}var U,G,H=f[E+".primitive."+D];if(u(R))G=R.count,U=R.byteOffset/y.getSizeInBytes(R.componentType);else{G=C[M.attributes.POSITION].count,U=0}t._trianglesLength+=Wt(M,G);var W=_[M.material],j=W.uniformMap;if(u(W.jointMatrixUniformName)){var q={};q[W.jointMatrixUniformName]=Bt(n),j=s(j,q)}if(u(W.morphWeightsUniformName)){var Y={};Y[W.morphWeightsUniformName]=Ut(n),j=s(j,Y)}if(j=s(j,{gltf_color:Gt(t),gltf_colorBlend:Ht(t)}),u(t._uniformMapLoaded)&&(j=t._uniformMapLoaded(j,k,n)),t.extensionsUsed.WEB3D_quantized_attributes){var X=kt(t,M,o);j=s(j,X)}var Q=v[L.technique],Z=Q.blending.enabled,K=t._pickObject;u(K)||(K={primitive:t,id:t.id,node:n.publicNode,mesh:h[x.name]});var J,$=Ce.castShadows(t._shadows),ee=Ce.receiveShadows(t._shadows),te=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new I,primitiveType:M.mode,vertexArray:H,count:G,offset:U,shaderProgram:m[N.program],castShadows:$,receiveShadows:ee,uniformMap:j,renderState:Q,owner:K,pass:Z?z.TRANSLUCENT:t.opaquePass});if(d){var re;if(u(t._pickFragmentShaderLoaded))re=u(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(j):s(j);else{var ie=o.createPickId(K);c.push(ie);var ne={czm_pickColor:Ft(ie.color)};re=s(j,ne)}J=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new I,primitiveType:M.mode,vertexArray:H,count:G,offset:U,shaderProgram:g[N.program],uniformMap:re,renderState:Q,owner:K,pass:Z?z.TRANSLUCENT:t.opaquePass})}var oe,ae;a||(oe=V.shallowClone(te),oe.boundingVolume=new e,oe.modelMatrix=new I,d&&(ae=V.shallowClone(J),ae.boundingVolume=new e,ae.modelMatrix=new I));var se={show:!0,boundingSphere:O,command:te,pickCommand:J,command2D:oe,pickCommand2D:ae,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(se),l.push(se)}}function qt(e,t,i){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,c=s.skins,d=s.scenes[s.scene],h=d.nodes,p=h.length,f=[],m={},g=0;g<p;++g){f.push({parentRuntimeNode:void 0,gltfNode:l[h[g]],id:h[g]});for(var v=[];f.length>0;){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;E<T;E++){var x=S[E];m[x]||f.push({parentRuntimeNode:C,gltfNode:l[x],id:S[E]})}var P=b.skin;if(u(P)&&v.push(c[P].skeleton),0===f.length)for(var A=0;A<v.length;A++){var D=v[A];m[D]||f.push({parentRuntimeNode:void 0,gltfNode:l[D],id:D})}}}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Yt(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function Xt(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function Qt(e,t){var r=t.context,i=t.scene3DOnly;if(br(e,r),e._loadRendererResourcesFromCache){var n=e._rendererResources,o=e._cachedRendererResources;n.buffers=o.buffers,n.vertexArrays=o.vertexArrays,n.programs=o.programs,n.pickPrograms=o.pickPrograms,n.silhouettePrograms=o.silhouettePrograms,n.textures=o.textures,n.samplers=o.samplers,n.renderStates=o.renderStates,u(e._precreatedAttributes)&&yt(e,r),e._cachedGeometryByteLength+=Yt(o.buffers),e._cachedTexturesByteLength+=Xt(o.textures)}else Ze(e,t),st(e,t),ct(e,r),ut(e),ht(e,t);gt(e),_t(e),e._loadRendererResourcesFromCache||(yt(e,r),Ct(e,r)),Rt(e,r),qt(e,r,i)}function Zt(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&u(i)?I.clone(i,t):u(e.matrix)?I.clone(e.matrix,t):(I.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),r.setMatrix(t))}function Kt(t,n,o,a){var s=t._maxDirtyNumber,l=t.allowPicking,c=t._runtime.rootNodes,d=c.length,h=Qr,p=t._computedModelMatrix;if(t._mode!==be.SCENE3D&&!t._ignoreCommands){var f=I.getColumn(p,3,Zr);if(i.equals(f,i.UNIT_W)){var m=t.boundingSphere.center,g=k.wgs84To2DModelMatrix(a,m,Kr);p=I.multiply(g,p,Kr),u(t._rtcCenter)&&(I.setTranslation(p,i.UNIT_W,p),t._rtcCenter=t._rtcCenter2D)}else p=k.basisTo2D(a,p,Kr),t._rtcCenter=t._rtcCenter3D}for(var v=0;v<d;++v){var _=c[v];for(Zt(_,_.transformToRoot),h.push(_);h.length>0;){_=h.pop();var y=_.transformToRoot,b=_.commands;if(_.dirtyNumber===s||n||o){var C=I.multiplyTransformation(p,y,_.computedMatrix),w=b.length;if(w>0)for(var S=0;S<w;++S){var T=b[S],E=T.command;if(I.clone(C,E.modelMatrix),e.transform(T.boundingSphere,E.modelMatrix,E.boundingVolume),u(t._rtcCenter)&&r.add(t._rtcCenter,E.boundingVolume.center,E.boundingVolume.center),l){var x=T.pickCommand;I.clone(E.modelMatrix,x.modelMatrix),e.clone(E.boundingVolume,x.boundingVolume)}if(E=T.command2D,u(E)&&t._mode===be.SCENE2D&&(I.clone(C,E.modelMatrix),E.modelMatrix[13]-=2*P.sign(E.modelMatrix[13])*P.PI*a.ellipsoid.maximumRadius,e.transform(T.boundingSphere,E.modelMatrix,E.boundingVolume),l)){var A=T.pickCommand2D;I.clone(E.modelMatrix,A.modelMatrix),e.clone(E.boundingVolume,A.boundingVolume)}}}for(var D=_.children,O=D.length,M=0;M<O;++M){var R=D[M];R.dirtyNumber=Math.max(R.dirtyNumber,_.dirtyNumber),(R.dirtyNumber===s||o)&&(Zt(R,R.transformToRoot),I.multiplyTransformation(y,R.transformToRoot,R.transformToRoot)),h.push(R)}}}++t._maxDirtyNumber}function Jt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;i<r;++i){var n=t[i];Jr=I.inverseTransformation(n.transformToRoot,Jr);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,d=0;d<c;++d)u(o[d])||(o[d]=new I),o[d]=I.multiplyTransformation(Jr,a[d].transformToRoot,o[d]),o[d]=I.multiplyTransformation(o[d],l[d],o[d]),u(s)&&(o[d]=I.multiplyTransformation(o[d],s,o[d]))}}function $t(e){for(var t=e._runtime.rootNodes,r=t.length,i=Qr,n=0;n<r;++n){var o=t[n];for(o.computedShow=o.publicNode.show,i.push(o);i.length>0;){o=i.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;for(var c=o.children,d=c.length,h=0;h<d;++h){var p=c[h];p.computedShow=a&&p.publicNode.show,i.push(p)}}}}function er(e,t){var r=e.id;if(e._id!==r){e._id=r;for(var i=e._pickIds,n=i.length,o=0;o<n;++o)i[o].object.id=r}}function tr(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?M.LINES:M.TRIANGLES,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.primitiveType=t}}function rr(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.debugShowBoundingVolume=t}}function ir(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=Ce.castShadows(e.shadows),r=Ce.receiveShadows(e.shadows),i=e._nodeCommands,n=i.length,o=0;o<n;o++){var a=i[o];a.command.castShadows=t,a.command.receiveShadows=r}}}function nr(e){var t=o(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ce.ALPHA_BLEND,G.fromCache(t)}function or(e){var t=V.shallowClone(e);return t.pass=z.TRANSLUCENT,t.renderState=nr(e.renderState),t}function ar(e,t){var r=t.scene3DOnly,i=e.color.alpha;if(i>0&&i<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=or(l),!r){var c=s.command2D;s.translucentCommand2D=or(c)}}}}function sr(e,t){var r=e._rendererResources.programs;for(var i in r)if(r.hasOwnProperty(i)&&r[i]===t)return i}function lr(e,t,r){var i=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;i=j.replaceMain(i,"gltf_silhouette_main"),i+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+o+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n gl_Position = clip; \n}";return W.fromCache({context:r.context,vertexShaderSource:i,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = gltf_silhouetteColor; \n}",attributeLocations:n})}function ur(e,t){return xe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function cr(e){for(var t=e._nodeCommands,r=t.length,i=0;i<r;++i){if(t[i].command.pass===z.TRANSLUCENT)return!0}return!1}function dr(e){return e.color.alpha>0&&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<c;++d){var h=l[d],p=h.command,f=dr(e)?h.translucentCommand:p,m=V.shallowClone(f),g=o(f.renderState);g.stencilTest={enabled:!0,frontFunction:F.ALWAYS,backFunction:F.ALWAYS,reference:r,mask:-1,frontOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.REPLACE},backOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.REPLACE}},hr(e)&&(g.colorMask={red:!1,green:!1,blue:!1,alpha:!1},g.depthMask=!1),g=G.fromCache(g),m.renderState=g,h.silhouetteModelCommand=m;var v=V.shallowClone(p);g=o(p.renderState,!0),g.depthTest.enabled=!0,g.cull.enabled=!1,i&&(v.pass=z.TRANSLUCENT,g.depthMask=!1,g.blending=ce.ALPHA_BLEND),g.stencilTest={enabled:!0,frontFunction:F.NOTEQUAL,backFunction:F.NOTEQUAL,reference:r,mask:-1,frontOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.KEEP},backOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.KEEP}},g=G.fromCache(g);var _=p.shaderProgram,y=sr(e,_),b=n[y];u(b)||(b=lr(e,_,t),n[y]=b);var C=s(p.uniformMap,{gltf_silhouetteColor:Vt(e),gltf_silhouetteSize:zt(e)});if(v.renderState=g,v.shaderProgram=b,v.uniformMap=C,v.castShadows=!1,v.receiveShadows=!1,h.silhouetteColorCommand=v,!a){var w=h.command2D,S=V.shallowClone(m);S.boundingVolume=w.boundingVolume,S.modelMatrix=w.modelMatrix,h.silhouetteModelCommand2D=S;var T=V.shallowClone(v);S.boundingVolume=w.boundingVolume,S.modelMatrix=w.modelMatrix,h.silhouetteColorCommand2D=T}}}function mr(e,t){if(ur(e,t)){var r=e._nodeCommands,i=pr(e.color.alpha,e._colorPreviousAlpha)||pr(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!u(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,i&&fr(e,t)}}function gr(e,t,r){return ei.center=e,ei.radius=t,r.camera.getPixelSize(ei,r.context.drawingBufferWidth,r.context.drawingBufferHeight)}function vr(e,t){var i=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(ti.x=a[12],ti.y=a[13],ti.z=a[14],u(e._rtcCenter)&&r.add(e._rtcCenter,ti,ti),e._mode!==be.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(ti,ri);s.project(l,ti),r.fromElements(ti.z,ti.x,ti.y,ti)}var c=e.boundingSphere.radius,d=gr(ti,c,t),h=1/d;Math.min(h*(2*c),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*d/(2*e._initialRadius))}return u(e.maximumScale)?Math.min(e.maximumScale,i):i}function _r(e){u(e._cacheKey)&&u(e._cachedGltf)&&0==--e._cachedGltf.count&&delete Dr[e._cacheKey],e._cachedGltf=void 0}function yr(e){var t=e.extensionsRequired;for(var r in t)if(t.hasOwnProperty(r)&&"CESIUM_RTC"!==r&&"KHR_technique_webgl"!==r&&"KHR_binary_glTF"!==r&&"KHR_materials_common"!==r&&"WEB3D_quantized_attributes"!==r)throw new N("Unsupported glTF Extension: "+r)}function br(e,t){var r=e.gltf.glExtensionsUsed;if(u(r))for(var i=r.length,n=0;n<i;n++){var o=r[n];if("OES_element_index_uint"!==o)throw new N("Unsupported WebGL Extension: "+o);if(!t.elementIndexUint)throw new N("OES_element_index_uint WebGL extension is not enabled.")}}function Cr(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function wr(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function Sr(e){wr(e.buffers),wr(e.vertexArrays),wr(e.programs),wr(e.pickPrograms),wr(e.silhouettePrograms),wr(e.textures)}function Tr(e,t,r){return function(i){if(e.heightReference===pe.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(i,ri);n.height+=r.height,t.cartographicToCartesian(n,i)}var o=e._clampedModelMatrix;I.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function Er(e){u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!u(t)||e.heightReference===pe.NONE)return void(e._clampedModelMatrix=void 0);var r=t.globe,i=r.ellipsoid,o=e.modelMatrix;ti.x=o[12],ti.y=o[13],ti.z=o[14];var a=i.cartesianToCartographic(ti);u(e._clampedModelMatrix)||(e._clampedModelMatrix=I.clone(o,new I));var s=r._surface;e._removeUpdateHeightCallback=s.updateHeight(a,Tr(e,i,a));var l=r.getHeight(a);if(u(l)){var c=Tr(e,i,a);n.clone(a,ri),ri.height=l,i.cartographicToCartesian(ri,ti),c(ti)}}function xr(e,t){var i,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===be.SCENE2D){i=.5*(t.camera.frustum.right-t.camera.frustum.left),i*=i}else{var s=I.getTranslation(e.modelMatrix,ii);if(t.mode===be.COLUMBUS_VIEW){var l=t.mapProjection,u=l.ellipsoid,c=u.cartesianToCartographic(s,ni);s=l.project(c,s),r.fromElements(s.z,s.x,s.y,s)}i=r.distanceSquared(s,t.camera.positionWC)}return i>=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;i<r;++i){var n=t[i];n.isDestroyed()||Se(n,this)}this.modelsToLoad=void 0,this.ready=!0};var Dr={};c(Ee.prototype,{gltf:{get:function(){return u(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==pe.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=I.getScale(e,Pr),i=u(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;r.multiplyByScalar(t,i,t);var n=this._scaledBoundingSphere;return n.center=r.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=r.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&r.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return u(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=p.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return u(this._extensionsUsed)||(this._extensionsUsed=qe(this)),this._extensionsUsed}},extensionsRequired:{get:function(){return u(this._extensionsRequired)||(this._extensionsRequired=Ye(this)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}}}),Ee.silhouetteSupported=function(e){return xe(e.context)},Ee.fromGltf=function(e){var t=e.url,r=l(e.cacheKey,m(t)),i=l(e.basePath,g(t,!0));e=o(e),u(e.basePath)&&!u(e.cacheKey)&&(r+=i),e.cacheKey=r,e.basePath=i;var n=new Ee(e);e.headers=u(e.headers)?o(e.headers):{},u(e.headers.Accept)||(e.headers.Accept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01");var a=Dr[r];return u(a)?a.ready||(++a.count,a.modelsToLoad.push(n)):(a=new Te({ready:!1}),a.count=1,a.modelsToLoad.push(n),Se(n,a),Dr[r]=a,C(t,e.headers).then(function(e){var t=new Uint8Array(e);if(Ae(t)){var r=te(t);a.makeReady(r,t)}else{var i=_(t);a.makeReady(JSON.parse(i))}}).otherwise(Me(n,"model",t))),n},Ee._gltfCache=Dr,Ee.prototype.getNode=function(e){var t=De(this,"nodesByName",e);return u(t)?t.publicNode:void 0},Ee.prototype.getMesh=function(e){return De(this,"meshesByName",e)},Ee.prototype.getMaterial=function(e){return De(this,"materialsByName",e)};var Ir=new r,Or=new r,Mr=/(^data:image\/ktx)|(\.ktx$)/i,Rr=/(^data:image\/crn)|(\.crn$)/i,Lr=new r,Nr=new R,kr=new r,Fr=function(){this.id=void 0,this.model=void 0,this.context=void 0};Fr.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},Fr.prototype.execute=function(){Xe(this.id,this.model,this.context)};var Br=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};Br.prototype.set=function(e,t,r,i){this.id=e,this.componentType=t,this.model=r,this.context=i},Br.prototype.execute=function(){Qe(this.id,this.componentType,this.model,this.context)};var Ur=new Fr,Vr=new Br,zr=function(){this.id=void 0,this.model=void 0,this.context=void 0};zr.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},zr.prototype.execute=function(){at(this.id,this.model,this.context)};var Gr=new zr,Hr=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};Hr.prototype.set=function(e,t,r){this.gltfTexture=e,this.model=t,this.context=r},Hr.prototype.execute=function(){dt(this.gltfTexture,this.model,this.context)};var Wr=new Hr,jr=new r,qr={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var i=new I;return function(){return u(t._rtcCenter)?(I.getTranslation(e.model,jr),r.add(jr,t._rtcCenter,jr),I.multiplyByPoint(e.view,jr,jr),I.setTranslation(e.modelView,jr,i)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};c(It.prototype,{value:{get:function(){if(!u(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!u(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),It.prototype.clone=function(e,t){return e},It.prototype.func=void 0;var Yr={};Yr[F.FLOAT]=St,Yr[F.FLOAT_VEC2]=Tt,Yr[F.FLOAT_VEC3]=Et,Yr[F.FLOAT_VEC4]=xt,Yr[F.INT]=St,Yr[F.INT_VEC2]=Tt,Yr[F.INT_VEC3]=Et,Yr[F.INT_VEC4]=xt,Yr[F.BOOL]=St,Yr[F.BOOL_VEC2]=Tt,Yr[F.BOOL_VEC3]=Et,Yr[F.BOOL_VEC4]=xt,Yr[F.FLOAT_MAT2]=Pt,Yr[F.FLOAT_MAT3]=At,Yr[F.FLOAT_MAT4]=Dt,Yr[F.SAMPLER_2D]=Ot;var Xr={MODEL:function(e,t,r){return function(){return r.computedMatrix}},VIEW:function(e,t,r){return function(){return e.view}},PROJECTION:function(e,t,r){return function(){return e.projection}},MODELVIEW:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,r){var i=new I;return function(){return I.inverse(r.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,r){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,r){var i=new I,n=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.inverse(i,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,r){var i=new I,n=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.multiply(e._projection,i,i),I.inverse(i,n)}},MODELINVERSETRANSPOSE:function(e,t,r){var i=new I,n=new D;return function(){return I.inverse(r.computedMatrix,i),I.getRotation(i,n),D.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,r){var i=new I,n=new I,o=new D;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.inverse(i,n),I.getRotation(n,o),D.transpose(o,o)}},VIEWPORT:function(e,t,r){return function(){return e.viewportCartesian4}}},Qr=[],Zr=new i,Kr=new I,Jr=new I,$r=0,ei=new e,ti=new r,ri=new n;Cr.prototype.release=function(){if(0==--this.count)return u(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Sr(this),d(this)};var ii=new r,ni=new n;return Ee.prototype.update=function(e){if(e.mode!==be.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===Ar.NEEDS_LOAD&&u(this.gltf)){var i,n=this.cacheKey;if(u(n)){t.cache.modelRendererResourceCache=l(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(i=o[this.cacheKey],u(i)){if(!i.ready)return;++i.count,this._loadRendererResourcesFromCache=!0}else i=new Cr(t,n),i.count=1,o[this.cacheKey]=i;this._cachedRendererResources=i}else i=new Cr(t),i.count=1,this._cachedRendererResources=i;if(this._state=Ar.LOADING,this._state!==Ar.FAILED){var a=this.gltf.extensions;if(u(a)&&u(a.CESIUM_RTC)){var s=r.fromArray(a.CESIUM_RTC.center);if(!r.equals(s,r.ZERO)){this._rtcCenter3D=s;var c=e.mapProjection,d=c.ellipsoid,h=d.cartesianToCartographic(this._rtcCenter3D),p=c.project(h);r.fromElements(p.z,p.x,p.y,p),this._rtcCenter2D=p,this._rtcCenterEye=new r,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new we,this._loadRendererResourcesFromCache||Ne(this)}}var f=this._loadResources,m=this._incrementallyLoadTextures,g=!1;if(this._state===Ar.LOADING){if(0===f.pendingBufferLoads){if(!this._updatedGltfVersion){var v={optimizeForCesium:!0,addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};e.brdfLutGenerator.update(e),oe(this.gltf),yr(this),K(this.gltf),Z(this.gltf),re(this.gltf,v),ie(this.gltf,v),Re(this),this._loadRendererResourcesFromCache||(ke(this),Be(this),Ue(this),ze(this,t)),We(this),je(this),He(this),this._boundingSphere=Oe(this),this._initialRadius=this._boundingSphere.radius,this._updatedGltfVersion=!0}this._updatedGltfVersion&&0===f.pendingShaderLoads&&Qt(this,e)}(f.finished()||m&&f.finishedEverythingButTextureCreation())&&(this._state=Ar.LOADED,g=!0)}if(u(f)&&this._state===Ar.LOADED&&(m&&!g&&Qt(this,e),f.finished())){this._loadResources=void 0;var _=this._rendererResources,y=this._cachedRendererResources;y.buffers=_.buffers,y.vertexArrays=_.vertexArrays,y.programs=_.programs,y.pickPrograms=_.pickPrograms,y.silhouettePrograms=_.silhouettePrograms,y.textures=_.textures,y.samplers=_.samplers,y.renderStates=_.renderStates,y.ready=!0,this._normalAttributeName=he(this.gltf,"NORMAL"),u(this._precreatedAttributes)&&(y.vertexArrays={}),this.releaseGltfJson&&_r(this)}var b=ur(this,e),C=dr(this),w=hr(this),S=!u(this.distanceDisplayCondition)||xr(this,e),T=this.show&&S&&0!==this.scale&&(!w||b);if(T&&this._state===Ar.LOADED||g){var E=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var x=this.modelMatrix,A=e.mode!==this._mode;this._mode=e.mode;var D=!I.equals(this._modelMatrix,x)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||A;if(D||g){I.clone(x,this._modelMatrix),Er(this),u(this._clampedModelMatrix)&&(x=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var O=vr(this,e),M=this._computedModelMatrix;I.multiplyByUniformScale(x,O,M),this._upAxis===ue.Y?I.multiplyTransformation(M,ue.Y_UP_TO_Z_UP,M):this._upAxis===ue.X&&I.multiplyTransformation(M,ue.X_UP_TO_Z_UP,M)}(E||D||g)&&(Kt(this,D,g,e.mapProjection),this._dirty=!0,(E||g)&&Jt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,$t(this)),er(this,t),tr(this),rr(this),ir(this),ar(this,e),mr(this,e)}if(g){var R=this;return void e.afterRender.push(function(){R._ready=!0,R._readyPromise.resolve(R)})}
  475. if(T&&!this._ignoreCommands){var L,N,k,F=e.commandList,B=e.passes,U=this._nodeCommands,V=U.length,z=e.mapProjection.ellipsoid.maximumRadius*P.PI;if(B.render){for(L=0;L<V;++L)if(N=U[L],N.show){var G=C?N.translucentCommand:N.command;if(G=b?N.silhouetteModelCommand:G,F.push(G),k=N.command.boundingVolume,e.mode===be.SCENE2D&&(k.center.y+k.radius>z||k.center.y-k.radius<z)){var H=C?N.translucentCommand2D:N.command2D;H=b?N.silhouetteModelCommand2D:H,F.push(H)}}if(b)for(L=0;L<V;++L)N=U[L],N.show&&(F.push(N.silhouetteColorCommand),k=N.command.boundingVolume,e.mode===be.SCENE2D&&(k.center.y+k.radius>z||k.center.y-k.radius<z)&&F.push(N.silhouetteColorCommand2D))}if(B.pick&&this.allowPicking)for(L=0;L<V;++L)if(N=U[L],N.show){var W=N.pickCommand;F.push(W),k=W.boundingVolume,e.mode===be.SCENE2D&&(k.center.y+k.radius>z||k.center.y-k.radius<z)&&F.push(N.pickCommand2D)}}}},Ee.prototype.isDestroyed=function(){return!1},Ee.prototype.destroy=function(){u(this._precreatedAttributes)&&wr(this._rendererResources.vertexArrays),u(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),u(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,r=0;r<t;++r)e[r].destroy();return _r(this),d(this)},Ee}),define("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,r){r.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=r,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(r,r.values,[],[])}function m(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function g(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function v(e){console.error(e)}var _=d.ENABLED,y=l.NONE,b=r.RED,C=r.WHITE,w=s.HIGHLIGHT,S=new a,T=new a;return f.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,o=0,s=t.length;o<s;o++){var l,d,h=t[o],f=h._model,m=r[h.id],g=h.isShowing&&h.isAvailable(e)&&p.getValueOrDefault(f._show,e,!0);if(g&&(d=h.computeModelMatrix(e,S),l=p.getValueOrUndefined(f._uri,e),g=i(d)&&i(l)),g){var E=i(m)?m.modelPrimitive:void 0;if(i(E)&&l===m.uri||(i(E)&&(n.removeAndDestroy(E),delete r[h.id]),E=u.fromGltf({url:l,incrementallyLoadTextures:p.getValueOrDefault(f._incrementallyLoadTextures,e,!0),scene:this._scene}),E.readyPromise.otherwise(v),E.id=h,n.add(E),m={modelPrimitive:E,uri:l,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[h.id]=m),E.show=!0,E.scale=p.getValueOrDefault(f._scale,e,1),E.minimumPixelSize=p.getValueOrDefault(f._minimumPixelSize,e,0),E.maximumScale=p.getValueOrUndefined(f._maximumScale,e),E.modelMatrix=a.clone(d,E.modelMatrix),E.shadows=p.getValueOrDefault(f._shadows,e,_),E.heightReference=p.getValueOrDefault(f._heightReference,e,y),E.distanceDisplayCondition=p.getValueOrUndefined(f._distanceDisplayCondition,e),E.silhouetteColor=p.getValueOrDefault(f._silhouetteColor,e,b,E._silhouetteColor),E.silhouetteSize=p.getValueOrDefault(f._silhouetteSize,e,0),E.color=p.getValueOrDefault(f._color,e,C,E._color),E.colorBlendMode=p.getValueOrDefault(f._colorBlendMode,e,w),E.colorBlendAmount=p.getValueOrDefault(f._colorBlendAmount,e,.5),E.ready){var x=p.getValueOrDefault(f._runAnimations,e,!0);m.animationsRunning!==x&&(x?E.activeAnimations.addAll({loop:c.REPEAT}):E.activeAnimations.removeAll(),m.animationsRunning=x);var P=p.getValueOrUndefined(f._nodeTransformations,e,m.nodeTransformationsScratch);if(i(P))for(var A=m.originalNodeMatrixHash,D=Object.keys(P),I=0,O=D.length;I<O;++I){var M=D[I],R=P[M];if(i(R)){var L=E.getNode(M);if(i(L)){var N=A[M];i(N)||(N=L.matrix.clone(),A[M]=N);var k=a.fromTranslationRotationScale(R,T);L.matrix=a.multiply(N,k,k)}}}}}else i(m)&&(m.modelPrimitive.show=!1)}return!0},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,r=this._primitives,i=e.length-1;i>-1;i--)m(this,e[i],t,r);return n(this)},f.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return h.FAILED;var o=n.modelPrimitive;if(!i(o)||!o.show)return h.FAILED;if(!o.ready)return h.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,r);else{if(!i(o._clampedModelMatrix))return h.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,r)}return h.DONE},f.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(g(a,l),s.set(a.id,a)):(m(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],m(this,a,l,u),s.remove(a.id)},f}),define("Shaders/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;s<a;++s)if(i[s]!==this._segments.lengths[s]){p(this,_);break}},h.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},h.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<b-1;++t)e[t]=0},h.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},h}),define("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Core/RuntimeError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M,R,L,N,k){"use strict";function F(e){e=s(e,s.EMPTY_OBJECT),this.modelMatrix=g.clone(s(e.modelMatrix,g.IDENTITY)),this._modelMatrix=g.clone(g.IDENTITY),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(oe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:b.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1}function B(e,t){l(e._batchTable)&&e._batchTable.destroy();var r=[{functionName:"batchTable_getWidthAndShow",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:a.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:a.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:a.FLOAT,componentsPerAttribute:2}];e._batchTable=new M(t,r,e._polylines.length)}function U(t,r,i,n,o){for(var a=r.context,s=r.commandList,u=i.length,c=0,d=!0,h=t._vertexArrays,p=t.debugShowBoundingVolume,f=t._batchTable,m=f.getUniformMapCallback(),g=h.length,v=0;v<g;++v)for(var _=h[v],y=_.buckets,b=y.length,C=0;C<b;++C){for(var T,E,x,P=y[C],A=P.offset,D=o?P.bucket.shaderProgram:P.bucket.pickShaderProgram,I=P.bucket.polylines,O=I.length,M=0,R=0;R<O;++R){var L=I[R],N=H(L._material);if(N!==T){if(l(T)&&M>0){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;V<U;++V){var z=B[V];z.locator===P&&(M+=z.count)}var G;r.mode===k.SCENE3D?G=L._boundingVolumeWC:r.mode===k.COLUMBUS_VIEW?G=L._boundingVolume2D:r.mode===k.SCENE2D?l(L._boundingVolume2D)&&(G=e.clone(L._boundingVolume2D,de),G.center.x=0):l(L._boundingVolumeWC)&&l(L._boundingVolume2D)&&(G=e.union(L._boundingVolumeWC,L._boundingVolume2D,de)),d?(d=!1,e.clone(G,ce)):e.union(G,ce,ce)}l(T)&&M>0&&(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;N<L;++N)if(s=o[N],s.length>0){var F=new Uint16Array(s),B=y.createIndexBuffer({context:t,typedArray:F,usage:b.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});R+=c[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;n<r;++n){var o=t[n];pe[i]=o,pe[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(pe,G)}function W(e){for(var t=e._mode,r=e._modelMatrix,i=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var u=s.material,c=i[u.type];l(c)||(c=i[u.type]=new 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;i<r;++i){var o=e._polylines[i];l(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function Y(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)if(l(t[i])){var n=t[i]._bucket;l(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function X(e){for(var t=e._vertexArrays.length,r=0;r<t;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function Q(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)l(t[i])&&t[i]._destroy()}function Z(e,t,r){this.count=e,this.offset=t,this.bucket=r}function K(e,t,r){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=r}function J(e){return r.dot(r.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===f.INTERSECTING}var $=N.SHOW_INDEX,ee=N.WIDTH_INDEX,te=N.POSITION_INDEX,re=N.MATERIAL_INDEX,ie=N.POSITION_SIZE_INDEX,ne=N.DISTANCE_DISPLAY_CONDITION,oe=N.NUMBER_OF_PROPERTIES,ae={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};u(F.prototype,{length:{get:function(){return q(this),this._polylines.length}}}),F.prototype.add=function(e){var t=new N(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},F.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},F.prototype.removeAll=function(){Y(this),Q(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},F.prototype.contains=function(e){return l(e)&&e._polylineCollection===this},F.prototype.get=function(e){return q(this),this._polylines[e]};var se=new h,le=new i,ue=new t;F.prototype.update=function(e){if(q(this),0!==this._polylines.length){j(this,e);var r,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===C.maximumVertexTextureImageUnits)throw new _("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");B(this,n),this._createBatchTable=!1}if(this._createVertexArray||V(this))z(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==k.SCENE3D)for(var u=s.length,c=0;c<u;++c)r=s[c],r.update();if(a[ie]||a[re])z(this,n,o);else for(var d=s.length,p=this._polylineBuckets,f=0;f<d;++f){r=s[f],a=r._propertiesChanged;var m=r._bucket,v=0;for(var y in p)if(p.hasOwnProperty(y)){if(p[y]===m){a[te]&&m.writeUpdate(v,r,this._positionBuffer,o);break}v+=p[y].lengthOfPositions}if((a[$]||a[ee])&&this._batchTable.setBatchedAttribute(r._index,0,new t(r._width,r._show)),this._batchTable.attributes.length>2){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;P<oe;++P)a[P]=0;var A=g.IDENTITY;e.mode===k.SCENE3D&&(A=this.modelMatrix);var D=e.passes,I=0!==e.morphTime;if(l(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===I||(this._opaqueRS=T.fromCache({depthMask:I,depthTest:{enabled:I}})),l(this._translucentRS)&&this._translucentRS.depthTest.enabled===I||(this._translucentRS=T.fromCache({blending:R.ALPHA_BLEND,depthMask:!I,depthTest:{enabled:I}})),this._batchTable.update(e),D.render){U(this,e,this._colorCommands,A,!0)}if(D.pick){U(this,e,this._pickCommands,A,!1)}}};var ce=new e,de=new e;F.prototype.isDestroyed=function(){return!1},F.prototype.destroy=function(){return X(this),Y(this),Q(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)};var he=[0,0,0],pe=[];F.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},K.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},K.prototype.updateShader=function(e,t){if(!l(this.shaderProgram)){var r=["DISTANCE_DISPLAY_CONDITION"],i=new x({sources:[this.material.shaderSource,I]});-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&r.push("POLYLINE_DASH");var n=t.getVertexShaderCallback()(O),o=new x({defines:r,sources:[D,n]}),a=new x({sources:i.sources,pickColorQualifier:"varying"});this.shaderProgram=E.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:i,attributeLocations:ae}),this.pickShaderProgram=E.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:ae})}},K.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===k.SCENE3D||!J(e))return 4*(t=e._actualPositions.length)-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;n<t;++n)r+=4*i[n]-4;return r};var fe=new r,me=new r,ge=new r,ve=new r,_e=new i,ye=new t;K.prototype.write=function(e,t,n,a,s,u,c,d){for(var p=this.mode,f=d.ellipsoid.maximumRadius*m.PI,g=this.polylines,v=g.length,_=0;_<v;++_){for(var y,b=g[_],C=b.width,w=b.show&&C>0,S=b._index,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;O<P;++O){0===O?b._loop?y=E[P-2]:(y=ve,r.subtract(E[0],E[1],y),r.add(E[0],y,y)):y=E[O-1],r.clone(y,me),r.clone(E[O],fe),O===P-1?b._loop?y=E[1]:(y=ve,r.subtract(E[P-1],E[P-2],y),r.add(E[P-1],y,y)):y=E[O+1],r.clone(y,ge);var M=x[D];O===I+M&&(I+=M,++D);var R=O-I==0,L=O===I+x[D]-1;p===k.SCENE2D&&(me.z=0,fe.z=0,ge.z=0),p!==k.SCENE2D&&p!==k.MORPHING||(R||L)&&f-Math.abs(fe.x)<1&&((fe.x<0&&me.x>0||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;B<F;++B){h.writeElements(fe,e,n),h.writeElements(me,e,n+6),h.writeElements(ge,e,n+12);var U=B-2<0?-1:1;t[s]=O/(P-1),t[s+1]=B%2*2-1,t[s+2]=U,t[s+3]=S,n+=18,s+=4}}var V=_e;V.x=o.floatToByte(A.red),V.y=o.floatToByte(A.green),V.z=o.floatToByte(A.blue),V.w=o.floatToByte(A.alpha);var z=ye;z.x=C,z.y=w?1:0;var G=p===k.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,H=h.fromCartesian(G.center,se),W=H.high,j=i.fromElements(H.low.x,H.low.y,H.low.z,G.radius,le),q=ue;q.x=0,q.y=Number.MAX_VALUE;var Y=b.distanceDisplayCondition;l(Y)&&(q.x=Y.near,q.y=Y.far),u.setBatchedAttribute(S,0,z),u.setBatchedAttribute(S,1,V),u.attributes.length>2&&(u.setBatchedAttribute(S,2,W),u.setBatchedAttribute(S,3,j),u.setBatchedAttribute(S,4,q))}};var 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;a<o;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,p=0,f=0;f<c;++f){var m;0===f?s._loop?m=l[c-2]:(m=Se,r.subtract(l[0],l[1],m),r.add(l[0],m,m)):m=l[f-1],m=g.multiplyByPoint(i,m,Ce)
  476. ;var v,_=g.multiplyByPoint(i,l[f],be);f===c-1?s._loop?v=l[1]:(v=Se,r.subtract(l[c-1],l[c-2],v),r.add(l[c-1],v,v)):v=l[f+1],v=g.multiplyByPoint(i,v,we);var y=u[d];f===p+y&&(p+=y,++d);for(var b=f-p==0,C=f===p+u[d]-1,w=b?2:0,S=C?2:4,T=w;T<S;++T)h.writeElements(_,e,t),h.writeElements(m,e,t+6),h.writeElements(v,e,t+12),t+=18}};var Te=new Array(1);K.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new Z(0,i,this);r[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d<c;++d){var h=u[d];h._locatorBuckets=[];var p;if(this.mode===k.SCENE3D){p=Te;var f=h._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=h._segments.lengths;var g=p.length;if(g>0){for(var v=0,_=0;_<g;++_)for(var y=p[_]-1,b=0;b<y;++b)l+4>m.SIXTY_FOUR_KILOBYTES&&(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;n<i;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var Ee={positions:void 0,lengths:void 0},xe=new Array(1),Pe=new r,Ae=new n;K.prototype.getSegments=function(t,i){var n=t._actualPositions;if(this.mode===k.SCENE3D)return xe[0]=n.length,Ee.positions=n,Ee.lengths=xe,Ee;J(t)&&(n=t._segments.positions);for(var o,a=i.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Pe,d=0;d<u;++d)o=n[d],c=g.multiplyByPoint(l,o,c),s.push(i.project(a.cartesianToCartographic(c,Ae)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new r(h.z,h.x,h.y)}return 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.length<c?u=De=new Float32Array(c):u.length>c&&(u=new Float32Array(u.buffer,0,c));var d,p=this.getSegments(t,n),f=p.positions,g=p.lengths,v=0,_=0,y=0;s=f.length;for(var b=0;b<s;++b){0===b?t._loop?d=f[s-2]:(d=ve,r.subtract(f[0],f[1],d),r.add(f[0],d,d)):d=f[b-1],r.clone(d,me),r.clone(f[b],fe),b===s-1?t._loop?d=f[1]:(d=ve,r.subtract(f[s-1],f[s-2],d),r.add(f[s-1],d,d)):d=f[b+1],r.clone(d,ge);var C=g[_];b===y+C&&(y+=C,++_);var w=b-y==0,S=b===y+g[_]-1;o===k.SCENE2D&&(me.z=0,fe.z=0,ge.z=0),o!==k.SCENE2D&&o!==k.MORPHING||(w||S)&&a-Math.abs(fe.x)<1&&((fe.x<0&&me.x>0||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;x<E;++x)h.writeElements(fe,u,v),h.writeElements(me,u,v+6),h.writeElements(ge,u,v+12),v+=18}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}},F}),define("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,r,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,r,n),e(n)?i.WGS84.scaleToGeodeticSurface(n,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),define("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function w(e,t,i,n,a,s,l,u,c){var d,h=u;d=e.getValueInReferenceFrame(t,s,c[h]),r(d)&&(c[h++]=d);for(var p,f,m,g=!r(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,i),v=0,_=n.length,y=n[v],b=i,C=!1;v<_;){if(!g&&o.greaterThanOrEquals(y,a)&&(d=e.getValueInReferenceFrame(a,s,c[h]),r(d)&&(c[h++]=d),g=!0),o.greaterThan(y,t)&&o.lessThan(y,b)&&!y.equals(a)&&(d=e.getValueInReferenceFrame(y,s,c[h]),r(d)&&(c[h++]=d)),v<_-1){if(l>0&&!C){var w=n[v+1],S=o.secondsDifference(w,y);C=S>l,C&&(p=Math.ceil(S/l),f=0,m=S/Math.max(p,2),p=Math.max(p-1,1))}if(C&&f<p){y=o.addSeconds(y,m,new o),f++;continue}}C=!1,v++,y=n[v]}return d=e.getValueInReferenceFrame(i,s,c[h]),r(d)&&(c[h++]=d),h}function S(e,t,i,n,a,s,l,u){for(var c,d=0,h=l,p=t,f=Math.max(s,60),m=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(p,i);)!m&&o.greaterThanOrEquals(p,n)&&(m=!0,c=e.getValueInReferenceFrame(n,a,u[h]),r(c)&&(u[h]=c,h++)),c=e.getValueInReferenceFrame(p,a,u[h]),r(c)&&(u[h]=c,h++),d++,p=o.addSeconds(t,f*d,new o);return c=e.getValueInReferenceFrame(i,a,u[h]),r(c)&&(u[h]=c,h++),h}function T(e,t,i,n,a,s,l,c){R.start=t,R.stop=i;for(var d=l,h=e.intervals,p=0;p<h.length;p++){var f=h.get(p);if(!u.intersect(f,R,O).isEmpty){var m=f.start;f.isStartIncluded||(m=f.isStopIncluded?f.stop:o.addSeconds(f.start,o.secondsDifference(f.stop,f.start)/2,new o));var g=e.getValueInReferenceFrame(m,a,c[d]);r(g)&&(c[d]=g,d++)}}return d}function E(e,t,i,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return r(u)&&(l[s++]=u),s}function x(e,t,r,i,n,a,s,l){M.start=t,M.stop=r;for(var c=s,d=e.intervals,h=0;h<d.length;h++){var p=d.get(h);if(!u.intersect(p,M,O).isEmpty){var f=p.start,m=p.stop,g=t;o.greaterThan(f,g)&&(g=f);var v=r;o.lessThan(m,v)&&(v=m),c=P(p.data,g,v,i,n,a,c,l)}}return c}function P(e,t,r,i,n,o,a,s){for(;e instanceof v;)e=e.resolvedProperty;if(e instanceof _){a=w(e,t,r,e._property._times,i,n,o,a,s)}else a=e instanceof p?x(e,t,r,i,n,o,a,s):e instanceof b?T(e,t,r,i,n,o,a,s):e instanceof f||e instanceof y&&g.isConstant(e)?E(e,t,r,i,n,o,a,s):S(e,t,r,i,n,o,a,s);return a}function A(e,t,i,n,o,a,s){r(s)||(s=[]);var l=P(e,t,i,n,o,a,0,s);return s.length=l,s}function D(e,t){this._unusedIndexes=[],this._polylineCollection=new d,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function I(t,r){r.collectionChanged.addEventListener(I.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}var O=new u,M=new u,R=new u,L=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var i=c.computeIcrfToFixedMatrix(e,L);r(i)||(i=c.computeTemeToPseudoFixedMatrix(e,L)),s.fromRotationTranslation(i,t.ZERO,this._polylineCollection.modelMatrix)}},D.prototype.updateObject=function(e,t){var i,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,d=a.isShowing&&(!r(u)||u.getValue(e));if(d){var h=g.getValueOrUndefined(s._leadTime,e),p=g.getValueOrUndefined(s._trailTime,e),f=a._availability,v=r(f),_=r(h),y=r(p);if(d=v||_&&y){if(y&&(i=o.addSeconds(e,-p,new o)),_&&(n=o.addSeconds(e,h,new o)),v){var b=f.start,C=f.stop;y&&!o.greaterThan(b,i)||(i=b),_&&!o.lessThan(C,n)||(n=C)}d=o.lessThan(i,n)}}if(!d)return void(r(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!r(c)){var w=this._unusedIndexes;if(w.length>0){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<a;o++){var s=n[o],u=s.entity,c=u._position,d=s.updater,p=l.FIXED;this._scene.mode===h.SCENE3D&&(p=c.referenceFrame);var f=this._updaters[p];d===f&&r(f)?f.updateObject(e,s):(r(d)&&d.removeObject(s),r(f)||(f=new D(this._scene,p),f.update(e),this._updaters[p]=f),s.updater=f,r(f)&&f.updateObject(e,s))}return!0},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(I.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i(this)},I.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._path)&&r(a._position)&&l.set(a.id,new C(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._path)&&r(a._position)?l.contains(a.id)||l.set(a.id,new C(a)):(s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=i.length-1;o>-1;o--)a=i[o],s=l.get(a.id),r(s)&&(r(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},I._subSample=A,I}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,r){r.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function p(e,t,r){if(i(e)){var n=e.pointPrimitive;if(i(n))return e.pointPrimitive=void 0,void r.removePoint(t);var o=e.billboard;i(o)&&(e.billboard=void 0,r.removeBillboard(t))}}function f(e,t,r,i,n){return function(o){var a=document.createElement("canvas"),s=n+2*i;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==i&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=r,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var m=r.WHITE,g=r.BLACK,v=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;o<a;o++){var s=t[o],u=s.entity,d=u._point,h=s.pointPrimitive,S=s.billboard,T=c.getValueOrDefault(d._heightReference,e,l.NONE),E=u.isShowing&&u.isAvailable(e)&&c.getValueOrDefault(d._show,e,!0);if(E&&(_=c.getValueOrUndefined(u._position,e,_),E=i(_)),E){c.isConstant(u._position)||(n._clusterDirty=!0);var x=!1;if(T===l.NONE||i(S)?T!==l.NONE||i(h)||(i(S)&&(p(s,u,n),S=void 0),h=n.getPoint(u),h.id=u,s.pointPrimitive=h):(i(h)&&(p(s,u,n),h=void 0),S=n.getBillboard(u),S.id=u,S.image=void 0,s.billboard=S,x=!0),i(h))h.show=!0,h.position=_,h.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,b),h.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,C),h.color=c.getValueOrDefault(d._color,e,m,v),h.outlineColor=c.getValueOrDefault(d._outlineColor,e,g,y),h.outlineWidth=c.getValueOrDefault(d._outlineWidth,e,0),h.pixelSize=c.getValueOrDefault(d._pixelSize,e,1),h.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,w),h.disableDepthTestDistance=c.getValueOrDefault(d._disableDepthTestDistance,e,0);else if(i(S)){S.show=!0,S.position=_,S.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,b),S.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,C),S.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,w),S.disableDepthTestDistance=c.getValueOrDefault(d._disableDepthTestDistance,e,0),S.heightReference=T;var P=c.getValueOrDefault(d._color,e,m,v),A=c.getValueOrDefault(d._outlineColor,e,g,y),D=Math.round(c.getValueOrDefault(d._outlineWidth,e,0)),I=Math.max(1,Math.round(c.getValueOrDefault(d._pixelSize,e,1)));if(D>0?(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<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},h.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],i(a._point)&&i(a._position)&&s.set(a.id,new d(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._point)&&i(a._position)?s.contains(a.id)||s.set(a.id,new d(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],p(s.get(a.id),a,l),s.remove(a.id)},h}),define("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,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)),
  477. 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;n<o;n++)this._onDataSourceAdded(i,i.get(n));var a=new p;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a,this._ready=!1}P.defaultVisualizersCallback=function(e,t,r){var i=r.entities;return[new u(t,i),new v(d,e,i),new v(f,e,i),new v(h,e,i),new v(m,e,i),new v(g,e,i),new v(w,e,i),new v(S,e,i),new v(T,e,i),new v(E,e,i),new v(x,e,i),new _(t,i),new y(e,i),new C(t,i),new b(e,i)]},n(P.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,r=e.length;t<r;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),o(this)},P.prototype.update=function(e){if(!l._initialized)return this._ready=!1,!1;var t,r,n,o,a=!0,s=this._dataSourceCollection,u=s.length;for(t=0;t<u;t++){var c=s.get(t);for(i(c.update)&&(a=c.update(e)&&a),n=c._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a;return this._ready=a,a};var A=[],D=new e;return P.prototype.getBoundingSphere=function(t,r,n){if(!this._ready)return c.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var u=l.get(o);if(u.entities.contains(t)){s=u;break}}}if(!i(s))return c.FAILED;var d=A,h=D,p=0,f=c.DONE,m=s._visualizers,g=m.length;for(o=0;o<g;o++){var v=m[o];if(i(v.getBoundingSphere)){if(f=m[o].getBoundingSphere(t,h),!r&&f===c.PENDING)return c.PENDING;f===c.DONE&&(d[p]=e.clone(h,d[p]),p++)}}return 0===p?c.FAILED:(d.length=p,e.fromBoundingSpheres(d,n),c.DONE)},P.prototype._onDataSourceAdded=function(e,t){var r=this._scene,i=t.clustering;i._initialize(r),r.primitives.add(i),t._visualizers=this._visualizersCallback(r,i,t)},P.prototype._onDataSourceRemoved=function(e,t){var r=this._scene,i=t.clustering;r.primitives.remove(i);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},P}),
  478. define("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(t,i,n,o,a,c,p){var f=t.scene.mode,P=a.getValue(c,t._lastCartesian);if(r(P)){var A,D,I,O=!1,M=!1;if(f===h.SCENE3D){s.addSeconds(c,.001,E);var R=a.getValue(E,y);if(r(R)||(s.addSeconds(c,-.001,E),R=a.getValue(E,y),M=!0),r(R)){var L,N=d.computeFixedToIcrfMatrix(c,m),k=d.computeFixedToIcrfMatrix(E,g);r(N)&&r(k)?L=u.transpose(N,v):(L=d.computeTemeToPseudoFixedMatrix(c,v),N=u.transpose(L,m),k=d.computeTemeToPseudoFixedMatrix(E,g),u.transpose(k,k));var F=u.multiplyByVector(N,P,S),B=u.multiplyByVector(k,R,T);e.subtract(F,B,w);var U=1e3*e.magnitude(w),V=3986004418e5,z=-V/(U*U-2*V/e.magnitude(F));z<0||z>x*p.maximumRadius?(A=b,e.normalize(P,A),e.negate(A,A),I=e.clone(e.UNIT_Z,C),D=e.cross(I,A,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(A,A),e.normalize(D,D),I=e.cross(A,D,C),e.normalize(I,I),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;h<p;++h)l.push(h);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,r){function i(e){e.forEach(function(t){t.forEach(function(t){(s[t=t<0?~t:t]||(s[t]=[])).push(e)})}),l.push(e)}function o(e){return d(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var s={},l=[],u=[];return r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var a,l=o(r[0][0]),u=0;u<n;++u)if(l===o(i[u])){a=i[0],i[0]=i[u],i[u]=a;break}return i})}}function i(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return o(e,t)})}:o(e,t)}function o(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:a(e,t)};return null==t.id&&delete r.id,r}function a(e,t){function r(e,t){t.length&&t.pop();for(var r,i=c[e<0?~e:e],n=0,o=i.length;n<o;++n)t.push(r=i[n].slice()),u(r,n);e<0&&s(t,o)}function i(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],i=0,n=e.length;i<n;++i)r(e[i],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in d?{type:t,coordinates:d[t](e)}:null}var u=m(e.transform),c=e.arcs,d={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return l(t)}function s(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function l(e,t){for(var r=0,i=e.length;r<i;){var n=r+i>>>1;e[n]<t?r=n+1:i=n}return r}function u(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var s in n)for(var u=n[s],c=u.length,d=0;d<c;++d)for(var h=d+1;h<c;++h){var p,f=u[d],m=u[h];(p=o[f])[s=l(p,m)]!==m&&p.splice(s,0,m),(p=o[m])[s=l(p,f)]!==f&&p.splice(s,0,f)}return o}function c(e,t){function r(e){o.remove(e),e[1][2]=t(e),o.push(e)}var i=m(e.transform),n=g(e.transform),o=f();return t||(t=h),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,d=e.length;c<d;++c)s=e[c],i(e[c]=[s[0],s[1],1/0],c);for(var c=1,d=e.length-1;c<d;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,d=l.length;c<d;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var h=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],h&&(h.next=p,h[2]=a[2],r(h)),p&&(p.previous=h,p[0]=a[0],r(p))}e.forEach(n)}),e}function d(e){for(var t,r=-1,i=e.length,n=e[i-1],o=0;++r<i;)t=n,n=e[r],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function h(e){var t=e[0],r=e[1],i=e[2];return Math.abs((t[0]-i[0])*(r[1]-t[1])-(t[0]-r[0])*(i[1]-t[1]))}function p(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var r=(t+1>>1)-1,n=i[r];if(p(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(o<n&&p(i[o],s)<0&&(s=i[a=o]),r<n&&p(i[r],s)<0&&(s=i[a=r]),a===t)break;i[s._=t]=s,i[e._=t=a]=e}}var r={},i=[],n=0;return r.push=function(t){return e(i[t._=n]=t,n++),n},r.pop=function(){if(!(n<=0)){var e,r=i[0];return--n>0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(p(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function m(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=(e[0]-o)/i|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-r,t=l,r=u}}function v(){}var _={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,r.apply(this,arguments))},mergeArcs:r,feature:i,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",_):"object"==typeof module&&module.exports?module.exports=_:this.topojson=_}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,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?"<tr><th>"+i+"</th><td>"+D(o)+"</td></tr>":"<tr><th>"+i+"</th><td>"+o+"</td></tr>")}return r.length>0&&(r='<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>"),r}function I(e,t,r){var i;return function(o,a){return n(i)||(i=e(t,r)),i}}function 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;i<e.length;i++)r[i]=t(e[i]);return r}function L(e,t,r,i,o){if(null===t.geometry)return void M(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new h("feature.geometry is required.");var a=t.geometry.type,s=le[a];if(!n(s))throw new h("Unknown geometry type: "+a);s(e,t,t.geometry,i,o)}function N(e,t,r,i,n){for(var o=t.features,a=0,s=o.length;a<s;a++)L(e,o[a],void 0,i,n)}function k(e,t,r,i,o){for(var a=r.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,d=le[c];if(!n(d))throw new h("Unknown geometry type: "+c);d(e,t,u,i,o)}}function F(e,r,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,d=r.properties;if(n(d)){var h=d["marker-color"];n(h)&&(u=t.fromCssColorString(h)),c=i(oe[d["marker-size"]],c);var m=d["marker-symbol"];n(m)&&(l=m)}var _;_=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c);var y=new v;y.verticalOrigin=new C(f.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var w=M(r,e._entityCollection,s.describe);w.billboard=y,w.position=new b(o(a));var S=g(_).then(function(e){y.image=new C(e)}).otherwise(function(){y.image=new C(e._pinBuilder.fromColor(u,c))});e._promises.push(S)}function B(e,t,r,i,n){F(e,t,i,r.coordinates,n)}function U(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)F(e,t,i,o[a],n)}function V(e,r,i,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=r.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new C(c));var d,h=u.stroke;n(h)&&(d=t.fromCssColorString(h));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(d)||(d=s.color.clone()),d.alpha=p),n(d)&&(s=new y(d))}var f,m=M(r,e._entityCollection,a.describe);a.clampToGround?(f=new w,m.corridor=f):(f=new P,m.polyline=f),f.material=s,f.width=l,f.positions=new C(R(o,i))}function z(e,t,r,i,n){V(e,t,i,r.coordinates,n)}function G(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)V(e,t,i,o[a],n)}function H(e,r,i,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,c=r.properties;if(n(c)){var h=c["stroke-width"];n(h)&&(u=new C(h));var p,f=c.stroke;n(f)&&(p=t.fromCssColorString(f));var m=c["stroke-opacity"];n(m)&&1!==m&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=m),n(p)&&(s=new C(p));var g,v=c.fill;n(v)&&(g=t.fromCssColorString(v),g.alpha=l.color.alpha),m=c["fill-opacity"],n(m)&&m!==l.color.alpha&&(n(g)||(g=l.color.clone()),g.alpha=m),n(g)&&(l=new y(g))}var _=new x;_.outline=new C(!0),_.outlineColor=s,_.outlineWidth=u,_.material=l;for(var b=[],w=1,S=o.length;w<S;w++)b.push(new d(R(o[w],i)));var T=o[0];_.hierarchy=new C(new d(R(T,i),b)),T[0].length>2?_.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;a<o.length;a++)H(e,t,i,o[a],n)}function q(e,t,r,i,n){for(var o in r.objects)if(r.objects.hasOwnProperty(o)){var a=m.feature(r,r.objects[o]),s=se[a.type];s(e,a,a,i,n)}}function Y(e){this._name=e,this._changed=new s,this._error=new s,this._isLoading=!1,this._loading=new s,this._entityCollection=new E(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new T}function X(e,t,r,i){var o;n(i)&&(o=l(i)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=se[t.type];if(!n(a))throw new h("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?A:null;if(n(s)){if(!n(s.properties))throw new h("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=Z[c.name],!n(u))throw new h("Unknown crs name: "+c.name)}else if("link"===s.type){var d=K[c.href];if(n(d)||(d=J[c.type]),!n(d))throw new h("Unable to resolve crs link: "+JSON.stringify(c));u=d(c)}else{if("EPSG"!==s.type)throw new h("Unknown crs type: "+s.type);if(u=Z["EPSG:"+c.code],!n(u))throw new h("Unknown crs EPSG code: "+c.code)}}return g(u,function(i){return e._entityCollection.removeAll(),null!==i&&a(e,t,t,i,r),g.all(e._promises,function(){return e._promises.length=0,S.setLoading(e,!1),e})})}var Q,Z={"urn:ogc:def:crs:OGC:1.3:CRS84":A,"EPSG:4326":A,"urn:ogc:def:crs:EPSG::4326":A},K={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,re=2,ie=t.fromBytes(255,255,0,100),ne=!1,oe={small:24,medium:48,large:64},ae=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],se={Feature:L,FeatureCollection:N,GeometryCollection:k,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q},le={GeometryCollection:k,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q};return Y.load=function(e,t){return(new Y).load(e,t)},o(Y,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Q},set:function(e){Q=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e}},strokeWidth:{get:function(){return re},set:function(e){re=e}},fill:{get:function(){return ie},set:function(e){ie=e}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return Z}},crsLinkHrefs:{get:function(){return K}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Y.prototype.load=function(e,t){S.setLoading(this,!0);var r=e;t=i(t,i.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),r=u(e)),t={describe:i(t.describe,O),markerSize:i(t.markerSize,$),markerSymbol:i(t.markerSymbol,Q),markerColor:i(t.markerColor,ee),strokeWidthProperty:new C(i(t.strokeWidth,re)),strokeMaterialProperty:new y(i(t.stroke,te)),fillMaterialProperty:new y(i(t.fill,ie)),clampToGround:i(t.clampToGround,ne)};var a=this;return g(r,function(e){return X(a,e,t,o)}).otherwise(function(e){return S.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),g.reject(e)})},Y}),define("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(e,r){t.throwInstantiationError()}return e(r,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(r.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),r.prototype.isOutlineVisible=t.throwInstantiationError,r.prototype.isFilled=t.throwInstantiationError,r.prototype.createFillGeometryInstance=t.throwInstantiationError,r.prototype.createOutlineGeometryInstance=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r.prototype.createDynamicUpdater=t.throwInstantiationError,r}),define("DataSources/KmlCamera",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRoll=t}return e}),function(e,t){"function"==typeof define&&define.amd?define("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),r=t.parse(e),i=0,n=[],o=0,a=r.length;o<a;o++){var s=r[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?i=Math.max(i-1,0):i++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===i){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var r;return this.replaceFn&&(r=this.replaceFn.call(this,this,t)),"string"==typeof r?r:!1===r?t.getMatchedText():r instanceof e.HtmlTag?r.toAnchorString():this.getTagBuilder().build(t).toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,r){return new e(r).link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var i=t.prototype,n=function(){};n.prototype=i;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){i.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=i,delete r.constructor,e.Util.assign(a,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,i=[],n=0;r=t.exec(e);)i.push(e.substring(n,r.index)),i.push(r[0]),n=r.index+r[0].length;return i.push(e.substring(n)),i},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);r=s.shift();)-1===o(a,r)&&a.push(r);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);a.length&&(r=s.shift());){var l=o(a,r);-1!==l&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){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:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,parse:function(e){for(var t,r,i=this.htmlRegex,n=0,o=[];null!==(t=i.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var d=e.substring(n);d&&(r=this.parseTextAndEntityNodes(d),o.push.apply(o,r))}return o},parseTextAndEntityNodes:function(t){for(var r=[],i=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=i.length;n<o;n+=2){var a=i[n],s=i[n+1];a&&r.push(this.createTextNode(a)),s&&r.push(this.createEntityNode(s))}return r},createCommentNode:function(t,r){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(r)})},createElementNode:function(t,r,i){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:i})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,r=/(?:[\-;:&=\+\$,\w\.]+@)/,i=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",r.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",i.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var i=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,d,h,p,f,m){var g=i.processCandidateMatch(e,n,o,a,s,l,u,c,d,h,p,f,m);if(g){var v=t.call(r,g.match);return g.prefixStr+v+g.suffixStr}return e})},processCandidateMatch:function(t,r,i,n,o,a,s,l,u,c,d,h,p){var f,m=l||u,g="",v="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||r&&!this.twitter||d&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,m))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),v=")"),o)f=new e.match.Email({matchedText:t,email:o});else if(r)i&&(g=i,t=t.slice(1)),f=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var _=t.replace(/\D/g,"");f=new e.match.Phone({matchedText:t,number:_})}else if(d)h&&(g=h,t=t.slice(1)),f=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(m){var y=m.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(g=y,t=t.slice(1))}f=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!m,stripPrefix:this.stripPrefix})}return{prefixStr:g,suffixStr:v,match:f}},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),r=e.match(/\)/g);if((t&&t.length||0)<(r&&r.length||0))return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},
  479. getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){return this.getUrl().replace(/&amp;/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),define("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var r={};return function(r){function i(){var e=-1,t=this;t.append=function(r){var i,n=t.table;for(i=0;i<r.length;i++)e=e>>>8^n[255&(e^r[i])]},t.get=function(){return~e}}function n(e,t,r){return e.slice?e.slice(t,t+r):e.webkitSlice?e.webkitSlice(t,t+r):e.mozSlice?e.mozSlice(t,t+r):e.msSlice?e.msSlice(t,t+r):void 0}function o(e,t){var r,i;return r=new ArrayBuffer(e),i=new Uint8Array(r),t&&i.set(t,0),{buffer:r,array:i,view:new DataView(r)}}function a(){}function s(e){function t(t,r){var o=new Blob([e],{type:V});i=new u(o),i.init(function(){n.size=i.size,t()},r)}function r(e,t,r,n){i.readUint8Array(e,t,r,n)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function l(e){function t(t){for(var r=e.length;"="==e.charAt(r-1);)r--;i=e.indexOf(",")+1,n.size=Math.floor(.75*(r-i)),t()}function r(t,r,n){var a,s=o(r),l=4*Math.floor(t/3),u=4*Math.ceil((t+r)/3),c=window.atob(e.substring(l+i,u+i)),d=t-3*Math.floor(l/4);for(a=d;a<d+r;a++)s.array[a-d]=c.charCodeAt(a);n(s.array)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function u(e){function t(t){this.size=e.size,t()}function r(t,r,i,o){var a=new FileReader;a.onload=function(e){i(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,r))}var i=this;i.size=0,i.init=t,i.readUint8Array=r}function c(){}function d(e){function t(e){n=new Blob([],{type:V}),e()}function r(e,t){n=new Blob([n,A?e:e.buffer],{type:V}),t()}function i(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=r,i.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function h(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function r(e,t){var r,i=a.length,n=a;for(a="",r=0;r<3*Math.floor((i+e.length)/3)-i;r++)n+=String.fromCharCode(e[r]);for(;r<e.length;r++)a+=String.fromCharCode(e[r]);n.length>2?o+=window.btoa(n):a=n,t()}function i(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=r,n.getData=i}function p(e){function t(t){n=new Blob([],{type:e}),t()}function r(t,r){n=new Blob([n,A?t:t.buffer],{type:e}),r()}function i(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function f(e,t,r,i,n,o,a,s,l,u){function c(){e.removeEventListener(z,d,!1),s(f)}function d(e){var t=e.data,i=t.data;t.onappend&&(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),h()},u)),t.onflush&&(i?(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p<n?t.readUint8Array(i+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),m++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,f,m=0;f=0,e.addEventListener(z,d,!1),h()}function m(e,t,r,i,n,o,a,s,l,u){function c(){var f;d=h*F,d<n?t.readUint8Array(i+d,Math.min(F,n-d),function(t){var s=e.append(t,function(){a&&a(i+d,n)});p+=s.length,o(!0,t),r.writeUint8Array(s,function(){o(!1,s),h++,setTimeout(c,1)},u),a&&a(d,n)},l):(f=e.flush(),f?(p+=f.length,r.writeUint8Array(f,function(){o(!1,f),s(p)},u)):s(p))}var d,h=0,p=0;c()}function g(e,t,n,o,a,s,l,u,c){function d(e,t){a&&!e&&g.append(t)}function h(e){s(e,g.get())}var p,g=new i;return r.zip.useWebWorkers?(p=new Worker(r.zip.workerScriptsPath+B),f(p,e,t,n,o,d,l,h,u,c)):m(new r.zip.Inflater,e,t,n,o,d,l,h,u,c),p}function v(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function d(){h.removeEventListener(z,d,!1),f(h,e,t,0,e.size,u,a,c,s,l)}var h,p=new i;return r.zip.useWebWorkers?(h=new Worker(r.zip.workerScriptsPath+U),h.addEventListener(z,d,!1),h.postMessage({init:!0,level:n})):m(new r.zip.Deflater,e,t,0,e.size,u,a,c,s,l),h}function _(e,t,r,n,o,a,s,l,u){function c(){var i=d*F;i<n?e.readUint8Array(r+i,Math.min(F,n-i),function(e){o&&h.append(e),s&&s(i,n,e),t.writeUint8Array(e,function(){d++,c()},u)},l):a(n,h.get())}var d=0,h=new i;c()}function y(e){var t,r,i="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r=255&e.charCodeAt(t),i+=r>127?n[r-128]:String.fromCharCode(r);return i}function b(e){return decodeURIComponent(escape(e))}function C(e){var t,r="";for(t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r}function w(e){var t=(4294901760&e)>>16,r=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&r)>>11,(2016&r)>>5,2*(31&r),0)}catch(e){}}function S(e,t,r,i,n){return e.version=t.view.getUint16(r,!0),e.bitFlag=t.view.getUint16(r+2,!0),e.compressionMethod=t.view.getUint16(r+4,!0),e.lastModDateRaw=t.view.getUint32(r+6,!0),e.lastModDate=w(e.lastModDateRaw),1==(1&e.bitFlag)?void n(I):((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(r+10,!0),e.compressedSize=t.view.getUint32(r+14,!0),e.uncompressedSize=t.view.getUint32(r+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(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<s;i++){if(a=new r,1347092738!=h.view.getUint32(c))return void t(D);S(a,h,c+6,!0,t),a.commentLength=h.view.getUint16(c+32,!0),a.directory=16==(16&h.view.getUint8(c+38)),a.offset=h.view.getUint32(c+42,!0),l=C(h.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048==(2048&a.bitFlag)?b(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=C(h.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048==(2048&a.bitFlag)?b(u):y(u),d.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(d)},function(){t(M)})})},close:function(e){e&&e()}}}function E(e){return unescape(encodeURIComponent(e))}function x(e){var t,r=[];for(t=0;t<e.length;t++)r.push(e.charCodeAt(t));return r}function P(e,t,r){function i(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){i(t,R)}function a(){i(t,N)}var s,l={},u=[],c=0;return{add:function(d,h,p,f,m){function g(t){var i;S=m.lastModDate||new Date,C=o(26),l[d]={headerArray:C.array,directory:m.directory,filename:w,offset:c,comment:x(E(m.comment||""))},C.view.setUint32(0,335546376),m.version&&C.view.setUint8(0,m.version),r||0===m.level||m.directory||C.view.setUint16(4,2048),C.view.setUint16(6,(S.getHours()<<6|S.getMinutes())<<5|S.getSeconds()/2,!0),C.view.setUint16(8,(S.getFullYear()-1980<<4|S.getMonth()+1)<<5|S.getDate(),!0),C.view.setUint16(22,w.length,!0),i=o(30+w.length),i.view.setUint32(0,1347093252),i.array.set(C.array,4),i.array.set(w,30),c+=i.array.length,e.writeUint8Array(i.array,t,n)}function y(t,r){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),void 0!==r&&(C.view.setUint32(10,r,!0),a.view.setUint32(4,r,!0)),h&&(a.view.setUint32(8,t,!0),C.view.setUint32(14,t,!0),a.view.setUint32(12,h.size,!0),C.view.setUint32(18,h.size,!0)),e.writeUint8Array(a.array,function(){c+=16,i(p)},n)}function b(){if(m=m||{},d=d.trim(),m.directory&&"/"!=d.charAt(d.length-1)&&(d+="/"),l.hasOwnProperty(d))return void t(k);w=x(E(d)),u.push(d),g(function(){h?r||0===m.level?_(h,e,0,h.size,!0,y,f,a,n):s=v(h,e,m.level,y,f,a,n):y()},n)}var C,w,S;h?h.init(b,a):b()},close:function(t){var r,a,s,d=0,h=0;for(a=0;a<u.length;a++)s=l[u[a]],d+=46+s.filename.length+s.comment.length;for(r=o(d+22),a=0;a<u.length;a++)s=l[u[a]],r.view.setUint32(h,1347092738),r.view.setUint16(h+4,5120),r.array.set(s.headerArray,h+6),r.view.setUint16(h+32,s.comment.length,!0),s.directory&&r.view.setUint8(h+38,16),r.view.setUint32(h+42,s.offset,!0),r.array.set(s.filename,h+46),r.array.set(s.comment,h+46+s.filename.length),h+=46+s.filename.length+s.comment.length;r.view.setUint32(h,1347093766),r.view.setUint16(h+8,u.length,!0),r.view.setUint16(h+10,u.length,!0),r.view.setUint32(h+12,d,!0),r.view.setUint32(h+16,c,!0),e.writeUint8Array(r.array,function(){i(function(){e.getData(t)})},n)}}}var A,D="File format is not recognized.",I="File contains encrypted entry.",O="File is using Zip64 (4gb+ file size).",M="Error while reading zip file.",R="Error while writing zip file.",L="Error while writing file data.",N="Error while reading file data.",k="File already exists.",F=524288,B="inflate.js",U="deflate.js",V="text/plain",z="message";try{A=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}i.prototype.table=function(){var e,t,r,i=[];for(e=0;e<256;e++){for(r=e,t=0;t<8;t++)1&r?r=r>>>1^3988292384:r>>>=1;i[e]=r}return i}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,r.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,r){e.init(function(){t(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("<kml")+4),r=e.substr(t.length)),t+=" "+n+'"'+o[a]+'"'));return c(t)&&(e=t+r),e}function ge(e,t,r,i){t.getData(new G.TextWriter,function(e){r.kml=Lt.parseFromString(e,"application/xml"),i.resolve()})}function ve(e,t,r,i){var n=u(Rt.detectFromFilename(t.filename),"application/octet-stream");t.getData(new G.Data64URIWriter(n),function(e){r[t.filename]=e,i.resolve()})}function _e(e,t,r,i){for(var n=i.keys,o=new V("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(r),c=new V(u).resolve(o).toString(),d=n.indexOf(c);if(-1!==d){var h=n[d];l.setAttribute(r,i[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function ye(e,t,r,i,n,o){for(var a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(r),c=Re(u,i,n,o);l.setAttribute(r,c)}}function be(e,t,r){return c(t)&&new V(e).isAbsolute()&&(e=t.getURL(e)),c(r)&&(e=y(e,"?"+r,!1)),e}function Ce(e,t,r){var i=xe(e,"id");i=c(i)&&0!==i.length?i:l(),c(r)&&(i=r+i);var n=t.getById(i);return c(n)&&(i=l(),c(r)&&(i=r+i)),n=t.add(new X({id:i})),c(n.kml)||(n.addProperty("kml"),n.kml=new Mt),n}function we(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function Se(e){if(!c(e))return i.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!c(t))return i.fromDegrees(0,0,0);var r=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return r=isNaN(r)?0:r,n=isNaN(n)?0:n,o=isNaN(o)?0:o,i.fromDegrees(r,n,o)}function Te(e){if(c(e)){var t=e.textContent.match(/[^\s\n]+/g);if(c(t)){for(var r=t.length,i=new Array(r),n=0,o=0;o<r;o++)i[n++]=Se(t[o]);return i}}}function Ee(e,t){if(c(e)){var r=e.getAttribute(t);if(null!==r){var i=parseFloat(r);return isNaN(i)?void 0:i}}}function xe(e,t){if(c(e)){var r=e.getAttribute(t);return null!==r?r:void 0}}function Pe(e,t,r){if(c(e))for(var i=e.childNodes,n=i.length,o=0;o<n;o++){var a=i[o];if(a.localName===t&&-1!==r.indexOf(a.namespaceURI))return a}}function Ae(e,t,r){if(c(e)){for(var i=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}}function De(e,t,r){if(!c(e))return[];for(var i=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}function Ie(e,t,r){var i=Pe(e,t,r);if(c(i)){var n=parseFloat(i.textContent);return isNaN(n)?void 0:n}}function Oe(e,t,r){var i=Pe(e,t,r);if(c(i))return i.textContent.trim()}function Me(e,t,r){var i=Pe(e,t,r);if(c(i)){var n=i.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Re(e,t,r,i,n){if(c(e)){var o=!1;if(c(i)){var a=i[e];if(c(a))o=!0,e=a;else{a=i[m(e,r)],c(a)&&(o=!0,e=a)}}return o||(c(r)&&(e=m(e,m(r))),e=be(e,t,n)),e}}function Le(e,t){if(c(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var r=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?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<l;a++){var d=t.childNodes.item(a);if("IconStyle"===d.localName)Ge(e,d,r,i,n,o);else if("LabelStyle"===d.localName){var h=r.label;c(h)||(h=Ve(),r.label=h),h.scale=u(Ie(d,"scale",Wt.kml),h.scale),h.fillColor=u(Ne(d,"color",Wt.kml),h.fillColor),h.text=r.name}else if("LineStyle"===d.localName){var p=r.polyline;c(p)||(p=new ee,r.polyline=p),p.width=Ie(d,"width",Wt.kml),p.material=Ne(d,"color",Wt.kml),c(Ne(d,"outerColor",Wt.gx))&&x("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c(Ie(d,"outerWidth",Wt.gx))&&x("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c(Ie(d,"physicalWidth",Wt.gx))&&x("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(Me(d,"labelVisibility",Wt.gx))&&x("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===d.localName){var f=r.polygon;c(f)||(f=Ue(),r.polygon=f),f.material=u(Ne(d,"color",Wt.kml),f.material),f.fill=u(Me(d,"fill",Wt.kml),f.fill),f.outline=u(Me(d,"outline",Wt.kml),f.outline)}else if("BalloonStyle"===d.localName){var m=u(Le(Oe(d,"bgColor",Wt.kml)),s.WHITE),g=u(Le(Oe(d,"textColor",Wt.kml)),s.BLACK),v=Oe(d,"text",Wt.kml);r.addProperty("balloonStyle"),r.balloonStyle={bgColor:m,textColor:g,text:v}}else if("ListStyle"===d.localName){var _=Oe(d,"listItemType",Wt.kml);"radioFolder"!==_&&"checkOffOnly"!==_||x("kml-listStyle-"+_,"KML - Unsupported ListStyle with listItemType: "+_)}}}function We(e,t,r,i,n,o,a){for(var s,l=new X,u=-1,d=r.childNodes,h=d.length,p=0;p<h;p++){var f=d[p];"Style"!==f.localName&&"StyleMap"!==f.localName||(u=p)}if(-1!==u){var g=d[u];if("Style"===g.localName)He(t,g,l,n,o,a);else for(var v=De(g,"Pair",Wt.kml),_=0;_<v.length;_++){var y=v[_],b=Oe(y,"key",Wt.kml);if("normal"===b){var C=Oe(y,"styleUrl",Wt.kml);if(c(C))s=i.getById(C),c(s)||(s=i.getById("#"+C)),c(s)&&l.merge(s);else{var w=Pe(y,"Style",Wt.kml);He(t,w,l,n,o,a)}}else x("kml-styleMap-"+b,"KML - Unsupported StyleMap key: "+b)}}var S=Oe(r,"styleUrl",Wt.kml);if(c(S)){var T=S;if("#"!==S[0]&&-1!==S.indexOf("#")){var E=S.split("#"),P=E[0];c(n)&&(P=m(P,m(n))),T=P+"#"+E[1]}s=i.getById(T),c(s)||(s=i.getById("#"+T)),c(s)&&l.merge(s)}return l}function je(e,t,r,i){return w(be(t,e._proxy,i)).then(function(i){return qe(e,i,r,t,!0)})}function qe(e,t,r,i,n,o,a){var s,l,u,d,h=Ae(t,"Style",Wt.kml);if(c(h)){var p=h.length;for(s=0;s<p;s++)d=h[s],l=xe(d,"id"),c(l)&&(l="#"+l,n&&c(i)&&(l=i+l),c(r.getById(l))||(u=new X({id:l}),r.add(u),He(e,d,u,i,o,a)))}var f=Ae(t,"StyleMap",Wt.kml);if(c(f)){var g=f.length;for(s=0;s<g;s++){var v=f[s];if(l=xe(v,"id"),c(l))for(var _=De(v,"Pair",Wt.kml),y=0;y<_.length;y++){var b=_[y],C=Oe(b,"key",Wt.kml);if("normal"===C){if(l="#"+l,n&&c(i)&&(l=i+l),!c(r.getById(l))){u=r.getOrCreateEntity(l);var w=Oe(b,"styleUrl",Wt.kml);if(c(w)){"#"!==w[0]&&(w="#"+w),n&&c(i)&&(w=i+w);var S=r.getById(w);c(S)&&u.merge(S)}else d=Pe(b,"Style",Wt.kml),He(e,d,u,i,o,a)}}else x("kml-styleMap-"+C,"KML - Unsupported StyleMap key: "+C)}}}var T={},E=[],P=t.getElementsByTagName("styleUrl"),A=P.length;for(s=0;s<A;s++){var D=P[s].textContent;if("#"!==D[0]){var I=D.split("#");if(2===I.length){var O=I[0];c(T[O])||(c(i)&&(O=m(O,m(i))),E.push(je(e,O,r,a)))}}}return E}function Ye(e,t,r){var i=new ie(e,t.id,["position"]),n=new oe(t.position);t.polyline=c(r.polyline)?r.polyline.clone():new ee,t.polyline.positions=new te([i,n])}function Xe(e,t){return!c(e)&&!c(t)||"clampToGround"===e?N.CLAMP_TO_GROUND:"relativeToGround"===e?N.RELATIVE_TO_GROUND:"absolute"===e?N.NONE:"clampToSeaFloor"===t?(x("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),N.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(x("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),N.RELATIVE_TO_GROUND):(c(e)?x("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):x("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>: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;n<i;n++){var o=e[n];p.WGS84.scaleToGeodeticSurface(o,o)}return e}}function Ke(e,t,i,n){var o=t.label;c(o)||(o=c(i.label)?i.label.clone():Ve(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(i.billboard)?i.billboard.clone():Be(),t.billboard=a),c(a.image)?a.image.getValue()||(a.image=void 0):a.image=e._pinBuilder.fromColor(s.YELLOW,64);var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new r(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Je(e,t,r){var i=t.path;c(i)||(i=new J,i.leadTime=0,t.path=i);var n=r.polyline;c(n)&&(i.material=n.material,i.width=n.width)}function $e(e,t,r,i,n){var o=Oe(r,"coordinates",Wt.kml),a=Oe(r,"altitudeMode",Wt.kml),s=Oe(r,"altitudeMode",Wt.gx),l=Me(r,"extrude",Wt.kml),u=Se(o);return i.position=u,Ke(e,i,n,Xe(a,s)),l&&we(a,s)&&Ye(t,i,n),!0}function et(e,t,r,i,n){var o=Pe(r,"coordinates",Wt.kml),a=Oe(r,"altitudeMode",Wt.kml),l=Oe(r,"altitudeMode",Wt.gx),d=Me(r,"extrude",Wt.kml),h=Me(r,"tessellate",Wt.kml),p=we(a,l);c(Ie(r,"drawOrder",Wt.gx))&&x("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings");var f=Te(o),m=n.polyline;if(p&&d){var g=new se;i.wall=g,g.positions=f;var v=n.polygon;c(v)&&(g.fill=v.fill,g.material=v.material),g.outline=!0,c(m)?(g.outlineColor=c(m.material)?m.material.color:s.WHITE,g.outlineWidth=m.width):c(v)&&(g.outlineColor=c(v.material)?v.material.color:s.WHITE)}else if(e._clampToGround&&!p&&h){var y=new j;i.corridor=y,y.positions=f,c(m)?(y.material=c(m.material)?m.material.color.getValue(_.MINIMUM_VALUE):s.WHITE,y.width=u(m.width,1)):(y.material=s.WHITE,y.width=1)}else m=c(m)?m.clone():new ee,i.polyline=m,m.positions=Ze(f,a,l),h&&!p||(m.followSurface=!1);return!0}function tt(e,t,r,i,n){var o=Pe(r,"outerBoundaryIs",Wt.kml),a=Pe(o,"LinearRing",Wt.kml),l=Pe(a,"coordinates",Wt.kml),u=Te(l),d=Me(r,"extrude",Wt.kml),h=Oe(r,"altitudeMode",Wt.kml),p=Oe(r,"altitudeMode",Wt.gx),f=we(h,p),m=c(n.polygon)?n.polygon.clone():Ue(),g=n.polyline;if(c(g)&&(m.outlineColor=c(g.material)?g.material.color:s.WHITE,m.outlineWidth=g.width),i.polygon=m,f?(m.perPositionHeight=!0,m.extrudedHeight=d?0:void 0):e._clampToGround||(m.height=0),c(u)){for(var v=new A(u),_=De(r,"innerBoundaryIs",Wt.kml),y=0;y<_.length;y++){a=De(_[y],"LinearRing",Wt.kml);for(var b=0;b<a.length;b++)l=Pe(a[b],"coordinates",Wt.kml),u=Te(l),c(u)&&v.holes.push(new A(u))}m.hierarchy=v}return!0}function rt(e,t,r,i,n){var o=Oe(r,"altitudeMode",Wt.kml),a=Oe(r,"altitudeMode",Wt.gx),s=De(r,"coord",Wt.gx),l=De(r,"angles",Wt.gx),u=De(r,"when",Wt.kml),c=Me(r,"extrude",Wt.kml),d=we(o,a);l.length>0&&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;m<h;m++){var g=Se(s[m].textContent);p.push(g),f.push(b.fromIso8601(u[m].textContent))}var v=new ne;return v.addSamples(f,p),i.position=v,Ke(e,i,n,Xe(o,a)),Je(e,i,n),i.availability=new M,u.length>0&&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;m<g;m++){var v=u[m],_=De(v,"when",Wt.kml),y=De(v,"coord",Wt.gx),C=Oe(v,"altitudeMode",Wt.kml),w=Oe(v,"altitudeMode",Wt.gx),S=we(C,w),T=Me(v,"extrude",Wt.kml),E=Math.min(y.length,_.length),x=[];o=[];for(var P=0;P<E;P++){var A=Se(y[P].textContent);x.push(A),o.push(b.fromIso8601(_[P].textContent))}l&&(c(a)&&it([a,o[0]],[s,x[0]],f,p,h,!1,"absolute",void 0,!1),a=o[E-1],s=x[x.length-1]),
  480. it(o,x,f,p,h,S&&T,C,w,!0),d=d||S&&T}return i.availability=p,i.position=f,Ke(e,i,n),Je(e,i,n),d&&(Ye(t,i,n),i.polyline.show=h),!0}function ot(e,t,r,i,n,o){for(var a=r.childNodes,s=!1,l=0,u=a.length;l<u;l++){var d=a.item(l),h=qt[d.localName];if(c(h)){var p=Ce(d,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,d,p,n)&&(s=!0)}}return s}function at(e,t,r,i,n){return x("kml-unsupportedGeometry","KML - Unsupported geometry: "+r.localName),!1}function st(e,t){var r=Pe(e,"ExtendedData",Wt.kml);if(c(r)){c(Pe(r,"SchemaData",Wt.kml))&&x("kml-schemaData","KML - SchemaData is unsupported"),c(xe(r,"xmlns:prefix"))&&x("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var i={},n=De(r,"Data",Wt.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=xe(s,"name");c(l)&&(i[l]={displayName:Oe(s,"displayName",Wt.kml),value:Oe(s,"value",Wt.kml)})}t.kml.extendedData=i}}function lt(e,t,r,i,n,o){var a,l,d,h=t.kml,p=h.extendedData,f=Oe(e,"description",Wt.kml),m=u(t.balloonStyle,r.balloonStyle),g=s.WHITE,v=s.BLACK,_=f;c(m)&&(g=u(m.bgColor,s.WHITE),v=u(m.textColor,s.BLACK),_=u(m.text,f));var y;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(f,"")),_=_.replace("$[address]",u(h.address,"")),_=_.replace("$[Snippet]",u(h.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(p)){var b=_.match(/\$\[.+?\]/g);if(null!==b)for(a=0;a<b.length;a++){var C=b[a],w=C.substr(2,C.length-3),S=/\/displayName$/.test(w);w=w.replace(/\/displayName$/,""),y=p[w],c(y)&&(y=S?y.displayName:y.value),c(y)&&(_=_.replace(C,u(y,"")))}}}else if(c(p)&&(d=Object.keys(p),d.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',a=0;a<d.length;a++)l=d[a],y=p[l],_+="<tr><th>"+u(y.displayName,l)+"</th><td>"+u(y.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=Nt.link(_),Yt.innerHTML=_;var T=Yt.querySelectorAll("a");for(a=0;a<T.length;a++)T[a].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(_e(Yt,"a","href",i),_e(Yt,"img","src",i)),ye(Yt,"a","href",n,o),ye(Yt,"img","src",n,o);var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+g.toCssColorString()+";",E+="color:"+v.toCssColorString()+";",E+='">',E+=Yt.innerHTML+"</div>",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;h<d;h++)for(var p=c[h],f=Xt[p],m=r.childNodes,g=m.length,v=0;v<g;v++){var _=m[v];_.localName!==p||-1===Wt.kml.indexOf(_.namespaceURI)&&-1===Wt.gx.indexOf(_.namespaceURI)||f(e,t,_,i,n,o,a,s,l,u)}}function dt(e,t,r,i,n,o,a,s,l,u){ct(e,ut(e,t,r,i,n,o,a,s,l,u).entity,r,i,n,o,a,s,l,u)}function ht(e,t,r,i,n,o,a,s,l,u){for(var d=ut(e,t,r,i,n,o,a,s,l,u),h=d.entity,p=d.styleEntity,f=!1,m=r.childNodes,g=0,v=m.length;g<v&&!f;g++){var _=m.item(g),y=qt[_.localName];c(y)&&(y(e,i,_,h,p,h.id),f=!0)}f||(h.merge(p),Ke(e,h,p))}function pt(e,t,r,i,n,o,a,s,l){var u=Oe(r,"name",Wt.kml),d=xe(r,"id"),h=new ce(u,d),p=Pe(r,"Playlist",Wt.gx);if(p)for(var f=p.childNodes,m=0;m<f.length;m++){var g=f[m];if(g.localName){var v=Qt[g.localName];v?v(h,g):console.log("Unknown KML Tour playlist entry type "+g.localName)}}c(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(h)}function ft(e,t){x("KML Tour unsupported node "+t.localName)}function mt(e,t){var r=Ie(t,"duration",Wt.gx);e.addPlaylistEntry(new he(r))}function gt(e,t){var r=Ie(t,"duration",Wt.gx),i=Oe(t,"flyToMode",Wt.gx),n={kml:{}};_t(t,n),vt(t,n);var o=n.kml.lookAt||n.kml.camera,a=new de(r,i,o);e.addPlaylistEntry(a)}function vt(e,t){var r=Pe(e,"Camera",Wt.kml);if(c(r)){var n=u(Ie(r,"longitude",Wt.kml),0),o=u(Ie(r,"latitude",Wt.kml),0),a=u(Ie(r,"altitude",Wt.kml),0),s=u(Ie(r,"heading",Wt.kml),0),l=u(Ie(r,"tilt",Wt.kml),0),d=u(Ie(r,"roll",Wt.kml),0),h=i.fromDegrees(n,o,a),p=R.fromDegrees(s,l-90,d);t.kml.camera=new ue(h,p)}}function _t(e,t){var r=Pe(e,"LookAt",Wt.kml);if(c(r)){var n=u(Ie(r,"longitude",Wt.kml),0),o=u(Ie(r,"latitude",Wt.kml),0),a=u(Ie(r,"altitude",Wt.kml),0),s=Ie(r,"heading",Wt.kml),l=Ie(r,"tilt",Wt.kml),d=u(Ie(r,"range",Wt.kml),0);l=S.toRadians(u(l,0)),s=S.toRadians(u(s,0));var h=new L(s,l-90,d),p=i.fromDegrees(n,o,a);t.kml.lookAt=new le(p,h)}}function yt(e,t,r,i,n,o,a,s,l,u){var d,h=ut(e,t,r,i,n,o,a,s,l,u),p=h.entity,f=!1,m=Te(Pe(r,"LatLonQuad",Wt.gx));if(c(m))d=Ue(),d.hierarchy=new A(m),p.polygon=d,f=!0;else{d=new re,p.rectangle=d;var g=Pe(r,"LatLonBox",Wt.kml);if(c(g)){var v=Ie(g,"west",Wt.kml),_=Ie(g,"south",Wt.kml),y=Ie(g,"east",Wt.kml),b=Ie(g,"north",Wt.kml);c(v)&&(v=S.negativePiToPi(S.toRadians(v))),c(_)&&(_=S.clampToLatitudeRange(S.toRadians(_))),c(y)&&(y=S.negativePiToPi(S.toRadians(y))),c(b)&&(b=S.clampToLatitudeRange(S.toRadians(b))),d.coordinates=new D(v,_,y,b);var C=Ie(g,"rotation",Wt.kml);if(c(C)){var w=S.toRadians(C);d.rotation=w,d.stRotation=w}}}var T=Pe(r,"Icon",Wt.kml),E=ze(T,e,o,a,!0,u);if(c(E)){f&&x("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");var P=Ie(T,"x",Wt.gx),I=Ie(T,"y",Wt.gx),O=Ie(T,"w",Wt.gx),M=Ie(T,"h",Wt.gx);(c(P)||c(I)||c(O)||c(M))&&x("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),d.material=E,d.material.color=Ne(r,"color",Wt.kml),d.material.transparent=!0}else d.material=Ne(r,"color",Wt.kml);var R=Oe(r,"altitudeMode",Wt.kml);c(R)?"absolute"===R?d.height=Ie(r,"altitude",Wt.kml):"clampToGround"!==R&&x("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+R):(R=Oe(r,"altitudeMode",Wt.gx),"relativeToSeaFloor"===R?(x("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),d.height=Ie(r,"altitude",Wt.kml)):"clampToSeaFloor"===R?x("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(R)&&x("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+R))}function bt(e,t,r,i,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,r,i,n,o,a),x("kml-unsupportedFeature-"+r.nodeName,"KML - Unsupported feature: "+r.nodeName)}function Ct(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"===t&&e.splice(0,1),"?"!==t&&(e="?"+e),e}function wt(e,t){var r="";return(c(e)&&e.length>0||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;n<i.length;n++){var o=i[n];c(o.parent)||(o.parent=f,It(o)),r.add(o)}r.resumeEvents();var a=Oe(g,"refreshMode",Wt.kml),s=u(Ie(g,"refreshInterval",Wt.kml),0);if("onInterval"===a&&s>0||"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&&E<y&&b.addSeconds(p,y,T),m.refreshMode=Zt.EXPIRE,m.time=T}catch(e){x("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else x("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(m.refreshMode=Zt.STOP,m.time=u(Ie(g,"viewRefreshTime",Wt.kml),0)):x("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(m.refreshMode)&&e._networkLinks.set(m.id,m)}else"onRegion"===v&&x("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).otherwise(function(e){x("An error occured during loading "+T)});s.push(O)}}}function Et(e,t,r,i,n,o,a,s,l,u){var d=Xt[t.localName];c(d)?d(e,r,t,i,n,o,a,s,l,u):bt(e,r,t,i,n,o,a,s,l)}function xt(e,t,r,i,n,o,a){t.removeAll();var s=[],l=r.documentElement,u="Document"===l.localName?l:Pe(l,"Document",Wt.kml),d=Oe(u,"name",Wt.kml);!c(d)&&c(i)&&(d=v(i)),c(e._name)||(e._name=d);var h=new Z(e);return z.all(qe(e,r,h,i,!1,n,a)).then(function(){var l=r.documentElement;if("kml"===l.localName)for(var u=l.childNodes,d=0;d<u.length;d++){var p=u[d];if(c(Xt[p.localName])){l=p;break}}return t.suspendEvents(),Et(e,l,void 0,t,h,i,n,s,o,a),t.resumeEvents(),z.all(s).then(function(){return r.documentElement})})}function Pt(e,t,r,i){var n=z.defer();return G.createReader(new G.BlobReader(r),function(r){r.getEntries(function(o){for(var a,s,l=[],u={},d=0;d<o.length;d++){var h=o[d];if(!h.directory){var p=z.defer();l.push(p.promise),/\.kml$/i.test(h.filename)?c(a)&&/\//i.test(h.filename)?ve(r,h,u,p):(c(a)&&ve(r,a,u,s),a=h,s=p):ve(r,h,u,p)}}c(a)&&ge(r,a,u,s),z.all(l).then(function(){return r.close(),c(u.kml)?(u.keys=Object.keys(u),xt(e,t,u.kml,i,u)):void n.reject(new I("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function At(e,t,r,i){i=u(i,u.EMPTY_OBJECT);var n=i.sourceUri,o=i.uriResolver,a=i.context,s=c(i.query)?E(i.query):void 0,l=r;return"string"==typeof r&&(l=C(be(r,e._proxy,s)),n=u(n,r)),z(l).then(function(r){return r instanceof Blob?pe(r).then(function(i){return i?Pt(e,t,r,n):fe(r).then(function(r){r=me(r);var i,l;try{i=Lt.parseFromString(r,"application/xml")}catch(e){l=e.toString()}if(c(l)||i.body||"parsererror"===i.documentElement.tagName){var u=c(l)?l:i.documentElement.firstChild.nodeValue;throw u||(u=i.body.innerText),new I(u)}return xt(e,t,i,n,o,a,s)})}):xt(e,t,r,n,o,a,s)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),z.reject(t)})}function Dt(t){t=u(t,{});var r=t.camera,n=t.canvas;this._changed=new f,this._error=new f,this._loading=new f,this._refresh=new f,this._unsupportedNode=new f,this._clock=void 0,this._entityCollection=new Z(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new P,this._networkLinks=new e,this._entityCluster=new Q,this._canvas=n,this._camera=r,this._lastCameraView={position:c(r)?i.clone(r.positionWC):void 0,direction:c(r)?i.clone(r.directionWC):void 0,up:c(r)?i.clone(r.upWC):void 0,bbox:c(r)?r.computeViewRectangle():D.clone(D.MAX_VALUE)}}function It(e){var t=e.parent;if(c(t)){var r=t.availability;if(c(r)){var i=e.availability;c(i)?i.intersect(r):e.availability=r}}}function Ot(e,t,r,i,n){return function(o){function a(e){C.remove(e);for(var t=e._children,r=t.length,i=0;i<r;++i)a(t[i])}if(i.contains(t.id)){var s=!1,l=Pe(o,"NetworkLinkControl",Wt.kml),d=c(l),h=0;if(d){if(c(Pe(l,"Update",Wt.kml)))return x("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void i.remove(t.id);t.cookie=u(Oe(l,"cookie",Wt.kml),""),h=u(Ie(l,"minRefreshPeriod",Wt.kml),0)}var p=b.now(),f=t.refreshMode;if(f===Zt.INTERVAL)c(l)&&(t.time=Math.max(h,t.time));else if(f===Zt.EXPIRE){var m;if(c(l)&&(m=Oe(l,"expires",Wt.kml)),c(m))try{var g=b.fromIso8601(m),v=b.secondsDifference(g,p);v>0&&v<h&&b.addSeconds(p,h,g),t.time=g}catch(e){x("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else x("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var y=t.entity,C=e._entityCollection,w=r.values;C.suspendEvents();var S,T=C.values.slice();for(S=0;S<T.length;++S){var E=T[S];E.parent===y&&(E.parent=void 0,a(E))}for(C.resumeEvents(),C.suspendEvents(),S=0;S<w.length;S++){var P=w[S];c(P.parent)||(P.parent=y,It(P)),C.add(P)}C.resumeEvents(),s?i.remove(t.id):t.lastUpdated=p;var A=C.computeAvailability(),D=A.start,I=A.stop,O=b.equals(D,_.MINIMUM_VALUE),M=b.equals(I,_.MAXIMUM_VALUE);if(!O||!M){var R=e._clock;R.startTime===D&&R.stopTime===I||(R.startTime=D,R.stopTime=I,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n)}}}function Mt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}if("undefined"==typeof DOMParser)return{};var Rt={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=g(t),Rt[t]}},Lt=new DOMParser,Nt=new U({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),kt=32,Ft=2414016,Bt=1,Ut=16093e3,Vt=.1,zt=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Gt=["http://www.google.com/kml/ext/2.2"],Ht=["http://www.w3.org/2005/Atom"],Wt={kml:zt,gx:Gt,atom:Ht,kmlgx:zt.concat(Gt)},jt={},qt={Point:$e,LineString:et,LinearRing:et,Polygon:tt,Track:rt,MultiTrack:nt,MultiGeometry:ot,Model:at},Yt=document.createElement("div"),Xt={Document:ct,Folder:dt,Placemark:ht,NetworkLink:Tt,GroundOverlay:yt,PhotoOverlay:bt,ScreenOverlay:bt,Tour:pt},Qt={FlyTo:gt,Wait:mt,SoundCue:ft,AnimatedUpdate:ft,TourControl:ft},Zt={INTERVAL:0,EXPIRE:1,STOP:2},Kt=new D,Jt=new n,$t=new r,er=new i;Dt.load=function(e,t){return t=u(t,u.EMPTY_OBJECT),new Dt(t).load(e,t)},d(Dt.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}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Dt.prototype.load=function(e,t){t=u(t,{}),q.setLoading(this,!0);var r=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var i=this;return At(this,this._entityCollection,e,t).then(function(){var e,t=i._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=b.equals(n,_.MINIMUM_VALUE),u=b.equals(s,_.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=b.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=b.fromDate(c)),e=new Y,e.startTime=n,e.stopTime=s,e.currentTime=b.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(b.secondsDifference(s,n)/60,1),31556900))}var d=!1;return e!==i._clock&&(i._clock=e,d=!0),r!==i._name&&(d=!0),d&&i._changed.raiseEvent(i),q.setLoading(i,!1),i}).otherwise(function(e){return q.setLoading(i,!1),i._error.raiseEvent(i,e),console.log(e),z.reject(e)})};var tr=new e;return Dt.prototype.update=function(t){function r(e){for(var t=e._children,i=t.length,n=0;n<i;++n){var o=t[n];tr.set(o.id,o),r(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=b.now(),a=this;tr.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!c(u)||u.positionWC.equalsEpsilon(l.position,S.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,S.EPSILON7)&&u.upWC.equalsEpsilon(l.up,S.EPSILON7)||(l.position=i.clone(u.positionWC),l.direction=i.clone(u.directionWC),l.up=i.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var d=new e,h=!1;return n.values.forEach(function(e){var t=e.entity;if(!tr.contains(t.id)){if(!e.updating){var i=!1;if(e.refreshMode===Zt.INTERVAL?b.secondsDifference(o,e.lastUpdated)>e.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;v<u;++v){if(-c<=p&&p<=c&&-h<=f&&f<=h){var _=4*((h-f)*n+p+c);d.red=t.byteToFloat(s[_]),d.green=t.byteToFloat(s[_+1]),d.blue=t.byteToFloat(s[_+2]),d.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(d);if(i(y))return y}if(p===f||p<0&&-p===f||p>0&&p===1-f){var b=m;m=-g,g=b}p+=m,f+=g}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var r=t.derivedKeywords,i=r.length,n=0;n<i;++n){var o=r[n]+t.keyword;a(e,e._shaders[o])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(t){var r=t.vertexShaderSource,o=t.fragmentShaderSource,a=t.attributeLocations;"string"==typeof r&&(r=new n({sources:[r]})),"string"==typeof o&&(o=new n({sources:[o]}));var s,l=r.createCombinedVertexShader(this._context),u=o.createCombinedFragmentShader(this._context),c=l+u+JSON.stringify(a);if(e(this._shaders[c]))s=this._shaders[c],delete this._shadersToRelease[c];else{var d=this._context,h=new i({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:r,vertexShaderText:l,fragmentShaderSource:o,fragmentShaderText:u,attributeLocations:a});s={cache:this,shaderProgram:h,keyword:c,derivedKeywords:[],count:0},h._cachedShader=s,this._shaders[c]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},o.prototype.getDerivedShaderProgram=function(t,r){var i=t._cachedShader,n=r+i.keyword,o=this._shaders[n];if(e(o))return o.shaderProgram},o.prototype.createDerivedShaderProgram=function(e,t,r){var o=e._cachedShader,a=t+o.keyword,s=r.vertexShaderSource,l=r.fragmentShaderSource,u=r.attributeLocations;"string"==typeof s&&(s=new n({sources:[s]})),"string"==typeof l&&(l=new n({sources:[l]}));var c=this._context,d=s.createCombinedVertexShader(c),h=l.createCombinedFragmentShader(c),p=new i({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:s,vertexShaderText:d,fragmentShaderSource:l,fragmentShaderText:h,attributeLocations:u}),f={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0};return o.derivedKeywords.push(t),p._cachedShader=f,this._shaders[a]=f,p},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];a(this,r),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var r=t._cachedShader;r&&0==--r.count&&(this._shadersToRelease[r.keyword]=r)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return r(this)},o}),define("Renderer/UniformState",["./Sampler","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(){this.globeDepthTexture=void 0,this._viewport=new t,this._viewportCartesian4=new n,this._viewportDirty=!1,this._viewportOrthographicMatrix=p.clone(p.IDENTITY),this._viewportTransformation=p.clone(p.IDENTITY),this._model=p.clone(p.IDENTITY),this._view=p.clone(p.IDENTITY),this._inverseView=p.clone(p.IDENTITY),this._projection=p.clone(p.IDENTITY),this._infiniteProjection=p.clone(p.IDENTITY),this._entireFrustum=new r,this._currentFrustum=new r,this._frustumPlanes=new n,this._frameState=void 0,this._temeToPseudoFixed=h.clone(p.IDENTITY),this._view3DDirty=!0,this._view3D=new p,this._inverseView3DDirty=!0,this._inverseView3D=new p,this._inverseModelDirty=!0,this._inverseModel=new p,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new h,this._viewRotation=new h,this._inverseViewRotation=new h,this._viewRotation3D=new h,this._inverseViewRotation3D=new h,this._inverseProjectionDirty=!0,this._inverseProjection=new p,this._modelViewDirty=!0,this._modelView=new p,this._modelView3DDirty=!0,
  481. this._modelView3D=new p,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new p,this._inverseModelViewDirty=!0,this._inverseModelView=new p,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new p,this._viewProjectionDirty=!0,this._viewProjection=new p,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new p,this._modelViewProjectionDirty=!0,this._modelViewProjection=new p,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new p,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new p,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new p,this._normalDirty=!0,this._normal=new h,this._normal3DDirty=!0,this._normal3D=new h,this._inverseNormalDirty=!0,this._inverseNormal=new h,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new h,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new c,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new r,this._resolutionScale=1,this._orthographicIn3D=!1,this._backgroundColor=new a,this._brdfLut=new e,this._environmentMap=new e,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function y(e,t){p.clone(t,e._view),p.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function b(e,t){p.clone(t,e._inverseView),p.getRotation(t,e._inverseViewRotation)}function C(e,t){p.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function w(e,t){p.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function S(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function T(e,t){l(g.computeIcrfToFixedMatrix(t.time,q))||(q=g.computeTemeToPseudoFixedMatrix(t.time,q));var r=m.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);h.multiplyByVector(q,r,r),i.normalize(r,e._sunDirectionWC),r=h.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=m.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),h.multiplyByVector(q,r,r),h.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,o=n.ellipsoid,a=o.cartesianToCartographic(e._sunPositionWC,Y);n.project(a,e._sunPositionColumbusView)}function E(e){if(e._viewportDirty){var t=e._viewport;p.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),p.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function x(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===v.SCENE2D||e._mode===v.MORPHING||e._orthographicIn3D?p.clone(p.ZERO,e._inverseProjection):p.inverse(e._projection,e._inverseProjection))}function P(e){e._modelViewDirty&&(e._modelViewDirty=!1,p.multiplyTransformation(e._view,e._model,e._modelView))}function A(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,p.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function D(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,p.inverse(e.modelView,e._inverseModelView))}function I(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,p.inverse(e.modelView3D,e._inverseModelView3D))}function O(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,p.multiply(e._projection,e._view,e._viewProjection))}function M(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,p.inverse(e.viewProjection,e._inverseViewProjection))}function R(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,p.multiply(e._projection,e.modelView,e._modelViewProjection))}function L(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,r=e._modelViewRelativeToEye;r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function N(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,p.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function k(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,p.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function F(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,p.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function B(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;p.getRotation(e.inverseModelView,t),h.transpose(t,t)}}function U(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;p.getRotation(e.inverseModelView3D,t),h.transpose(t,t)}}function V(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,p.getRotation(e.inverseModelView,e._inverseNormal))}function z(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,p.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function G(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,p.multiplyByPoint(e.inverseModel,e._cameraPosition,X),c.fromCartesian(X,e._encodedCameraPositionMC))}function H(e,t,r,n,o,a,s,u){var c=Q;c.x=e.y,c.y=e.z,c.z=e.x;var h=Z;h.x=r.y,h.y=r.z,h.z=r.x;var f=K;f.x=n.y,f.y=n.z,f.z=n.x;var m=J;m.x=t.y,m.y=t.z,m.z=t.x,a===v.SCENE2D&&(c.z=.5*o);var _=s.unproject(c,$);_.longitude=d.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=d.clamp(_.latitude,-d.PI_OVER_TWO,d.PI_OVER_TWO);var y=s.ellipsoid,b=y.cartographicToCartesian(_,ee),C=g.eastNorthUpToFixedFrame(b,y,te);return p.multiplyByPointAsVector(C,h,h),p.multiplyByPointAsVector(C,f,f),p.multiplyByPointAsVector(C,m,m),l(u)||(u=new p),u[0]=h.x,u[1]=f.x,u[2]=-m.x,u[3]=0,u[4]=h.y,u[5]=f.y,u[6]=-m.y,u[7]=0,u[8]=h.z,u[9]=f.z,u[10]=-m.z,u[11]=0,u[12]=-i.dot(h,b),u[13]=-i.dot(f,b),u[14]=i.dot(m,b),u[15]=1,u}function W(e){e._view3DDirty&&(e._mode===v.SCENE3D?p.clone(e._view,e._view3D):H(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),p.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function j(e){e._inverseView3DDirty&&(p.inverseTransformation(e.view3D,e._inverseView3D),p.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}u(_.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!t.equals(e,this._viewport)){t.clone(e,this._viewport);var r=this._viewport,i=this._viewportCartesian4;i.x=r.x,i.y=r.y,i.z=r.width,i.w=r.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return E(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return E(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){p.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,p.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,p.getRotation(this.inverseModel,e),h.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return W(this),this._view3D}},viewRotation:{get:function(){return W(this),this._viewRotation}},viewRotation3D:{get:function(){return W(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return j(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return j(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return x(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return P(this),this._modelView}},modelView3D:{get:function(){return A(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return L(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return D(this),this._inverseModelView}},inverseModelView3D:{get:function(){return I(this),this._inverseModelView3D}},viewProjection:{get:function(){return O(this),this._viewProjection}},inverseViewProjection:{get:function(){return M(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return R(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return N(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return k(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return F(this),this._modelViewInfiniteProjection}},normal:{get:function(){return B(this),this._normal}},normal3D:{get:function(){return U(this),this._normal3D}},inverseNormal:{get:function(){return V(this),this._inverseNormal}},inverseNormal3D:{get:function(){return z(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return G(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return G(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}}});var q=new h,Y=new o;_.prototype.updateCamera=function(e){y(this,e.viewMatrix),b(this,e.inverseViewMatrix),S(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==v.SCENE2D&&e.frustum instanceof f},_.prototype.updateFrustum=function(e){C(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&w(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,l(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},_.prototype.updatePass=function(e){this._pass=e},_.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var r=e.camera;this.updateCamera(r),e.mode===v.SCENE2D?(this._frustum2DWidth=r.frustum.right-r.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),T(this,e);var i=e.brdfLutGenerator,n=l(i)?i.colorTexture:void 0;this._brdfLut=n,this._environmentMap=s(e.environmentMap,e.context.defaultCubeMap),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=g.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*e.context.drawingBufferWidth;var o,u=r.frustum.fov,c=this._viewport;o=c.height>c.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<r.length;++o)0!==o&&(n+=", "),n+=r[o];return n+=");"}function M(e,t,r){var i=e.getError();if(i!==e.NO_ERROR)throw new f(O(e,t,r,i))}function R(e,t,r){return{get:function(){var i=e[t];return r(e,"get: "+t,i),e[t]},set:function(i){e[t]=i,r(e,"set: "+t,i)}}}function L(e,t){if(!a(t))return e;var r={};for(var i in e){var n=e[i];n instanceof Function?r[i]=function(r){return function(){var i=r.apply(e,arguments);return t(e,r,arguments),i}}(n):Object.defineProperty(r,i,R(e,i,t))}return r}function N(e,t){for(var r=t.length,i=0;i<r;++i){var n=e.getExtension(t[i]);if(n)return n}}function k(e,i){if("undefined"==typeof WebGLRenderingContext)throw new f("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=e,i=t(i,!0),i=o(i,{}),i.allowTextureFilterAnisotropic=o(i.allowTextureFilterAnisotropic,!0);var s=o(i.webgl,{});s.alpha=o(s.alpha,!1),s.stencil=o(s.stencil,!0);var l,u=o(i.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext,c=!1,d=i.getWebGLStub;if(a(d))l=d(e,s);else if(u&&(l=e.getContext("webgl2",s)||e.getContext("experimental-webgl2",s)||void 0,a(l)&&(c=!0)),a(l)||(l=e.getContext("webgl",s)||e.getContext("experimental-webgl",s)||void 0),!a(l))throw new f("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=c,this._id=n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new E(this);var h=l;this._stencilBits=h.getParameter(h.STENCIL_BITS),y._maximumCombinedTextureImageUnits=h.getParameter(h.MAX_COMBINED_TEXTURE_IMAGE_UNITS),y._maximumCubeMapSize=h.getParameter(h.MAX_CUBE_MAP_TEXTURE_SIZE),y._maximumFragmentUniformVectors=h.getParameter(h.MAX_FRAGMENT_UNIFORM_VECTORS),y._maximumTextureImageUnits=h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS),y._maximumRenderbufferSize=h.getParameter(h.MAX_RENDERBUFFER_SIZE),y._maximumTextureSize=h.getParameter(h.MAX_TEXTURE_SIZE),y._maximumVaryingVectors=h.getParameter(h.MAX_VARYING_VECTORS),y._maximumVertexAttributes=h.getParameter(h.MAX_VERTEX_ATTRIBS),y._maximumVertexTextureImageUnits=h.getParameter(h.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y._maximumVertexUniformVectors=h.getParameter(h.MAX_VERTEX_UNIFORM_VECTORS);var p=h.getParameter(h.ALIASED_LINE_WIDTH_RANGE);y._minimumAliasedLineWidth=p[0],y._maximumAliasedLineWidth=p[1];var g=h.getParameter(h.ALIASED_POINT_SIZE_RANGE);y._minimumAliasedPointSize=g[0],y._maximumAliasedPointSize=g[1];var v=h.getParameter(h.MAX_VIEWPORT_DIMS);y._maximumViewportWidth=v[0],y._maximumViewportHeight=v[1];var _=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_FLOAT);y._highpFloatSupported=0!==_.precision;var b=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_INT);y._highpIntSupported=0!==b.rangeMax,this._antialias=h.getContextAttributes().antialias,this._standardDerivatives=!!N(h,["OES_standard_derivatives"]),this._blendMinmax=!!N(h,["EXT_blend_minmax"]),this._elementIndexUint=!!N(h,["OES_element_index_uint"]),this._depthTexture=!!N(h,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(h,["OES_texture_float"]),this._fragDepth=!!N(h,["EXT_frag_depth"]),this._debugShaders=N(h,["WEBGL_debug_shaders"]),this._colorBufferFloat=this._webgl2&&!!N(h,["EXT_color_buffer_float"]),this._s3tc=!!N(h,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!N(h,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!N(h,["WEBGL_compressed_texture_etc1"]);var C=i.allowTextureFilterAnisotropic?N(h,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=C,y._maximumTextureFilterAnisotropy=a(C)?h.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var S,x,P,D,I,O,M,R,L,k;if(c){var F=this;S=function(){return F._gl.createVertexArray()},x=function(e){F._gl.bindVertexArray(e)},P=function(e){F._gl.deleteVertexArray(e)},D=function(e,t,r,i,n){h.drawElementsInstanced(e,t,r,i,n)},I=function(e,t,r,i){h.drawArraysInstanced(e,t,r,i)},O=function(e,t){h.vertexAttribDivisor(e,t)},M=function(e){h.drawBuffers(e)}}else R=N(h,["OES_vertex_array_object"]),a(R)&&(S=function(){return R.createVertexArrayOES()},x=function(e){R.bindVertexArrayOES(e)},P=function(e){R.deleteVertexArrayOES(e)}),L=N(h,["ANGLE_instanced_arrays"]),a(L)&&(D=function(e,t,r,i,n){L.drawElementsInstancedANGLE(e,t,r,i,n)},I=function(e,t,r,i){L.drawArraysInstancedANGLE(e,t,r,i)},O=function(e,t){L.vertexAttribDivisorANGLE(e,t)}),k=N(h,["WEBGL_draw_buffers"]),a(k)&&(M=function(e){k.drawBuffersWEBGL(e)});this.glCreateVertexArray=S,this.glBindVertexArray=x,this.glDeleteVertexArray=P,this.glDrawElementsInstanced=D,this.glDrawArraysInstanced=I,this.glVertexAttribDivisor=O,this.glDrawBuffers=M,this._vertexArrayObject=!!R,this._instancedArrays=!!L,this._drawBuffers=!!k,y._maximumDrawBuffers=this.drawBuffers?h.getParameter(m.MAX_DRAW_BUFFERS):1,y._maximumColorAttachments=this.drawBuffers?h.getParameter(m.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new r(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var B=new A,U=new w(this),V=T.fromCache();this._defaultPassState=U,this._defaultRenderState=V,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=B,this._currentRenderState=V,this._currentPassState=U,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var z=0;z<y._maximumVertexAttributes;z++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=i,this.cache={},T.apply(h,V,U)}function F(e){}function B(e,t,r,i){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=r,T.partialApply(e._gl,n,t,o,r,i)}function U(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=W;if(a(t))t._bind(),F(e),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(r)}}function V(e,t,r,i){var n=o(r._renderState,e._defaultRenderState);U(e,t),B(e,n,i,!1);var a=r._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function z(e,t){var r=t._primitiveType,i=t._vertexArray,n=t._offset,s=t._count,l=t.instanceCount;e._us.model=o(t._modelMatrix,h.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),i._bind();var u=i.indexBuffer;a(u)?(n*=u.bytesPerIndex,s=o(s,u.numberOfIndices),0===l?e._gl.drawElements(r,s,u.indexDatatype,n):e.glDrawElementsInstanced(r,s,u.indexDatatype,n,l)):(s=o(s,i.numberOfVertices),0===l?e._gl.drawArrays(r,n,s):e.glDrawArraysInstanced(r,n,s,l)),i._unBind()}function G(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var H={};s(k.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives||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;i<r;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return U(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var q={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!a(e)){var t=new c({attributes:{position:new d({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new d({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:p.TRIANGLES});e=D.fromGeometry({context:this,geometry:t,attributeLocations:q,bufferUsage:v.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=o(t,o.EMPTY_OBJECT),new C({vertexArray:this.getViewportQuadVertexArray(),primitiveType:p.TRIANGLES,renderState:t.renderState,shaderProgram:x.fromCache({context:this,vertexShaderSource:g,fragmentShaderSource:e,attributeLocations:q}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},k.prototype.createPickFramebuffer=function(){return new S(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},s(G.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),G.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new f("Out of unique Pick IDs.");return this._pickObjects[t]=e,new G(this._pickObjects,t,r.fromRgba(t))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];a(r.destroy)&&r.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),l(this)},k}),define("Renderer/loadCubeMap",["../Core/Check","../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){var a=[i(t.positiveX,r),i(t.negativeX,r),i(t.positiveY,r),i(t.negativeY,r),i(t.positiveZ,r),i(t.negativeZ,r)];return n.all(a,function(t){return new o({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return a}),define("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(r){function a(e){t(e.blob)&&(l._missingImageByteLength=e.blob.size);var n=i(e);if(r.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=r.pixelsToCheck,u=0,c=s.length;o&&u<c;++u){var d=s[u];n[4*d.x+d.y*a+3]>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}r=e(r,e.EMPTY_OBJECT),this._pixelsToCheck=r.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(r.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var r=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=i(e),a=e.width,s=0,l=r.length;s<l;++s)for(var u=r[s],c=4*u.x+u.y*a,d=0;d<4;++d){var h=c+d;if(o[h]!==n[h])return!1}return!0},a}),define("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var r,i=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();i>1&&"name"===o?(i=1,r=n):i>2&&"title"===o?(i=2,r=n):i>3&&/name/i.test(n)?(i=3,r=n):i>4&&/title/i.test(n)&&(i=4,r=n)}e(r)&&(this.name=t[r])},t.prototype.configureDescriptionFromProperties=function(t){function r(t){var i='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"<tr><td>"+n+"</td><td>"+r(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return i+="</table>"}this.description=r(t)},t}),define("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadImage","../Core/loadImageViaBlob","../Core/loadKTX"],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}),
  482. 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;a<n.length;++a){var s=n[a],l=new b;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=r.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new g;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}i.push(l)}return i})}},w}),define("Scene/Cesium3DTileColorBlendMode",["../Core/freezeObject"],function(e){"use strict";return e({HIGHLIGHT:0,REPLACE:1,MIX:2})}),define("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t,r=e.componentType;t="string"==typeof r?i.fromName(r):r;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,r,o){return i.createArrayBufferView(t,e,r,n*o)}}}var l={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={SCALAR:void 0,VEC2:e,VEC3:t,VEC4:r,MAT2:n,MAT3:o,MAT4:a};return s}),define("Scene/Cesium3DTileBatchTable",["../Core/arrayFill","../Core/Cartesian2","../Core/Cartesian4","../Core/Check","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/RuntimeError","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","./AttributeType","./BlendingState","./Cesium3DTileColorBlendMode","./CullFace","./getBinaryAccessor","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,T,E,x,P,A,D,I,O,M){"use strict";function R(e,i,n,o){this.featuresLength=i,this._translucentFeaturesLength=0,this.batchTableJson=n,this.batchTableBinary=o;var a,s;u(n)&&(a=n.HIERARCHY,u(a)&&(delete n.HIERARCHY,a=L(a,o)),s=R.getBinaryProperties(i,n,o)),this._batchTableHierarchy=a,this._batchTableBinaryProperties=s,this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],this._content=e;var l,c;if(i>0){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;i<c;++i)g[i]=m,m+=p[i];u(f)&&u(f.byteOffset)&&(f.componentType=l(f.componentType,s.UNSIGNED_SHORT),f.type=x.SCALAR,o=I(f),f=o.createArrayBufferView(r.buffer,r.byteOffset+f.byteOffset,m));var v=d.length;for(i=0;i<v;++i){var _=d[i].length,y=d[i].instances,b=R.getBinaryProperties(_,y,r);d[i].instances=a(b,y)}var C=e(new Array(v),0),w=new Uint16Array(c);for(i=0;i<c;++i)n=h[i],w[i]=C[n],++C[n];return{classes:d,classIds:h,classIndexes:w,parentCounts:p,parentIndexes:g,parentIds:f}}function N(e){var t=e._textureDimensions;return t.x*t.y*4}function k(t){if(!u(t._batchValues)){var r=N(t),i=new Uint8Array(r);e(i,255),t._batchValues=i}return t._batchValues}function F(t){if(!u(t._showAlphaProperties)){var r=2*t.featuresLength,i=new Uint8Array(r);e(i,255),t._showAlphaProperties=i}return t._showAlphaProperties}function B(e,t){var r=e.typedArray,i=e.componentCount;return 1===i?r[t]:e.type.unpack(r,t*i)}function U(e,t,r){var i=e.typedArray,n=e.componentCount;1===n?i[t]=r:e.type.pack(r,i,t*n)}function V(e,t,r){var i=e.classIds,n=e.parentCounts,o=e.parentIds,a=e.parentIndexes,s=i.length,l=ce;l.length=Math.max(l.length,s);var c=++he,d=de;for(d.length=0,d.push(t);d.length>0;)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;m<p;++m){var g=o[f+m];g!==t&&d.push(g)}}}function z(e,t,r){for(var i=!0;i;){var n=r(e,t);if(u(n))return n;var o=e.parentIds[t];i=o!==t,t=o}}function G(e,t,r){var i=e.parentCounts,n=e.parentIds;return u(n)?u(i)?V(e,t,r):z(e,t,r):r(e,t)}function H(e,t,r){var i=e._batchTableHierarchy,n=G(i,t,function(e,t){var i=e.classIds[t],n=e.classes[i].instances;if(u(n[r]))return!0});return u(n)}function W(e,t,r){G(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],n=e.classes[i].instances;for(var o in n)n.hasOwnProperty(o)&&-1===r.indexOf(o)&&r.push(o)})}function j(e,t,r){return G(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],o=e.classes[i],a=e.classIndexes[t],s=o.instances[r];if(u(s))return u(s.typedArray)?B(s,a):n(s[a],!0)})}function q(e,t,r,i){var o=e._batchTableHierarchy,a=G(o,t,function(e,t){var o=e.classIds[t],a=e.classes[o],s=e.classIndexes[t],l=a.instances[r];if(u(l))return u(l.typedArray)?U(l,s,i):l[s]=n(i,!0),!0});return u(a)}function Y(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function X(e){return(e=w.replaceMain(e,"tile_main"))+"void tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n gl_FragColor *= tile_featureColor; \n} \n"}function Q(e,t){if(!u(t))return X(e);var r=new RegExp("uniform\\s+(vec[34]|sampler2D)\\s+"+t+";"),i=e.match(r);if(!u(i))return X(e);var n=i[0],o=i[1];e=w.replaceMain(e,"tile_main"),e=e.replace(n,"");var a;if("vec3"===o||"vec4"===o){var s="vec3"===o?"vec4("+t+", 1.0)":t,l="vec3"===o?"tile_diffuse.xyz":"tile_diffuse";r=new RegExp(t,"g"),e=e.replace(r,l),a=" vec4 source = "+s+"; \n tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n tile_main(); \n"}else"sampler2D"===o&&(r=new RegExp("texture2D\\("+t+".*?\\)","g"),e=e.replace(r,"tile_diffuse_final($&, tile_diffuse)"),a=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = (tileDiffuse.rgb == vec3(1.0)) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+n+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+a+" gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n"}function Z(e){var t=e._content._tileset,r=t.colorBlendMode,i=t.colorBlendAmount;return r===A.HIGHLIGHT?0:r===A.REPLACE?1:r===A.MIX?p.clamp(i,p.EPSILON4,1):void 0}function K(e,t){e.castShadows=t.castShadows,e.receiveShadows=t.receiveShadows,e.primitiveType=t.primitiveType}function J(e){var t=e._translucentFeaturesLength;return 0===t?pe.ALL_OPAQUE:t===e.featuresLength?pe.ALL_TRANSLUCENT:pe.OPAQUE_AND_TRANSLUCENT}function $(e){var t=v.shallowClone(e),r=t.pass===_.TRANSLUCENT;return t.uniformMap=u(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return r},t}function ee(e){var t=v.shallowClone(e);return t.pass=_.TRANSLUCENT,t.renderState=ie(e.renderState),t}function te(e){var t=v.shallowClone(e),r=n(t.renderState,!0);return r.cull.enabled=!0,r.cull.face=D.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},t.renderState=b.fromCache(r),t.castShadows=!1,t.receiveShadows=!1,t}function re(e,t){var r=e;if(e.renderState.depthMask){r=v.shallowClone(e);var i=n(r.renderState,!0);i.stencilTest.enabled=!0,i.stencilTest.mask=240,i.stencilTest.reference=t<<4,i.stencilTest.frontFunction=O.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=M.REPLACE,r.renderState=b.fromCache(i)}return r}function ie(e){var t=n(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=P.ALPHA_BLEND,b.fromCache(t)}function ne(e,t,r){var i=e._textureDimensions;return new S({context:t,pixelFormat:f.RGBA,pixelDatatype:y.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:r},sampler:new C({minificationFilter:E.NEAREST,magnificationFilter:T.NEAREST})})}function oe(e,t){var r=e.featuresLength;if(!u(e._pickTexture)&&r>0){for(var i=e._pickIds,n=N(e),a=new Uint8Array(n),s=e._content,l=0;l<r;++l){var c=t.createPickId(s.getFeature(l));i.push(c);var d=c.color,h=4*l;a[h]=o.floatToByte(d.red),a[h+1]=o.floatToByte(d.green),a[h+2]=o.floatToByte(d.blue),a[h+3]=o.floatToByte(d.alpha)}e._pickTexture=ne(e,t,a),s._tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function ae(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}var se=o.WHITE;c(R.prototype,{memorySizeInBytes:{get:function(){var e=0;return u(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),u(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}}),R.getBinaryProperties=function(e,t,r){var i;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=o.byteOffset;if(u(a)){var s=o.componentType,l=o.type;if(!u(s))throw new m("componentType is required.");if(!u(l))throw new m("type is required.");if(!u(r))throw new m("Property "+n+" requires a batch table binary.");var c=I(o),d=c.componentsPerAttribute,h=c.classType,p=c.createArrayBufferView(r.buffer,r.byteOffset+a,e);u(i)||(i={}),i[n]={typedArray:p,componentCount:d,type:h}}}return i},R.prototype.setShow=function(e,t){if(!t||u(this._showAlphaProperties)){var r=F(this),i=2*e,n=t?255:0;if(r[i]!==n){r[i]=n;k(this)[4*e+3]=t?r[i+1]:0,this._batchValuesDirty=!0}}},R.prototype.setAllShow=function(e){for(var t=this.featuresLength,r=0;r<t;++r)this.setShow(r,e)},R.prototype.getShow=function(e){if(!u(this._showAlphaProperties))return!0;var t=2*e;return 255===this._showAlphaProperties[t]};var le=new Array(4);R.prototype.setColor=function(e,t){if(!o.equals(t,se)||u(this._batchValues)){var r=t.toBytes(le),i=r[3],n=k(this),a=4*e,s=F(this),l=2*e;if(n[a]!==r[0]||n[a+1]!==r[1]||n[a+2]!==r[2]||s[l+1]!==i){n[a]=r[0],n[a+1]=r[1],n[a+2]=r[2];var c=255!==s[l+1],d=0!==s[l];n[a+3]=d?i:0,s[l+1]=i;var h=255!==i;h&&!c?++this._translucentFeaturesLength:!h&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0}}},R.prototype.setAllColor=function(e){for(var t=this.featuresLength,r=0;r<t;++r)this.setColor(r,e)},R.prototype.getColor=function(e,t){if(!u(this._batchValues))return o.clone(se,t);var r=this._batchValues,i=4*e,n=this._showAlphaProperties,a=2*e;return o.fromBytes(r[i],r[i+1],r[i+2],n[a+1],t)};var ue=new o;R.prototype.applyStyle=function(e,t){if(!u(t))return this.setAllColor(se),void this.setAllShow(!0);for(var r=this._content,i=this.featuresLength,n=0;n<i;++n){var o=r.getFeature(n),a=u(t.color)?t.color.evaluateColor(e,o,ue):se,s=!u(t.show)||t.show.evaluate(e,o);this.setColor(n,a),this.setShow(n,s)}};var ce=[],de=[],he=0;R.prototype.isClass=function(e,t){var r=this._batchTableHierarchy;if(!u(r))return!1;var i=G(r,e,function(e,r){var i=e.classIds[r];if(e.classes[i].name===t)return!0});return u(i)},R.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},R.prototype.getExactClassName=function(e){var t=this._batchTableHierarchy;if(u(t)){var r=t.classIds[e];return t.classes[r].name}},R.prototype.hasProperty=function(e,t){var r=this.batchTableJson;return u(r)&&u(r[t])||u(this._batchTableHierarchy)&&H(this,e,t)},R.prototype.getPropertyNames=function(e,t){t=u(t)?t:[],t.length=0;var r=this.batchTableJson;for(var i in r)r.hasOwnProperty(i)&&t.push(i);return u(this._batchTableHierarchy)&&W(this,e,t),t},R.prototype.getProperty=function(e,t){if(u(this.batchTableJson)){if(u(this._batchTableBinaryProperties)){var r=this._batchTableBinaryProperties[t];if(u(r))return B(r,e)}var i=this.batchTableJson[t];if(u(i))return n(i[e],!0);if(u(this._batchTableHierarchy)){var o=j(this,e,t);if(u(o))return o}}},R.prototype.setProperty=function(e,t,r){var i=this.featuresLength;if(u(this._batchTableBinaryProperties)){var o=this._batchTableBinaryProperties[t];if(u(o))return void U(o,e,r)}if(!u(this._batchTableHierarchy)||!q(this,e,t,r)){u(this.batchTableJson)||(this.batchTableJson={});var a=this.batchTableJson[t];u(a)||(this.batchTableJson[t]=new Array(i),a=this.batchTableJson[t]),a[e]=n(r,!0)}},R.prototype.getVertexShaderCallback=function(e,t){if(0!==this.featuresLength){var r=this;return function(i){var n,o=w.replaceMain(i,"tile_main");return g.maximumVertexTextureImageUnits>0?(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<n;++c){var d=i[c],h=d.derivedCommands.tileset;u(h)||(h={},d.derivedCommands.tileset=h,h.originalCommand=$(d)),K(h.originalCommand,d),l!==pe.ALL_OPAQUE&&(u(h.translucent)||(h.translucent=ee(h.originalCommand)),K(h.translucent,d)),s&&(d.pass===_.TRANSLUCENT||r||(u(h.zback)||(h.zback=te(h.originalCommand)),a._backfaceCommands.push(h.zback)),u(h.stencil)&&o._selectionDepth===o._lastSelectionDepth||(h.stencil=re(h.originalCommand,o._selectionDepth),o._lastSelectionDepth=o._selectionDepth),K(h.stencil,d));var p=s?h.stencil:h.originalCommand,f=h.translucent;d.pass!==_.TRANSLUCENT?(l===pe.ALL_OPAQUE&&(i[c]=p),l===pe.ALL_TRANSLUCENT&&(i[c]=f),l===pe.OPAQUE_AND_TRANSLUCENT&&(i[c]=p,i.push(f))):i[c]=p}},R.prototype.update=function(e,t){var r=t.context;this._defaultTexture=r.defaultTexture,t.passes.pick&&oe(this,r),this._batchValuesDirty&&(this._batchValuesDirty=!1,u(this._batchTexture)||(this._batchTexture=ne(this,r,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),ae(this))},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,r=0;r<t;++r)e[r].destroy();return d(this)},R});define("Scene/Cesium3DTileFeature",["../Core/Color","../Core/defined","../Core/defineProperties"],function(e,t,r){"use strict";function i(e,t,r){this._content=t,this._batchId=r,this._color=void 0}return r(i.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return t(this._color)||(this._color=new e),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}}}),i.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},i.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},i.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},i.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},i.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},i.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},i.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},i}),define("Scene/Cesium3DTileFeatureTable",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined"],function(e,t,r){"use strict";function i(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function n(t,i,n,o,a,s){var l=t._cachedTypedArrays,u=l[i];return r(u)||(u=e.createArrayBufferView(n,t.buffer.buffer,t.buffer.byteOffset+s,a*o),l[i]=u),u}function o(t,i,n,o){var a=t._cachedTypedArrays,s=a[i];return r(s)||(s=e.createTypedArray(n,o),a[i]=s),s}return i.prototype.getGlobalProperty=function(i,o,a){var s=this.json[i];if(r(s))return r(s.byteOffset)?(o=t(o,e.UNSIGNED_INT),a=t(a,1),n(this,i,o,a,1,s.byteOffset)):s},i.prototype.getPropertyArray=function(t,i,a){var s=this.json[t];if(r(s))return r(s.byteOffset)?(r(s.componentType)&&(i=e.fromName(s.componentType)),n(this,t,i,a,this.featuresLength,s.byteOffset)):o(this,t,i,s)},i.prototype.getProperty=function(e,t,i,n,o){var a=this.json[e];if(r(a)){var s=this.getPropertyArray(e,t,i);if(1===i)return s[n];for(var l=0;l<i;++l)o[l]=s[i*n+l];return o}},i}),define("Scene/Batched3DModel3DTileContent",["../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getStringFromTypedArray","../Core/RequestType","../Core/RuntimeError","../Renderer/Pass","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./getAttributeOrUniformBySemantic","./Model"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(e,t,r,i,n){this._tileset=e,this._tile=t,this._url=r,this._model=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,E(this,i,n)}function C(e){var t=_(e,"_BATCHID");return i(t)||(t=_(e,"BATCHID"),i(t)&&b._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),t}function w(e){return function(t){var r=e._batchTable,n=e._model.gltf,o=C(n),a=r.getVertexShaderCallback(!0,o);return i(a)?a(t):t}}function S(e){return function(t){var r=e._batchTable,n=e._model.gltf,o=C(n),a=r.getPickVertexShaderCallback(o);return i(a)?a(t):t}}function T(e){return function(t){var r=e._batchTable,n=e._model.gltf,o=_(n,"_3DTILESDIFFUSE"),a=r.getFragmentShaderCallback(!0,o);return i(a)?a(t):t}}function E(e,t,i){var n=e._tileset,o=e._tile,a=u(c(e._url,!0)),s=r(i,0);i=s;var l=new Uint8Array(t),g=new DataView(t);i+=P;var _=g.getUint32(i,!0);if(1!==_)throw new p("Only Batched 3D Model version 1 is supported. Version "+_+" is not.");i+=P;var C=g.getUint32(i,!0);i+=P;var E=g.getUint32(i,!0);i+=P;var x=g.getUint32(i,!0);i+=P;var A=g.getUint32(i,!0);i+=P;var D=g.getUint32(i,!0);i+=P;var I;A>=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<r;++o)n[o]=new g(t,e,o);e._features=n}}if(!l.supportsTypedArrays())return{};b._deprecationWarning=o,n(b.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){
  483. return this._tile}},url:{get:function(){return this._url}},batchTable:{get:function(){return this._batchTable}}});var P=Uint32Array.BYTES_PER_ELEMENT;return b.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},b.prototype.getFeature=function(e){return x(this),this._features[e]},b.prototype.applyDebugSettings=function(e,r){r=e?r:t.WHITE,0===this.featuresLength?this._model.color=r:this._batchTable.setAllColor(r)},b.prototype.applyStyle=function(e,t){this._batchTable.applyStyle(e,t)},b.prototype.update=function(e,t){var r=t.commandList.length;if(this._batchTable.update(e,t),this._model.modelMatrix=this._tile.computedTransform,this._model.shadows=this._tileset.shadows,this._model.debugWireframe=this._tileset.debugWireframe,this._model.update(t),r<t.commandList.length&&t.passes.render){var i=this._tile._finalResolution;this._batchTable.addDerivedCommands(t,r,i)}},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),a(this)},b}),define("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";return e({AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"})}),define("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(o){function a(e){var i=e.resourceSets[0].resources[0];S._tileWidth=i.imageWidth,S._tileHeight=i.imageHeight,S._maximumLevel=i.zoomMax-1,S._imageUrlSubdomains=i.imageUrlSubdomains,S._imageUrlTemplate=i.imageUrl.replace("{culture}",S._culture);var o=S._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}S._imageUrlTemplate=S._imageUrlTemplate.replace(/^http:/,o),n(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new g({missingImageUrl:y(S,0,0,S._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=S._attributionList=i.imageryProviders;s||(s=S._attributionList=[]);for(var l=0,d=s.length;l<d;++l){var p=s[l];p.credit=new r(p.attribution);for(var f=p.coverageAreas,m=0,v=p.coverageAreas.length;m<v;++m){var _=f[m],b=_.bbox;_.bbox=new c(u.toRadians(b[1]),u.toRadians(b[0]),u.toRadians(b[3]),u.toRadians(b[2]))}}S._ready=!0,S._readyPromise.resolve(!0),h.handleSuccess(C)}function v(e){var t="An error occurred while accessing "+w+".";C=h.handleError(C,S,S._errorEvent,t,void 0,void 0,void 0,b),S._readyPromise.reject(new d(t))}function b(){var e=l(w,{callbackParameterName:"jsonp",proxy:S._proxy});f(e,a,v)}o=i(o,{}),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=i(o.mapStyle,m.AERIAL),this._culture=i(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new r("Bing Imagery",_._logoData,"http://www.bing.com"),this.defaultGamma=1,this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=f.defer();var C,w=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,S=this;b()}function y(e,t,r,i){var o=e._imageUrlTemplate,a=_.tileXYToQuadKey(t,r,i);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+r+i)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function b(e,t,r){++t;for(var i=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,d=0,h=s.coverageAreas.length;!u&&d<h;++d){var p=l[d];if(t>=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(r,p.bbox,w);n(f)&&(u=!0)}}u&&i.push(s.credit)}return i}o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var C=new c;_.prototype.getTileCredits=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(e,t,r,C),o=b(this._attributionList,r,i);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},_.prototype.requestImage=function(e,t,r,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<<n,a=0;0!=(e&o)&&(a|=1),0!=(t&o)&&(a|=2),i+=a}return i},_.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];0!=(1&a)&&(t|=o),0!=(2&a)&&(r|=o)}return{x:t,y:r,level:i}};var w=new c;return _}),define("Scene/BoxEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(t){t=r(t,a),this._dimensions=e.clone(t)}var a=new e(1,1,1);i(o.prototype,{dimensions:{get:function(){return this._dimensions},set:function(t){e.clone(t,this._dimensions)}}});var s=new e;return o.prototype.emit=function(t){var r=this._dimensions,i=e.multiplyByScalar(r,.5,s),o=n.randomBetween(-i.x,i.x),a=n.randomBetween(-i.y,i.y),l=n.randomBetween(-i.z,i.z);t.position=e.fromElements(o,a,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Shaders/BrdfLutGeneratorFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 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(u<l){var y=-Math.pow(1e6*(l-i),1/8),b=Math.pow(1e6*(l-o),1/8);return function(e){var t=e*(b-y)+y;return-Math.pow(t,8)/1e6+l}}return function(e){return s.lerp(i,o,e)}}function f(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function m(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(g,o,r),pitch:s.lerp(m,a,r),roll:s.lerp(v,l,r)}}),e.lerp(h,n,r,d.position),d.position.z=_(r)}var d=r.camera,h=t.clone(d.position,E),m=d.pitch,g=f(d.heading,o),v=f(d.roll,l),_=p(d,n,h.z,n.z,u);return c}function g(e,t){e.longitude<t.longitude?e.longitude+=s.TWO_PI:t.longitude+=s.TWO_PI}function v(e,t){var r=e.longitude-t.longitude;r<-s.PI?e.longitude+=s.TWO_PI:r>s.PI&&(t.longitude+=s.TWO_PI)}function _(e,i,o,a,l,u,c,d,m,_){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.EPSILON10&&(i.clone(i.UNIT_Y,d),i.clone(i.UNIT_Z,h))}r.cross(h,u,d),r.normalize(d,d),r.cross(u,d,h),r.normalize(h,h),y.setColumn(e._actualTransform,0,d,e._actualTransform),y.setColumn(e._actualTransform,1,h,e._actualTransform),y.setColumn(e._actualTransform,2,u,e._actualTransform),y.setColumn(e._actualTransform,3,l,e._actualTransform)}function L(e){var t=e._mode,i=!1,n=0;t===D.SCENE2D&&(n=e.frustum.right-e.frustum.left,i=n!==e._positionCartographic.height);var o=e._position,a=!r.equals(o,e.position)||i;a&&(o=r.clone(e.position,e._position));var s=e._direction,l=!r.equals(s,e.direction);l&&(r.normalize(e.direction,e.direction),s=r.clone(e.direction,e._direction));var u=e._up,c=!r.equals(u,e.up);c&&(r.normalize(e.up,e.up),u=r.clone(e.up,e._up));var d=e._right,h=!r.equals(d,e.right);h&&(r.normalize(e.right,e.right),d=r.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(y.inverseTransformation(e._transform,e._invTransform),e._mode===D.COLUMBUS_VIEW||e._mode===D.SCENE2D?y.equals(y.IDENTITY,e._transform)?y.clone(I.TRANSFORM_2D,e._actualTransform):e._mode===D.COLUMBUS_VIEW?M(e):R(e):y.clone(e._transform,e._actualTransform),y.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||p)if(e._positionWC=y.multiplyByPoint(f,o,e._positionWC),t===D.SCENE3D||t===D.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var m=be;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===D.SCENE2D&&(m.z=n),e._projection.unproject(m,e._positionCartographic)}if(l||c||h){var g=r.dot(s,r.cross(u,d,be));if(Math.abs(1-g)>v.EPSILON2){var _=1/r.magnitudeSquared(u),b=r.dot(u,s)*_,C=r.multiplyByScalar(s,b,be);u=r.normalize(r.subtract(u,C,e._up),e._up),r.clone(u,e.up),d=r.cross(s,u,e._right),r.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC),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
  484. ;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;u<d&&c>h&&p<m&&f>g&&(w=s),i=1-(y-_)*(C-b)/((w.right-w.left)*(w.top-w.bottom))}return void(i>t&&(e._changed.raiseEvent(i),e._changedPosition=r.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=r.clone(e.positionWC,e._changedPosition),void(e._changedDirection=r.clone(e.directionWC,e._changedDirection));var S,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.height<n){var m=l.getHeight(p);a(m)&&(m+=o,p.height<m&&(p.height=m,s===D.SCENE3D?d.cartographicToCartesian(p,this.position):h.project(p,this.position),f=!0))}a(u)&&(this._setTransform(u),f&&(r.normalize(this.position,this.position),r.negate(this.position,this.direction),r.multiplyByScalar(this.position,Math.max(c,o),this.position),r.normalize(this.direction,this.direction),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up)))}}};var he=new n,pe=new r,fe=new r,me=new i,ge=new i,ve=new i,_e=new i,ye=new i,be=new r,Ce=new y,we=new y;s(I.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return L(this),this._invTransform}},viewMatrix:{get:function(){return L(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return L(this),this._invViewMatrix}},positionCartographic:{get:function(){return L(this),this._positionCartographic}},positionWC:{get:function(){return L(this),this._positionWC}},directionWC:{get:function(){return L(this),this._directionWC}},upWC:{get:function(){return L(this),this._upWC}},rightWC:{get:function(){return L(this),this._rightWC}},heading:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=x.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=N(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=x.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=k(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=x.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=F(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),I.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==D.MORPHING,t=this._mode===D.SCENE2D),t){var r=this._max2Dfrustum=this.frustum.clone(),i=r.top/r.right;r.right=2*this._maxCoord.x,r.left=-r.right,r.top=i*r.right,r.bottom=-r.top}this._mode===D.SCENE2D&&G(this,this.position);var n=this._scene.globe,o=!a(n)||n._surface.tileProvider.ready&&0===n._surface._tileLoadQueueHigh.length&&0===n._surface._tileLoadQueueMedium.length&&0===n._surface._tileLoadQueueLow.length&&0===n._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!o),this._adjustHeightForTerrain()};var Se=new r,Te=new r,Ee=new r;I.prototype._setTransform=function(e){var t=r.clone(this.positionWC,Se),i=r.clone(this.upWC,Te),n=r.clone(this.directionWC,Ee);y.clone(e,this._transform),this._transformChanged=!0,L(this);var o=this._actualInvTransform;y.multiplyByPoint(o,t,this.position),y.multiplyByPointAsVector(o,n,this.direction),y.multiplyByPointAsVector(o,i,this.up),r.cross(this.direction,this.up,this.right),L(this)};var xe=new t,Pe=new T,Ae=new r,De=new r;I.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof b&&(e||!(this._positionCartographic.height<15e4))){if(!y.equals(y.IDENTITY,this.transform))return void(this.frustum.width=r.magnitude(this.position));var t,i,n=this._scene,o=n._globe;if(a(o)){var s=xe;s.x=n.drawingBufferWidth/2,s.y=n.drawingBufferHeight/2;var l=this.getPickRay(s,Pe);if(t=o.pick(l,n,Ae),n.pickPositionSupported&&(i=n.pickPositionWorldCoordinates(s,De)),a(t)&&a(i)){var u=a(i)?r.distance(i,this.positionWC):Number.POSITIVE_INFINITY,c=a(t)?r.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(u,c)}else a(i)?this.frustum.width=r.distance(i,this.positionWC):a(t)&&(this.frustum.width=r.distance(t,this.positionWC))}if(!a(o)||!a(t)&&!a(i)){var d=Math.max(this.positionCartographic.height,0);this.frustum.width=d}}};var Ie=new r,Oe=new y,Me=new y,Re=new S,Le=new _,Ne=new n,ke=new r,Fe=new r,Be=new r,Ue={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},Ve=new f;I.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),i=this._mode;if(i!==D.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,r.clone(this.positionWC,Ie));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Ie),n=!1),a(t.direction)&&(t=z(this,s,t,Ue.orientation)),Ve.heading=o(t.heading,0),Ve.pitch=o(t.pitch,-v.PI_OVER_TWO),Ve.roll=o(t.roll,0),this._suspendTerrainAdjustment=!0,i===D.SCENE3D?B(this,s,Ve):i===D.SCENE2D?V(this,s,Ve,n):U(this,s,Ve,n)}};var ze=new r;I.prototype.flyHome=function(e){var t=this._mode;if(t===D.MORPHING&&this._scene.completeMorph(),t===D.SCENE2D)this.flyTo({destination:I.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:y.IDENTITY});else if(t===D.SCENE3D){var i=this.getRectangleCameraCoordinates(I.DEFAULT_VIEW_RECTANGLE),n=r.magnitude(i);n+=n*I.DEFAULT_VIEW_FACTOR,r.normalize(i,i),r.multiplyByScalar(i,n,i),this.flyTo({destination:i,duration:e,endTransform:y.IDENTITY})}else if(t===D.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new r(0,-1,1);a=r.multiplyByScalar(r.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(r.normalize(a,ze).z),roll:0},endTransform:y.IDENTITY,convert:!1})}},I.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new i),L(this),y.multiplyByVector(this._actualInvTransform,e,t)},I.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPoint(this._actualInvTransform,e,t)},I.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPointAsVector(this._actualInvTransform,e,t)},I.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new i),L(this),y.multiplyByVector(this._actualTransform,e,t)},I.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPoint(this._actualTransform,e,t)},I.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPointAsVector(this._actualTransform,e,t)};var Ge=new r;I.prototype.move=function(e,t){var i=this.position;r.multiplyByScalar(e,t,Ge),r.add(i,Ge,i),this._mode===D.SCENE2D&&G(this,i),this._adjustOrthographicFrustum(!0)},I.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,e)},I.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,-e)},I.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},I.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},I.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},I.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},I.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,-e)},I.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,e)},I.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,-e)},I.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,e)};var He=new S,We=new _;I.prototype.look=function(e,t){var r=o(t,this.defaultLookAmount),i=S.fromAxisAngle(e,-r,He),n=_.fromQuaternion(i,We),a=this.direction,s=this.up,l=this.right;_.multiplyByVector(n,a,a),_.multiplyByVector(n,s,s),_.multiplyByVector(n,l,l)},I.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},I.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var je=new S,qe=new _;I.prototype.rotate=function(e,t){var i=o(t,this.defaultRotateAmount),n=S.fromAxisAngle(e,-i,je),a=_.fromQuaternion(n,qe);_.multiplyByVector(a,this.position,this.position),_.multiplyByVector(a,this.direction,this.direction),_.multiplyByVector(a,this.up,this.up),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},I.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),H(this,e)},I.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),H(this,-e)};var Ye=new r,Xe=new r,Qe=new r,Ze=new r;I.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),W(this,-e)},I.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),W(this,e)},I.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?j(this,e):q(this,e)},I.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?j(this,-e):q(this,-e)},I.prototype.getMagnitude=function(){return this._mode===D.SCENE3D?r.magnitude(this.position):this._mode===D.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===D.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Ke=new y;I.prototype.lookAt=function(e,t){var r=x.eastNorthUpToFixedFrame(e,c.WGS84,Ke);this.lookAtTransform(r,t)};var Je=new r,$e=new S,et=new S,tt=new _;I.prototype.lookAtTransform=function(e,i){if(this._setTransform(e),a(i)){var n;if(n=a(i.heading)?Y(i.heading,i.pitch,i.range):i,this._mode===D.SCENE2D){t.clone(t.ZERO,this.position),r.negate(n,this.up),this.up.z=0,r.magnitudeSquared(this.up)<v.EPSILON10&&r.clone(r.UNIT_Y,this.up),r.normalize(this.up,this.up),this._setTransform(y.IDENTITY),r.negate(r.UNIT_Z,this.direction),r.cross(this.direction,this.up,this.right),r.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*r.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}r.clone(n,this.position),r.negate(this.position,this.direction),r.normalize(this.direction,this.direction),r.cross(this.direction,r.UNIT_Z,this.right),r.magnitudeSquared(this.right)<v.EPSILON10&&r.clone(r.UNIT_X,this.right),r.normalize(this.right,this.right),r.cross(this.right,this.direction,this.up),r.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var rt,it=new n,nt=new n,ot=new r,at=new r,st=new r,lt=new r,ut=new r,ct=new r,dt=new r,ht=new r,pt={direction:new r,right:new r,up:new r},ft=new n,mt=new r,gt=new r,vt=new n,_t=new r,yt=new r;I.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return a(t)||(t=new r),i===D.SCENE3D?Q(this,e,t):i===D.COLUMBUS_VIEW?Z(this,e,t):i===D.SCENE2D?K(this,e,t):void 0};var bt=new T,Ct=new T,wt=new T;I.prototype.pickEllipsoid=function(e,t,i){var n=this._scene.canvas;if(0!==n.clientWidth&&0!==n.clientHeight){if(a(i)||(i=new r),t=o(t,c.WGS84),this._mode===D.SCENE3D)i=J(this,e,t,i);else if(this._mode===D.SCENE2D)i=$(this,e,this._projection,i);else{if(this._mode!==D.COLUMBUS_VIEW)return;i=ee(this,e,this._projection,i)}return i}};var St=new r,Tt=new r,Et=new r,xt=new r;I.prototype.getPickRay=function(e,t){a(t)||(t=new T);var r=this.frustum;return a(r.aspectRatio)&&a(r.fov)&&a(r.near)?te(this,e,t):re(this,e,t)};var Pt=new r,At=new r;I.prototype.distanceToBoundingSphere=function(e){var t=r.subtract(this.positionWC,e.center,Pt),i=r.multiplyByScalar(this.directionWC,r.dot(t,this.directionWC),At);return Math.max(0,r.magnitude(i)-e.radius)};var Dt=new t;I.prototype.getPixelSize=function(e,t,r){var i=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,r,i,Dt);return Math.max(n.x,n.y)};var It=new r,Ot=new r,Mt=new r,Rt=new r;I.prototype.createCorrectPositionTween=function(e){if(this._mode===D.COLUMBUS_VIEW)return ne(this,e)};var Lt=new r,Nt={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};I.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},I.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination;if(this._mode!==D.MORPHING){this.cancelFlight();var r=o(e.orientation,o.EMPTY_OBJECT);if(a(r.direction)&&(r=z(this,t,r,Ue.orientation)),a(e.duration)&&e.duration<=0){var i=Ue;return i.destination=e.destination,i.orientation.heading=r.heading,i.orientation.pitch=r.pitch,i.orientation.roll=r.roll,i.convert=e.convert,i.endTransform=e.endTransform,this.setView(i),void("function"==typeof e.complete&&e.complete())}var n=a(t.west);n&&(t=this.getRectangleCameraCoordinates(t,Lt));var s,l=this;Nt.destination=t,Nt.heading=r.heading,Nt.pitch=r.pitch,Nt.roll=r.roll,Nt.duration=e.duration,Nt.complete=function(){s===l._currentFlight&&(l._currentFlight=void 0),a(e.complete)&&e.complete()},Nt.cancel=e.cancel,Nt.endTransform=e.endTransform,Nt.convert=!n&&e.convert,Nt.maximumHeight=e.maximumHeight,Nt.pitchAdjustHeight=e.pitchAdjustHeight,Nt.flyOverLongitude=e.flyOverLongitude,Nt.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Nt.easingFunction=e.easingFunction;var u=this._scene;s=u.tweens.add(P.createTween(u,Nt)),this._currentFlight=s}};var kt=100;I.prototype.viewBoundingSphere=function(e,t){t=se(this,e,t),this.lookAt(e.center,t)};var Ft=new y,Bt=new r,Ut=new r,Vt=new r,zt=new r,Gt=new i,Ht=new S,Wt=new _;I.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var i=this._mode===D.SCENE2D||this._mode===D.COLUMBUS_VIEW;this._setTransform(y.IDENTITY);var n,a=se(this,e,t.offset);n=i?r.multiplyByScalar(r.UNIT_Z,a.range,Bt):Y(a.heading,a.pitch,a.range);var s=x.eastNorthUpToFixedFrame(e.center,c.WGS84,Ft);y.multiplyByPoint(s,n,n);var l,u;if(!i){if(l=r.subtract(e.center,n,Ut),r.normalize(l,l),u=y.multiplyByPointAsVector(s,r.UNIT_Z,Vt),1-Math.abs(r.dot(l,u))<v.EPSILON6){var d=S.fromAxisAngle(l,a.heading,Ht),h=_.fromQuaternion(d,Wt);r.fromCartesian4(y.getColumn(s,1,Gt),u),_.multiplyByVector(h,u,u)}var p=r.cross(l,u,zt);r.cross(p,l,u),r.normalize(u,u)}this.flyTo({destination:n,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var jt=new r,qt=new r,Yt=new r,Xt=new r,Qt=[new r,new r,new r,new r],Zt=new t,Kt=new r,Jt=[new n,new n,new n,new n];return I.prototype.computeViewRectangle=function(t,i){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(r.ZERO,t.maximumRadius);if(n.computeVisibility(a)!==m.OUTSIDE){var s=this._scene.canvas,l=s.clientWidth,u=s.clientHeight,d=0,h=le(this,t);if(d+=ue(0,0,0,this,t,h),d+=ue(0,u,1,this,t,h),d+=ue(l,u,2,this,t,h),(d+=ue(l,0,3,this,t,h))<2)return E.MAX_VALUE;i=E.fromCartographicArray(Jt,i);for(var p=0,f=Jt[3].longitude,g=0;g<4;++g){var _=Jt[g].longitude,y=Math.abs(_-f);y>v.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(;r<i-Math.PI;)r+=l;m.angleAndHeight.endPosition.x=-r*n.clientWidth/12,m.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},l.PINCH_MOVE,i)}function p(r,i){var n=c(u.WHEEL,i),o=r._update;o[n]=!0;var s=r._movement[n];t(s)||(s=r._movement[n]={}),s.startPosition=new e,s.endPosition=new e,r._eventHandler.setInputAction(function(t){var r=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=r,o[n]=!1):s.endPosition.y=s.endPosition.y+r},l.WHEEL,i)}function f(r,i,n){var o=c(n,i),a=r._isDown,s=r._eventStartPosition,d=r._pressTime,h=r._releaseTime;a[o]=!1,s[o]=new e;var p=r._lastMovement[o];t(p)||(p=r._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var f,m;n===u.LEFT_DRAG?(f=l.LEFT_DOWN,m=l.LEFT_UP):n===u.RIGHT_DRAG?(f=l.RIGHT_DOWN,m=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(f=l.MIDDLE_DOWN,m=l.MIDDLE_UP),r._eventHandler.setInputAction(function(t){r._buttonsDown++,p.valid=!1,a[o]=!0,d[o]=new Date,e.clone(t.position,s[o])},f,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),a[o]=!1,h[o]=new Date},m,i)}function m(t,r){e.clone(t.startPosition,r.startPosition),e.clone(t.endPosition,r.endPosition)}function g(r,i){var n=r._update,o=r._movement,a=r._lastMovement,s=r._isDown;for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);n[p]=!0,t(r._lastMovement[p])||(r._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(r._movement[p])||(r._movement[p]={startPosition:new e,endPosition:new e})}}r._eventHandler.setInputAction(function(l){for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);s[p]&&(n[p]?(m(o[p],a[p]),a[p].valid=!0,m(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,r._currentMousePosition)},l.MOUSE_MOVE,i)}function v(r){this._eventHandler=new s(r,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),h(this,void 0,r),f(this,void 0,u.LEFT_DRAG),f(this,void 0,u.RIGHT_DRAG),f(this,void 0,u.MIDDLE_DRAG),g(this,void 0);for(var i in o)if(o.hasOwnProperty(i)){var n=o[i];t(n)&&(p(this,n),h(this,n,r),f(this,n,u.LEFT_DRAG),f(this,n,u.RIGHT_DRAG),f(this,n,u.MIDDLE_DRAG),g(this,n))}}return r(v.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),v.prototype.isMoving=function(e,t){var r=c(e,t);return!this._update[r]},v.prototype.getMovement=function(e,t){var r=c(e,t);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<p;++m){var g=o(u,n),v=d.getUint32(n+2*c,!0),_=l[g];if(!t(_))throw new a("Unknown tile content type, "+g+", inside Composite tile");var y=_(r._tileset,r._tile,r._url,i,n);r._contents.push(y),f.push(y.readyPromise),n+=v}s.all(f).then(function(){r._readyPromise.resolve(r)}).otherwise(function(e){r._readyPromise.reject(e)})}if(!n.supportsTypedArrays())return{};r(l.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,r=0;r<t;++r)if(e[r].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,r=t.length,i=0;i<r;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},batchTable:{get:function(){}}});var c=Uint32Array.BYTES_PER_ELEMENT;return l.prototype.hasProperty=function(e,t){return!1},l.prototype.getFeature=function(e){},l.prototype.applyDebugSettings=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].applyDebugSettings(e,t)},l.prototype.applyStyle=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].applyStyle(e,t)},l.prototype.update=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].update(e,t)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){for(var e=this._contents,t=e.length,r=0;r<t;++r)e[r].destroy();return i(this)},l}),define("Scene/ModelInstance",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function r(e,r,i){this.primitive=e,this._modelMatrix=t.clone(r),this._instanceId=i}return e(r.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return t.clone(this._modelMatrix)},set:function(e){t.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}}),r}),define("Scene/ModelInstanceCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/ShaderSource","../ThirdParty/when","./getAttributeOrUniformBySemantic","./Model","./ModelInstance","./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){"use strict";function E(e){e=o(e,o.EMPTY_OBJECT),this.show=o(e.show,!0),this._instancingSupported=!1,this._dynamic=o(e.dynamic,!1),this._allowPicking=o(e.allowPicking,!0),this._ready=!1,this._readyPromise=y.defer(),this._state=te.NEEDS_LOAD,this._dirty=!1,this._cull=o(e.cull,!0),this._opaquePass=o(e.opaquePass,v.OPAQUE),this._instances=x(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._pickCommands=[],this._modelCommands=void 0,this._boundingSphere=P(this),this._center=t.clone(this._boundingSphere.center),this._rtcTransform=new c,this._rtcModelView=new c,this._mode=void 0,this.modelMatrix=c.clone(c.IDENTITY),this._modelMatrix=c.clone(this.modelMatrix),this._url=e.url,this._headers=e.headers,this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=e.basePath,this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this.shadows=o(e.shadows,T.ENABLED),this._shadows=this.shadows,this.debugShowBoundingVolume=o(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=o(e.debugWireframe,!1),this._debugWireframe=!1}function x(e,t){t=o(t,[]);for(var r=t.length,i=new Array(r),n=0;n<r;++n){var a=t[n],s=a.modelMatrix,l=o(a.batchId,n);i[n]=new w(e,s,l)}return i}function P(r){for(var i=r.length,n=new Array(i),o=0;o<i;++o)n[o]=c.getTranslation(r._instances[o]._modelMatrix,new t);return e.fromPoints(n)}function A(e,t){if(a(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var r={};e._instancedUniformsByProgram=r;var i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],n=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model.gltf,s=o.techniques;for(var l in s)if(s.hasOwnProperty(l)){var u=s[l],c=u.parameters,d=u.uniforms,p=u.program;if(!a(r[p])){var f={};r[p]=f;for(var m in d)if(d.hasOwnProperty(m)){var g=d[m],v=c[g],_=v.semantic;if(a(_)&&i.indexOf(_)>-1){
  485. 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;o<r;++o){var s=t[o]._modelMatrix,l=c.clone(s,ie);l[12]-=i.x,l[13]-=i.y,l[14]-=i.z;var u=12*o;n[u+0]=l[0],n[u+1]=l[4],n[u+2]=l[8],n[u+3]=l[12],n[u+4]=l[1],n[u+5]=l[5],n[u+6]=l[9],n[u+7]=l[13],n[u+8]=l[2],n[u+9]=l[6],n[u+10]=l[10],n[u+11]=l[14]}return n}function G(e,t){var r,n=e._instances,o=e.length,s=e._dynamic,l=a(e._batchTable),u=e._allowPicking;if(l){var c=new Uint16Array(o);for(r=0;r<o;++r)c[r]=n[r]._instanceId;e._batchIdBuffer=f.createVertexBuffer({context:t,typedArray:c,usage:m.STATIC_DRAW})}if(u&&!l){var d=new Uint8Array(4*o);for(r=0;r<o;++r){var h=e._pickIds[r],p=h.color,g=4*r;d[g]=i.floatToByte(p.red),d[g+1]=i.floatToByte(p.green),d[g+2]=i.floatToByte(p.blue),d[g+3]=i.floatToByte(p.alpha)}e._pickIdBuffer=f.createVertexBuffer({context:t,typedArray:d,usage:m.STATIC_DRAW})}var v=z(e);e._vertexBuffer=f.createVertexBuffer({context:t,typedArray:v,usage:s?m.STREAM_DRAW:m.STATIC_DRAW})}function H(e){var t=z(e);e._vertexBuffer.copyFromArrayView(t)}function W(e,t){for(var r=e._instances,i=r.length,n=new Array(i),o=0;o<i;++o)n[o]=t.createPickId(r[o]);return n}function j(e,t){var r=e._instancingSupported,i=a(e._batchTable),o=e._allowPicking,s={url:e._url,headers:e._headers,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:o,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickVertexShaderLoaded:void 0,pickFragmentShaderLoaded:void 0,pickUniformMapLoaded:void 0,ignoreCommands:!0,opaquePass:e._opaquePass};if(o&&!i&&(e._pickIds=W(e,t)),r){G(e,t);var l=n.getSizeInBytes(n.FLOAT),u={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*l,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:4*l,strideInBytes:12*l,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:8*l,strideInBytes:12*l,instanceDivisor:1}};i&&(u.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:n.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o&&!i&&(u.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:n.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),s.precreatedAttributes=u,s.vertexShaderLoaded=D(e),s.fragmentShaderLoaded=I(e),s.uniformMapLoaded=N(e,t),s.pickVertexShaderLoaded=O(e),s.pickFragmentShaderLoaded=M(e),s.pickUniformMapLoaded=k(e),a(e._url)&&(s.cacheKey=e._url+"#instanced")}else s.vertexShaderLoaded=F(e),s.fragmentShaderLoaded=I(e),s.uniformMapLoaded=V(e,t),s.pickVertexShaderLoaded=B(e),s.pickFragmentShaderLoaded=U(e),s.pickUniformMapLoaded=k(e);a(e._url)?e._model=C.fromGltf(s):e._model=new C(s)}function q(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?d.LINES:d.TRIANGLES,r=e._drawCommands,i=r.length,n=0;n<i;++n)r[n].primitiveType=t}}function Y(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e._drawCommands,r=t.length,i=0;i<r;++i)t[i].debugShowBoundingVolume=e.debugShowBoundingVolume}}function X(e,t,r){for(var i=t.length,n=e.length,o=e.allowPicking,a=e._boundingSphere,s=e._cull,l=0;l<i;++l){var u=g.shallowClone(t[l]);if(u.instanceCount=n,u.boundingVolume=a,u.cull=s,e._drawCommands.push(u),o){var c=g.shallowClone(r[l]);c.instanceCount=n,c.boundingVolume=a,c.cull=s,e._pickCommands.push(c)}}}function Q(e){return function(){return e}}function Z(e){return function(){return e}}function K(t,i,n){for(var o=t._instances,s=i.length,l=t.length,u=t.allowPicking,d=a(t._batchTable),h=t._cull,p=0;p<s;++p)for(var f=0;f<l;++f){var m=g.shallowClone(i[p]);if(m.modelMatrix=new c,m.boundingVolume=new e,m.cull=h,m.uniformMap=r(m.uniformMap),d&&(m.uniformMap.a_batchId=Q(o[f]._instanceId)),t._drawCommands.push(m),u){var v=g.shallowClone(n[p]);if(v.modelMatrix=new c,v.boundingVolume=new e,v.cull=h,v.uniformMap=r(v.uniformMap),d)v.uniformMap.a_batchId=Q(o[f]._instanceId);else if(u){var _=t._pickIds[f];v.uniformMap.czm_pickColor=Z(_.color)}t._pickCommands.push(v)}}}function J(t){for(var r=t._modelCommands,i=r.length,n=t.length,o=t.allowPicking,a=t._rtcTransform,s=t._center,l=0;l<i;++l)for(var u=r[l],d=0;d<n;++d){var h=l*n+d,p=t._drawCommands[h],f=c.clone(t._instances[d]._modelMatrix,ie);f[12]-=s.x,f[13]-=s.y,f[14]-=s.z,f=c.multiply(a,f,ie);var m=u.modelMatrix,g=p.modelMatrix;c.multiply(f,m,g);var v=u.boundingVolume,_=p.boundingVolume;if(e.transform(v,f,_),o){var y=t._pickCommands[h];c.clone(g,y.modelMatrix),e.clone(_,y.boundingVolume)}}}function $(e){for(var t=e._nodeCommands,r=t.length,i=[],n=[],o=0;o<r;++o){var a=t[o];a.show&&(i.push(a.command),n.push(a.pickCommand))}return{draw:i,pick:n}}function ee(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=T.castShadows(e.shadows),r=T.receiveShadows(e.shadows),i=e._drawCommands,n=i.length,o=0;o<n;++o){var a=i[o];a.castShadows=t,a.receiveShadows=r}}}var te={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};s(E.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var re=new t,ie=new c;E.prototype.expandBoundingSphere=function(t){var r=c.getTranslation(t,re);e.expand(this._boundingSphere,r,this._boundingSphere)};var ne;return E.prototype.update=function(e){if(e.mode!==S.MORPHING&&this.show&&0!==this.length){var r=e.context;if(this._state===te.NEEDS_LOAD){this._state=te.LOADING,this._instancingSupported=r.instancedArrays,j(this,r);var i=this;this._model.readyPromise.otherwise(function(e){i._state=te.FAILED,i._readyPromise.reject(e)})}var n=this._instancingSupported,o=this._model;if(o.update(e),o.ready&&this._state===te.LOADING){this._state=te.LOADED,this._ready=!0;var a=o.boundingSphere.radius+t.magnitude(o.boundingSphere.center);this._boundingSphere.radius+=a;var s=$(o);return this._modelCommands=s.draw,n?X(this,s.draw,s.pick):(K(this,s.draw,s.pick),J(this)),void this._readyPromise.resolve(this)}if(this._state===te.LOADED){var l=e.mode!==this._mode,u=this.modelMatrix,d=!c.equals(this._modelMatrix,u);if(l||d){this._mode=e.mode,c.clone(u,this._modelMatrix);var h=c.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==S.SCENE3D&&(h=p.basisTo2D(e.mapProjection,h,h)),c.getTranslation(h,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,H(this)),!n&&(o.dirty||this._dirty||l||d)&&J(this),ee(this),q(this),Y(this);for(var f=e.passes,m=e.commandList,g=f.render?this._drawCommands:this._pickCommands,v=g.length,_=0;_<v;++_)m.push(g[_])}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(a(e))for(var t=e.length,r=0;r<t;++r)e[r].destroy();return l(this)},E}),define("Scene/Instanced3DModel3DTileContent",["../Core/AttributeCompression","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getStringFromTypedArray","../Core/joinUrls","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/RequestType","../Core/RuntimeError","../Core/Transforms","../Core/TranslationRotationScale","../Renderer/Pass","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./ModelInstanceCollection"],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,t,r,i,n){this._tileset=e,this._tile=t,this._url=r,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,D(this,i,n)}function D(r,a,s){var l=n(s,0);s=l;var u=new Uint8Array(a),d=new DataView(a);s+=O;var E=d.getUint32(s,!0);if(1!==E)throw new b("Only Instanced 3D Model version 1 is supported. Version "+E+" is not.");s+=O;var D=d.getUint32(s,!0);s+=O;var I=d.getUint32(s,!0);if(0===I)throw new b("featureTableJsonByteLength is zero, the feature table must be defined.");s+=O;var L=d.getUint32(s,!0);s+=O;var N=d.getUint32(s,!0);s+=O;var k=d.getUint32(s,!0);s+=O;var F=d.getUint32(s,!0);if(1!==F&&0!==F)throw new b("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+F+" is not.");s+=O;var B=f(u,s,I),U=JSON.parse(B);s+=I;var V=new Uint8Array(a,s,L);s+=L;var z=new x(U,V),G=z.getGlobalProperty("INSTANCES_LENGTH");if(z.featuresLength=G,!o(G))throw new b("Feature table global property: INSTANCES_LENGTH must be defined");var H,W;if(N>0){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;ce<G;ce++){var de=z.getProperty("POSITION",i.FLOAT,3,ce,M);if(!o(de)){de=te;var he=z.getProperty("POSITION_QUANTIZED",i.UNSIGNED_SHORT,3,ce,M);if(!o(he))throw new b("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var pe=z.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",i.FLOAT,3);if(!o(pe))throw new b("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var fe=z.getGlobalProperty("QUANTIZED_VOLUME_SCALE",i.FLOAT,3);if(!o(fe))throw new b("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var me=0;me<3;me++)de[me]=he[me]/65535*fe[me]+pe[me]}t.unpack(de,0,ee),o(Z)&&t.add(ee,Z,ee),le.translation=ee;var ge=z.getProperty("NORMAL_UP",i.FLOAT,3,ce,M),ve=z.getProperty("NORMAL_RIGHT",i.FLOAT,3,ce,R),_e=!1;if(o(ge)){if(!o(ve))throw new b("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");t.unpack(ge,0,ie),t.unpack(ve,0,re),_e=!0}else{var ye=z.getProperty("NORMAL_UP_OCT32P",i.UNSIGNED_SHORT,2,ce,M),be=z.getProperty("NORMAL_RIGHT_OCT32P",i.UNSIGNED_SHORT,2,ce,R);if(o(ye)){if(!o(be))throw new b("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");e.octDecodeInRange(ye[0],ye[1],65535,ie),e.octDecodeInRange(be[0],be[1],65535,re),_e=!0}else K?(C.eastNorthUpToFixedFrame(ee,c.WGS84,ue),v.getRotation(ue,oe)):g.clone(g.IDENTITY,oe)}_e&&(t.cross(re,ie,ne),t.normalize(ne,ne),g.setColumn(oe,0,re,oe),g.setColumn(oe,1,ie,oe),g.setColumn(oe,2,ne,oe)),_.fromRotationMatrix(oe,ae),le.rotation=ae,se=t.fromElements(1,1,1,se);var Ce=z.getProperty("SCALE",i.FLOAT,1,ce);o(Ce)&&t.multiplyByScalar(se,Ce,se);var we=z.getProperty("SCALE_NON_UNIFORM",i.FLOAT,3,ce,M);o(we)&&(se.x*=we[0],se.y*=we[1],se.z*=we[2]),le.scale=se;var Se=z.getProperty("BATCH_ID",i.UNSIGNED_SHORT,1,ce);o(Se)||(Se=ce),v.fromTranslationRotationScale(le,ue);var Te=ue.clone();$[ce]={modelMatrix:Te,batchId:Se}}r._modelInstanceCollection=new P(X)}function I(e){var t=e._tileset,r=e.featuresLength;if(!o(e._features)&&r>0){for(var i=new Array(r),n=0;n<r;++n)i[n]=new E(t,e,n);e._features=i}}if(!d.supportsTypedArrays())return{};A._deprecationWarning=s,a(A.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return o(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},batchTable:{get:function(){return this._batchTable}}});var O=Uint32Array.BYTES_PER_ELEMENT,M=new Array(4),R=new Array(4);return A.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},A.prototype.getFeature=function(e){this.featuresLength;return I(this),this._features[e]},A.prototype.applyDebugSettings=function(e,t){t=e?t:r.WHITE,this._batchTable.setAllColor(t)},A.prototype.applyStyle=function(e,t){this._batchTable.applyStyle(e,t)},A.prototype.update=function(e,t){var r=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe,this._modelInstanceCollection.update(t),r<t.commandList.length&&t.passes.render&&this._batchTable.addDerivedCommands(t,r,!1)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),l(this)},A}),define("Scene/PointCloud3DTileContent",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getStringFromTypedArray","../Core/Matrix4","../Core/oneTimeWarning","../Core/PrimitiveType","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BlendingState","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./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){"use strict";function R(e,t,r,n,o){this._tileset=e,this._tile=t,this._url=r,this._parsedContent=void 0,this._drawCommand=void 0,this._pickCommand=void 0,this._pickId=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=i.clone(i.WHITE),this._rtcCenter=void 0,this._batchTable=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this.backFaceCulling=!1,this._backFaceCulling=!1,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._highlightColor=i.clone(i.WHITE),this._pointSize=1,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._modelMatrix=p.clone(p.IDENTITY),this._mode=void 0,this._readyPromise=x.defer(),this._pointsLength=0,this._geometryByteLength=0,this._features=void 0,this.featurePropertiesDirty=!1,L(this,n,o)}function L(e,r,n){n=a(n,0);var l=new Uint8Array(r),u=new DataView(r);n+=z;var c=u.getUint32(n,!0);if(1!==c)throw new g("Only Point Cloud tile version 1 is supported. Version "+c+" is not.");n+=z,n+=z;var d=u.getUint32(n,!0);if(0===d)throw new g("Feature table must have a byte length greater than zero");n+=z;var p=u.getUint32(n,!0);n+=z;var m=u.getUint32(n,!0);n+=z;var v=u.getUint32(n,!0);n+=z;var _=h(l,n,d),y=JSON.parse(_);n+=d;var b=new Uint8Array(r,n,p);n+=p;var C,w;if(m>0){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<r;++i){var n=e.getAttribute(i);if(n.index===t)return n}}function B(e){for(var t=X.length,r=0;r<t;++r){var i=X[r],n="czm_tiles3d_style_"+i,o=i.toLowerCase();e=e.replace(new RegExp(n+"(\\W)","g"),o+"$1")}return e.replace("()","(vec3 position, vec3 position_absolute, vec4 color, vec3 normal)")}function U(e,t,r){var i,n,o,a,l,u,c=t.context,d=e._batchTable,h=s(d),p=s(r),f=e._isQuantized,m=e._isOctEncoded16P,v=e._isRGB565,_=e._isTranslucent,y=e._hasColors,b=e._hasNormals,C=e._hasBatchIds,w=e._backFaceCulling,E=e._drawCommand.vertexArray,x=_;if(h&&(p=!1),p){var P={translucent:!1};a=r.getColorShaderFunction("getColorFromStyle","czm_tiles3d_style_",P),l=r.getShowShaderFunction("getShowFromStyle","czm_tiles3d_style_",P),u=r.getPointSizeShaderFunction("getPointSizeFromStyle","czm_tiles3d_style_",P),s(a)&&P.translucent&&(x=!0)}e._styleTranslucent=x;var A=s(a),D=s(l),I=s(u),O=[];A&&(k(a,O),a=B(a)),D&&(k(l,O),l=B(l)),I&&(k(u,O),u=B(u));var M=O.indexOf("COLOR")>=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;i<Q;++i){if(n=L[i],o=N[n],!s(o))throw new g('Style references a property "'+n+'" that does not exist or is not styleable.');var Z,K=o.componentCount,J="czm_tiles3d_style_"+n;Z=1===K?"float":"vec"+K,Y+="attribute "+Z+" "+J+"; \n",G[J]=o.location}var $="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec2 u_pointSizeAndTilesetTime; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \nfloat u_pointSize; \nfloat u_tilesetTime; \n";$+=Y,z&&($+=_?"attribute vec4 a_color; \n":v?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),b&&($+=m?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),C&&($+="attribute float a_batchId; \n"),f&&($+="uniform vec3 u_quantizedVolumeScale; \n"),A&&($+=a),D&&($+=l),I&&($+=u),$+="void main() \n{ \n u_pointSize = u_pointSizeAndTilesetTime.x; \n u_tilesetTime = u_pointSizeAndTilesetTime.y; \n",$+=z?_?" vec4 color = a_color; \n":v?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",$+=f?" vec3 position = a_position * u_quantizedVolumeScale; \n":" vec3 position = a_position; \n",$+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",$+=b?m?" vec3 normal = czm_octDecode(a_normal); \n":" vec3 normal = a_normal; \n":" vec3 normal = vec3(1.0); \n",A&&($+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),D&&($+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),$+=I?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal); \n":" gl_PointSize = u_pointSize; \n",$+=" color = color * u_highlightColor; \n",b&&($+=" normal = czm_normal * normal; \n float diffuseStrength = czm_getLambertDiffuse(czm_sunDirectionEC, normal); \n diffuseStrength = max(diffuseStrength, 0.4); \n color *= diffuseStrength; \n"),$+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",b&&w&&($+=" float visible = step(-normal.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),D&&($+=" gl_Position *= show; \n gl_PointSize *= show; \n"),$+="} \n";var ee="varying vec4 v_color; \nvoid main() \n{ \n gl_FragColor = v_color; \n} \n",te=$,re=ee;h&&(te=d.getVertexShaderCallback(!1,"a_batchId")(te),re=d.getFragmentShaderCallback(!1,void 0)(re));var ie=$,ne=ee;h?(ie=d.getPickVertexShaderCallback("a_batchId")(ie),ne=d.getPickFragmentShaderCallback()(ne)):ne=T.createPickFragmentShaderSource(ne,"uniform");var oe=e._drawCommand;s(oe.shaderProgram)&&oe.shaderProgram.destroy(),oe.shaderProgram=S.fromCache({context:c,vertexShaderSource:te,fragmentShaderSource:re,attributeLocations:G});var ae=e._pickCommand;s(ae.shaderProgram)&&ae.shaderProgram.destroy(),ae.shaderProgram=S.fromCache({context:c,vertexShaderSource:ie,fragmentShaderSource:ne,attributeLocations:G});try{oe.shaderProgram._bind()}catch(e){throw new g("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function V(e){var t=e._tileset,r=e.featuresLength;if(!s(e._features)&&r>0){for(var i=new Array(r),n=0;n<r;++n)i[n]=new D(t,e,n);e._features=i}}if(!d.supportsTypedArrays())return{};l(R.prototype,{featuresLength:{get:function(){return s(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return s(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{
  486. get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},batchTable:{get:function(){return this._batchTable}}});var z=Uint32Array.BYTES_PER_ELEMENT,G=new e,H=0,W=1,j=2,q=3,Y=4,X=["POSITION","COLOR","NORMAL","POSITION_ABSOLUTE"];R.prototype.hasProperty=function(e,t){return!!s(this._batchTable)&&this._batchTable.hasProperty(e,t)},R.prototype.getFeature=function(e){if(s(this._batchTable)){this.featuresLength;return V(this),this._features[e]}},R.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:i.WHITE},R.prototype.applyStyle=function(e,t){s(this._batchTable)?this._batchTable.applyStyle(e,t):U(this,e,t)};var Q=new r,Z=new p;return R.prototype.update=function(e,t){var i=this._tile.computedTransform,n=!p.equals(this._modelMatrix,i),o=n||this._mode!==t.mode;if(this._mode=t.mode,s(this._drawCommand)||(N(this,t),U(this,t,e.style),o=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),o){if(p.clone(i,this._modelMatrix),s(this._rtcCenter)?p.multiplyByTranslation(i,this._rtcCenter,this._drawCommand.modelMatrix):s(this._quantizedVolumeOffset)?p.multiplyByTranslation(i,this._quantizedVolumeOffset,this._drawCommand.modelMatrix):p.clone(i,this._drawCommand.modelMatrix),t.mode!==O.SCENE3D){var a=t.mapProjection;i=this._drawCommand.modelMatrix;var l=p.getColumn(i,3,Q);if(r.equals(l,r.UNIT_W)){var u=this._tile.boundingSphere.center,c=v.wgs84To2DModelMatrix(a,u,Z);p.multiply(c,i,i)}else v.basisTo2D(a,i,i)}p.clone(this._drawCommand.modelMatrix,this._pickCommand.modelMatrix);var d;d=s(this._tile._contentBoundingVolume)?this._mode===O.SCENE3D?this._tile._contentBoundingVolume.boundingSphere:this._tile._contentBoundingVolume2D.boundingSphere:this._mode===O.SCENE3D?this._tile._boundingVolume.boundingSphere:this._tile._boundingVolume2D.boundingSphere,this._drawCommand.boundingVolume=d,this._pickCommand.boundingVolume=d}this._drawCommand.castShadows=M.castShadows(e.shadows),this._drawCommand.receiveShadows=M.receiveShadows(e.shadows),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,U(this,t,e.style));var h=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=h?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=h?C.TRANSLUCENT:C.CESIUM_3D_TILE,s(this._batchTable)&&this._batchTable.update(e,t);var f=t.commandList,m=t.passes;m.render&&f.push(this._drawCommand),m.pick&&f.push(this._pickCommand)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){var e=this._drawCommand,t=this._pickCommand;return s(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._batchTable=this._batchTable&&this._batchTable.destroy(),u(this)},R}),define("Scene/Tileset3DTileContent",["../Core/defaultValue","../Core/defineProperties","../Core/destroyObject","../Core/getStringFromTypedArray","../Core/RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(e,t,r,i,n){this._tileset=e,this._tile=t,this._url=r,this._readyPromise=o.defer(),this.featurePropertiesDirty=!1,s(this,i,n)}function s(t,r,o){o=e(o,0);var a,s=new Uint8Array(r),l=i(s,o);try{a=JSON.parse(l)}catch(e){return void t._readyPromise.reject(new n("Invalid tile content."))}t._tileset.loadTileset(t._url,a,t._tile),t._readyPromise.resolve(t)}return t(a.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},batchTable:{get:function(){}}}),a.prototype.hasProperty=function(e,t){return!1},a.prototype.getFeature=function(e){},a.prototype.applyDebugSettings=function(e,t){},a.prototype.applyStyle=function(e,t){},a.prototype.update=function(e,t){},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return r(this)},a}),define("Scene/Cesium3DTileContentFactory",["./Batched3DModel3DTileContent","./Composite3DTileContent","./Instanced3DModel3DTileContent","./PointCloud3DTileContent","./Tileset3DTileContent"],function(e,t,r,i,n){"use strict";var o={b3dm:function(t,r,i,n,o){return new e(t,r,i,n,o)},pnts:function(e,t,r,n,o){return new i(e,t,r,n,o)},i3dm:function(e,t,i,n,o){return new r(e,t,i,n,o)},cmpt:function(e,r,i,n,a){return new t(e,r,i,n,a,o)},json:function(e,t,r,i,o){return new n(e,t,r,i,o)}};return o}),define("Scene/Cesium3DTileContentState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5})}),define("Scene/Cesium3DTileOptimizationHint",["../Core/freezeObject"],function(e){"use strict";return e({NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0})}),define("Scene/Cesium3DTileRefine",["../Core/freezeObject"],function(e){"use strict";return e({ADD:0,REPLACE:1})}),define("Scene/Empty3DTileContent",["../Core/defineProperties","../Core/destroyObject"],function(e,t){"use strict";function r(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}return e(r.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),r.prototype.hasProperty=function(e,t){return!1},r.prototype.getFeature=function(e){},r.prototype.applyDebugSettings=function(e,t){},r.prototype.applyStyle=function(e,t){},r.prototype.update=function(e,t){},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return t(this)},r}),define("Scene/TileBoundingRegion",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defineProperties","../Core/Ellipsoid","../Core/GeometryInstance","../Core/IntersectionTests","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Plane","../Core/Ray","../Core/Rectangle","../Core/RectangleOutlineGeometry","./PerInstanceColorAppearance","./Primitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(r){this.rectangle=f.clone(r.rectangle),this.minimumHeight=o(r.minimumHeight,0),this.maximumHeight=o(r.maximumHeight,0),this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t;var i=o(r.ellipsoid,s.WGS84);b(this,r.rectangle,i),this._orientedBoundingBox=d.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,i),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}function b(e,r,i){i.cartographicToCartesian(f.southwest(r),e.southwestCornerCartesian),i.cartographicToCartesian(f.northeast(r),e.northeastCornerCartesian),P.longitude=r.west,P.latitude=.5*(r.south+r.north),P.height=0;var n=i.cartographicToCartesian(P,E),o=t.cross(n,t.UNIT_Z,C);t.normalize(o,e.westNormal),P.longitude=r.east;var a=i.cartographicToCartesian(P,x),s=t.cross(t.UNIT_Z,a,C);t.normalize(s,e.eastNormal);var l,c=t.subtract(n,a,C),d=t.normalize(c,T),p=r.south;if(p>0){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;c<s;++c){var d=o[c],h=d._boundingVolume;if(!(h instanceof n||h instanceof i)){t._optimChildrenWithinParent=r.SKIP_OPTIMIZATION;break}var p=h._orientedBoundingBox,f=e.subtract(p.center,u.center,a),m=e.magnitude(f);e.divideByScalar(f,m,f);if(Math.abs(u.halfAxes[0]*f.x)+Math.abs(u.halfAxes[1]*f.y)+Math.abs(u.halfAxes[2]*f.z)+Math.abs(u.halfAxes[3]*f.x)+Math.abs(u.halfAxes[4]*f.y)+Math.abs(u.halfAxes[5]*f.z)+Math.abs(u.halfAxes[6]*f.x)+Math.abs(u.halfAxes[7]*f.y)+Math.abs(u.halfAxes[8]*f.z)<=Math.abs(p.halfAxes[0]*f.x)+Math.abs(p.halfAxes[1]*f.y)+Math.abs(p.halfAxes[2]*f.z)+Math.abs(p.halfAxes[3]*f.x)+Math.abs(p.halfAxes[4]*f.y)+Math.abs(p.halfAxes[5]*f.z)+Math.abs(p.halfAxes[6]*f.x)+Math.abs(p.halfAxes[7]*f.y)+Math.abs(p.halfAxes[8]*f.z)+m){t._optimChildrenWithinParent=r.SKIP_OPTIMIZATION;break}}}return t._optimChildrenWithinParent===r.USE_OPTIMIZATION},o}),define("Scene/Cesium3DTilesetStatistics",["../Core/defined"],function(e){"use strict";function t(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function r(t,i,n,o){var a=i.innerContents,s=i.pointsLength,l=i.trianglesLength,u=i.featuresLength,c=i.geometryByteLength,d=i.texturesByteLength,h=i.batchTableByteLength;if(o?(t.numberOfFeaturesLoaded+=n?-u:u,t.numberOfPointsLoaded+=n?-s:s,t.geometryByteLength+=n?-c:c,t.texturesByteLength+=n?-d:d,t.batchTableByteLength+=n?-h:h):(t.numberOfFeaturesSelected+=n?-u:u,t.numberOfPointsSelected+=n?-s:s,t.numberOfTrianglesSelected+=n?-l:l),e(a))for(var p=a.length,f=0;f<p;++f)r(t,a[f],n,o)}return t.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},t.prototype.incrementSelectionCounts=function(e){r(this,e,!1,!1)},t.prototype.incrementLoadCounts=function(e){r(this,e,!1,!0)},t.prototype.decrementLoadCounts=function(e){r(this,e,!0,!0)},t.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},t}),define("Scene/Cesium3DTilesetTraversal",["../Core/CullingVolume","../Core/defined","../Core/freezeObject","../Core/Intersect","../Core/ManagedArray","../Core/Math","../Core/OrthographicFrustum","./Cesium3DTileChildrenVisibility","./Cesium3DTileRefine","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,i){if(!t.debugFreezeFrame){var n=t._maximumScreenSpaceError;t._desiredTiles.length=0,t._selectedTiles.length=0,t._requestedTiles.length=0,t._selectedTilesToStyle.length=0,t._hasMixedContent=!1;var o=t._replacementList;o.splice(o.tail,t._replacementSentinel);var a=t._root;if(a.updateTransform(t._modelMatrix),a.insideViewerRequestVolume(r)&&(a._distanceToCamera=a.distanceToTile(r),!(A(t,t._geometricError,a,r)<=n)&&(a._visibilityPlaneMask=a.visibility(r,e.MASK_INDETERMINATE),a._visibilityPlaneMask!==e.MASK_OUTSIDE))){if(x(t,a,r,!0),t.skipLevelOfDetail)t.immediatelyLoadDesiredLevelOfDetail?t._skipTraversal.execute(t,a,r,i):(t._baseTraversal.leaves=t._skipTraversal.queue1,t._baseTraversal.execute(t,a,t.baseScreenSpaceError,r,i),t._skipTraversal.execute(t,void 0,r,i));else{t._baseTraversal.execute(t,a,n,r,i);for(var s=t._baseTraversal.leaves,l=s.length,u=0;u<l;++u)t._desiredTiles.push(s.get(u))}d(t,r,i),h(t,a,r),t._desiredTiles.trim()}}}function d(e,r,i){for(var n=e._desiredTiles,o=n.length,a=0;a<o;++a){var s=n.get(a);if(L(s))s.selected=!0,s._selectedFrame=r.frameNumber;else{var u=s._ancestorWithLoadedContent;if(s.hasRenderableContent&&s.contentAvailable&&(u=s),t(u))u.selected=!0,u._selectedFrame=r.frameNumber;else for(B.push(s);B.length>0;)for(var c=B.pop(),d=c.children,h=d.length,p=0;p<h;++p){var f=d[p];S(e,f,i),f.contentAvailable&&(f.selected=!0,f._finalResolution=!0,
  487. f._selectedFrame=r.frameNumber),f._depth-s._depth<2&&(f.contentAvailable&&f.refine!==l.ADD||B.push(f))}}}}function h(e,r,i){var n,o=U,a=V;for(o.push(r);o.length>0||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;m<h;++m){var g=d[m];o.push(g)}}}}function p(t,r,n){if(r.contentAvailable&&(r._visibilityPlaneMask===e.MASK_INSIDE||r.contentVisibility(n)!==i.OUTSIDE)){t._selectedTiles.push(r);var o=r.content;o.featurePropertiesDirty?(o.featurePropertiesDirty=!1,r.lastStyleTime=0,t._selectedTilesToStyle.push(r)):r._lastSelectedFrameNumber===n.frameNumber-1&&0!==r.lastStyleTime||t._selectedTilesToStyle.push(r),r._lastSelectedFrameNumber=n.frameNumber}}function f(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function m(){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.stack=new n,this.leaves=new n,this.baseScreenSpaceError=void 0,this.internalDFS=new v}function g(e,r,i,n){if(L(r)&&e._desiredTiles.push(r),r.hasTilesetContent&&r.contentExpired)return!1;if(r._screenSpaceError<=i&&!r.hasTilesetContent)return b(r,n),!1;var o=b(r,n),a=r.refine===l.ADD,u=r.refine===l.REPLACE&&0!=(o&s.VISIBLE_IN_REQUEST_VOLUME);return a||u||r.hasTilesetContent||!t(r._ancestorWithContent)}function v(){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.baseScreenSpaceError=void 0,this.stack=new n,this.allLoaded=void 0}function _(e){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.queue1=new n,this.queue2=new n,this.internalDFS=new y(e.selectionHeuristic),this.maxChildrenLength=0,this.scratchQueue=new n}function y(e){this.selectionHeuristic=e,this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.root=void 0,this.queue=void 0,this.stack=new n}function b(e,t){if(C(e,t))return e._childrenVisibility;var r=e.children;return I(r,e.computedTransform),D(r,t),P(e,t)}function C(e,t){return e._lastVisitedFrame===t.frameNumber}function w(e,r,i,n){++e._statistics.visited,r.selected=!1,r._finalResolution=!1,T(r,i),S(e,r,n),r.updateExpiration(),r._ancestorWithContent=void 0,r._ancestorWithLoadedContent=void 0;var o=r.parent;if(t(o)){var a=o.refine===l.REPLACE;r._ancestorWithContent=a&&o.hasRenderableContent?o:o._ancestorWithContent,r._ancestorWithLoadedContent=a&&o.hasRenderableContent&&o.contentAvailable?o:o._ancestorWithLoadedContent}}function S(e,r,i){if(i){var n=r.replacementNode;t(n)&&e._replacementList.splice(e._replacementSentinel,n)}}function T(e,t){e._screenSpaceErrorComputedFrame!==t.frameNumber&&(e._screenSpaceErrorComputedFrame=t.frameNumber,e._screenSpaceError=A(e._tileset,e.geometricError,e,t))}function E(e,r,i){return!t(r.parent)||r.parent.refine!==l.ADD||M(e,r,i)}function x(e,t,r,i){(t.contentUnloaded||t.contentExpired)&&t._requestedFrame!==r.frameNumber&&(i&&!E(e,t,r)||(t._requestedFrame=r.frameNumber,e._requestedTiles.push(t)))}function P(t,r){for(var i=s.NONE,n=t.children,o=n.length,a=t._visibilityPlaneMask,l=0;l<o;++l){var u=n[l],c=u.visibility(r,a);O(c)&&(i|=s.VISIBLE),u.insideViewerRequestVolume(r)?(i|=s.IN_REQUEST_VOLUME,O(c)&&(i|=s.VISIBLE_IN_REQUEST_VOLUME)):(O(c)&&(i|=s.VISIBLE_NOT_IN_REQUEST_VOLUME),c=e.MASK_OUTSIDE),u._visibilityPlaneMask=c}return t._childrenVisibility=i,i}function A(e,r,i,n){if(0===r)return 0;var s,l=n.camera,c=l.frustum,d=n.context,h=d.drawingBufferHeight;if(n.mode===u.SCENE2D||c instanceof a){t(c._offCenterFrustum)&&(c=c._offCenterFrustum);var p=d.drawingBufferWidth;s=r/(Math.max(c.top-c.bottom,c.right-c.left)/Math.max(p,h))}else{var f=Math.max(i._distanceToCamera,o.EPSILON7);if(s=r*h/(f*l.frustum.sseDenominator),e.dynamicScreenSpaceError){var m=e._dynamicScreenSpaceErrorComputedDensity,g=e.dynamicScreenSpaceErrorFactor;s-=o.fog(f,m)*g}}return s}function D(e,t){for(var r=e.length,i=0;i<r;++i){var n=e[i];n._distanceToCamera=n.distanceToTile(t),n._centerZDepth=n.distanceToTileCenter(t)}}function I(e,t){for(var r=e.length,i=0;i<r;++i){e[i].updateTransform(t)}}function O(t){return t!==e.MASK_OUTSIDE}function M(e,r,i){var n=e._maximumScreenSpaceError,o=r.parent;if(!t(o))return O(r._visibilityPlaneMask);var a=o.refine===l.ADD&&o._screenSpaceError>n;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;u<l;++u){var c=s?a[u]:a.get(u);t(r.shouldVisit)&&!r.shouldVisit(c)||i.push(c)}0===l&&t(r.leafHandler)&&r.leafHandler(o),r.visitEnd(o)}i.trim(n)}function k(e,r){var i=r.queue1,n=r.queue2;!t(e)||t(r.shouldVisit)&&!r.shouldVisit(e)||i.push(e);for(var o=0;i.length>0;){var a=i.length;o=Math.max(o,a);for(var s=0;s<a;++s){var l=i.get(s);r.visitStart(l);for(var u=r.getChildren(l),c=!t(u.get),d=u.length,h=0;h<d;++h){var p=c?u[h]:u.get(h);t(r.shouldVisit)&&!r.shouldVisit(p)||n.push(p)}0===d&&t(r.leafHandler)&&r.leafHandler(l),r.visitEnd(l)}i.length=0;var f=i;i=n,n=f,r.queue1=i,r.queue2=n}i.length=0,n.length=0,i.trim(o),n.trim(o)}var F={},B=[],U=[],V=[],z=r([]);return m.prototype.execute=function(e,t,r,i,n){this.tileset=e,this.frameState=i,this.outOfCore=n,this.leaves.length=0,this.baseScreenSpaceError=Math.max(r,this.tileset._maximumScreenSpaceError),this.internalDFS.tileset=this.tileset,this.internalDFS.frameState=this.frameState,this.internalDFS.outOfCore=this.outOfCore,this.internalDFS.baseScreenSpaceError=this.baseScreenSpaceError,N(t,this)},m.prototype.visitStart=function(e){C(e,this.frameState)||w(this.tileset,e,this.frameState,this.outOfCore)},m.prototype.visitEnd=function(e){e._lastVisitedFrame=this.frameState.frameNumber},m.prototype.getChildren=function(e){var t=this.tileset,r=this.outOfCore,i=this.frameState;if(!g(t,e,this.baseScreenSpaceError,i))return z;for(var n=e.children,o=n.length,a=!0,s=e.refine===l.REPLACE&&e.hasRenderableContent,u=0;u<o;++u){var c=n[u];x(t,c,i,!0),S(t,c,r),s&&(a=c.hasEmptyContent?a&&this.internalDFS.execute(c):a&&c.contentAvailable)}return a?n:z},m.prototype.shouldVisit=function(e){return O(e._visibilityPlaneMask)},m.prototype.leafHandler=function(e){if(this.tileset.skipLevelOfDetail||!L(e)){if(e.refine===l.REPLACE&&!R(e))return void++this.tileset._statistics.numberOfTilesCulledWithChildrenUnion;this.leaves.push(e)}},v.prototype.execute=function(e){return this.allLoaded=!0,N(e,this),this.allLoaded},v.prototype.visitStart=function(e){C(e,this.frameState)||w(this.tileset,e,this.frameState,this.outOfCore)},v.prototype.visitEnd=m.prototype.visitEnd,v.prototype.shouldVisit=function(e){return!e.hasRenderableContent&&O(e._visibilityPlaneMask)},v.prototype.getChildren=function(e){var t=this.tileset,r=this.frameState,i=this.outOfCore;if(!g(t,e,this.baseScreenSpaceError,r))return z;for(var n=e.children,o=n.length,a=0;a<o;++a){var s=n[a];x(t,s,r,!0),S(t,s,i),e.contentAvailable||(this.allLoaded=!1)}return n},v.prototype.updateAndCheckChildren=m.prototype.updateAndCheckChildren,_.prototype.execute=function(e,t,r,i){this.tileset=e,this.frameState=r,this.outOfCore=i,this.internalDFS.frameState=r,this.internalDFS.outOfCore=i,this.maxChildrenLength=0,k(t,this),this.queue1.length=0,this.queue2.length=0,this.scratchQueue.length=0,this.scratchQueue.trim(this.maxChildrenLength)},_.prototype.visitStart=function(e){C(e,this.frameState)||w(this.tileset,e,this.frameState,this.outOfCore)},_.prototype.visitEnd=m.prototype.visitEnd,_.prototype.getChildren=function(e){return this.scratchQueue.length=0,this.internalDFS.execute(e,this.scratchQueue),this.maxChildrenLength=Math.max(this.maxChildrenLength,this.scratchQueue.length),this.scratchQueue},_.prototype.leafHandler=function(e){L(e)||C(e,this.frameState)||this.tileset._desiredTiles.push(e)},y.prototype.execute=function(e,t){this.tileset=e._tileset,this.root=e,this.queue=t,N(e,this)},y.prototype.visitStart=function(e){C(e,this.frameState)||w(this.tileset,e,this.frameState,this.outOfCore)},y.prototype.visitEnd=m.prototype.visitEnd,y.prototype.getChildren=function(e){var r=this.tileset,i=r._maximumScreenSpaceError;if(e.hasTilesetContent&&e.contentExpired)return z;if(!e.hasTilesetContent){if(e.refine===l.ADD&&(x(r,e,this.frameState,!0),L(e)&&r._desiredTiles.push(e)),e._screenSpaceError<=i)return b(e,this.frameState),z;if(!e.hasEmptyContent&&e.contentUnloaded&&t(e._ancestorWithLoadedContent)&&this.selectionHeuristic(r,e._ancestorWithLoadedContent,e))return b(e,this.frameState),z}var n=b(e,this.frameState),o=e.refine===l.ADD&&e._screenSpaceError>i,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;d<c;++d)S(r,u[d],this.outOfCore);return u}return z},y.prototype.shouldVisit=function(e){return M(this.tileset,e,this.frameState)},y.prototype.leafHandler=function(e){if(e!==this.root){if(e.refine===l.REPLACE&&!R(e))return void++this.tileset._statistics.numberOfTilesCulledWithChildrenUnion;if(!e.hasEmptyContent)if(this.tileset.loadSiblings)for(var t=e.parent,r=t.children,i=r.length,n=0;n<i;++n)x(this.tileset,r[n],this.frameState,!1),S(this.tileset,r[n],this.outOfCore);else x(this.tileset,e,this.frameState,!0),S(this.tileset,e,this.outOfCore);this.queue.push(e)}else L(e)||this.tileset._desiredTiles.push(e)},F.selectTiles=c,F.BaseTraversal=m,F.SkipTraversal=_,F}),define("Scene/Cesium3DTileStyleEngine",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function r(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}return t(r.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}}}),r.prototype.makeDirty=function(){this._styleDirty=!0},r.prototype.applyStyle=function(t,r){if(t.ready&&(!e(this._style)||this._style.ready)){var i=this._styleDirty;r.passes.render&&(this._styleDirty=!1),i&&++this._lastStyleTime;for(var n=this._lastStyleTime,o=t._statistics,a=i?t._selectedTiles:t._selectedTilesToStyle,s=a.length,l=0;l<s;++l){var u=a[l];if(u.selected&&u.lastStyleTime!==n){var c=u.content;u.lastStyleTime=n,c.applyStyle(r,this._style),o.numberOfFeaturesStyled+=c.featuresLength,++o.numberOfTilesStyled}}}},r}),define("Scene/Cesium3DTileset",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DoublyLinkedList","../Core/Event","../Core/getBaseUri","../Core/getExtensionFromUri","../Core/Heap","../Core/isDataUri","../Core/joinUrls","../Core/JulianDate","../Core/loadJson","../Core/ManagedArray","../Core/Math","../Core/Matrix4","../Core/RuntimeError","../Renderer/ClearCommand","../Renderer/Pass","../ThirdParty/when","./Axis","./Cesium3DTile","./Cesium3DTileColorBlendMode","./Cesium3DTileOptimizations","./Cesium3DTileRefine","./Cesium3DTilesetStatistics","./Cesium3DTilesetTraversal","./Cesium3DTileStyleEngine","./LabelCollection","./SceneMode","./ShadowMode","./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,M,R,L,N,k,F,B){"use strict";function U(e){e=n(e,n.EMPTY_OBJECT);var t,r,i=e.url;"json"===h(i)?(t=i,r=d(i,!0)):f(i)?(t=i,r=""):(r=i,t=m(r,"tileset.json")),this._url=i,this._basePath=r,this._tilesetUrl=t,this._root=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._gltfUpAxis=void 0,this._processingQueue=[],this._selectedTiles=[],this._requestedTiles=[],this._desiredTiles=new _,this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0;var a=new u;this._replacementList=a,this._replacementSentinel=a.add(),this._trimTiles=!1,this._cullWithChildrenBounds=n(e.cullWithChildrenBounds,!0),this._hasMixedContent=!1,this._baseTraversal=new O.BaseTraversal,this._skipTraversal=new O.SkipTraversal({selectionHeuristic:z}),this._backfaceCommands=new _,this._maximumScreenSpaceError=n(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=n(e.maximumMemoryUsage,512),this._styleEngine=new M,this._modelMatrix=o(e.modelMatrix)?b.clone(e.modelMatrix):b.clone(b.IDENTITY),this._statistics=new I,this._statisticsLastColor=new I,this._statisticsLastPick=new I,this._tilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=T.defer(),this.dynamicScreenSpaceError=n(e.dynamicScreenSpaceError,!1),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=n(e.shadows,N.ENABLED),this.show=n(e.show,!0),this.colorBlendMode=P.HIGHLIGHT,this.colorBlendAmount=.5,this.loadProgress=new c,this.allTilesLoaded=new c,this.tileLoad=new c,this.tileUnload=new c,this.tileVisible=new c,this.skipLevelOfDetail=n(e.skipLevelOfDetail,!0),this.baseScreenSpaceError=n(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=n(e.skipScreenSpaceErrorFactor,16),this.skipLevels=n(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=n(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=n(e.loadSiblings,!1),this.debugFreezeFrame=n(e.debugFreezeFrame,!1),this.debugColorizeTiles=n(e.debugColorizeTiles,!1),this.debugWireframe=n(e.debugWireframe,!1),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=n(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=n(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=n(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=n(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=n(e.debugShowMemoryUsage,!1),this.debugShowUrl=n(e.debugShowUrl,!1);var s=this;U.loadJson(t).then(function(e){s._root=s.loadTileset(t,e);var r=o(e.asset.gltfUpAxis)?E.fromName(e.asset.gltfUpAxis):E.Y;s._asset=e.asset,s._properties=e.properties,s._geometricError=e.geometricError,s._gltfUpAxis=r,s._readyPromise.resolve(s)}).otherwise(function(e){s._readyPromise.reject(e)})}function V(e,i){var n,o,a,s,l,u=i.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof k)n=t.normalize(u.positionWC,re),o=u.directionWC,a=u.positionCartographic.height,s=d.minimumHeight,l=d.maximumHeight;else{var h=b.inverseTransformation(c.computedTransform,ne),p=i.mapProjection.ellipsoid,f=d.boundingVolume,m=b.multiplyByPoint(h,f.center,oe);if(t.magnitude(m)>p.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._screenSpaceError<t._screenSpaceError/n&&r._depth>t._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<i;++n)G(e,r[n])}function W(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function j(e,t){return function(){var r=e._processingQueue.indexOf(t);if(-1===r)return void--e._statistics.numberOfPendingRequests;e._processingQueue.splice(r,1),--e._statistics.numberOfTilesProcessing,t.hasRenderableContent&&(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,o(t.replacementNode)||(t.replacementNode=e._replacementList.add(t)))}}function q(e,t){for(var r=e._processingQueue,i=r.length,n=i-1;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;l<n;++l){var u=i[l];Q(u,t,X(u))}t._tileDebugLabels.update(r)}function K(e,t){e._styleEngine.applyStyle(e,t);var r,i=e._statistics,n=t.commandList,a=n.length,s=e._selectedTiles,l=s.length,u=e.tileVisible,c=e.skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&l>0;e._backfaceCommands.length=0,c&&n.push(ce);var d=n.length;for(r=0;r<l;++r){var h=s[r];h.selected&&(u.raiseEvent(h),h.update(e,t),i.incrementSelectionCounts(h.content),++i.selected)}var p=n.length;if(e._backfaceCommands.trim(),c){var f=e._backfaceCommands.values,m=p-d,g=f.length;for(n.length+=g,r=m-1;r>=0;--r)n[d+g+r]=n[d+r];for(r=0;r<g;++r)n[d+r]=f[r]}i.numberOfCommands=n.length-a,e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(o(e._tileDebugLabels)||(e._tileDebugLabels=new R),Z(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy()}function J(e,t){var r=t,i=e._statistics,n=de;for(n.push(t);n.length>0;){t=n.pop();for(var o=t.children,a=o.length,s=0;s<a;++s)n.push(o[s]);t!==r&&($(e,t),t.destroy(),--i.numberOfTilesTotal)}r.children=[]}function $(e,t){var r=t.replacementNode;if(o(r)){var i=e._statistics,n=e._replacementList;e.tileUnload.raiseEvent(t),n.remove(r),i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady}}function ee(e){var t=e._trimTiles;e._trimTiles=!1;for(var r=e._replacementList,i=e.totalMemoryUsageInBytes,n=1024*e._maximumMemoryUsage*1024,o=e._replacementSentinel,a=r.head;a!==o&&(i>n||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;v<g;++v){var _=f[v],y=new x(this,l,_,p);p.children.push(y),y._depth=p._depth+1,++a.numberOfTilesTotal,c.push({header:_,tile3D:y})}this._cullWithChildrenBounds&&A.checkChildrenWithinParent(p)}return u};var re=new t,ie=new r,ne=new b,oe=new t,ae=new t,se=new t,le=new t,ue={maximumFractionDigits:3},ce=new w({stencil:0,pass:S.CESIUM_3D_TILE}),de=[];return U.prototype.trimLoadedTiles=function(){this._trimTiles=!0},U.prototype.update=function(e){if(e.mode!==L.MORPHING&&this.show&&this.ready){o(this._loadTimestamp)||(this._loadTimestamp=g.clone(e.time)),this._timeSinceLoad=Math.max(1e3*g.secondsDifference(e.time,this._loadTimestamp),0);var t=e.passes,r=t.pick&&!t.render,i=!r,n=this._statistics;n.clear(),i&&q(this,e),this.dynamicScreenSpaceError&&V(this,e),O.selectTiles(this,e,i),H(this,i),K(this,e),i&&ee(this),te(this,e);var a=r?this._statisticsLastPick:this._statisticsLastColor;I.clone(n,a)}},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),o(this._root)){var e=de;for(e.push(this._root);e.length>0;){var t=e.pop();t.destroy();for(var r=t.children,i=r.length,n=0;n<i;++n)e.push(r[n])}}return this._root=void 0,s(this)},U}),define("ThirdParty/jsep",[],function(){if(function(e){"use strict";var t=function(e,t){var r=new Error(e+" at character "+t);throw r.index=t,r.description=e,r},r={"-":!0,"!":!0,"~":!0,"+":!0},i={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":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<y;){if((e=v(f++))===i){n=!0;break}if("\\"===e)switch(e=v(f++)){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+="\\"+e}else r+=e}return n||t('Unclosed quote after "'+r+'"',f),{type:"Literal",value:r,raw:i+r+i}},P=function(){var r,i=_(f),n=f;for(d(i)?f++:t("Unexpected "+v(f),f);f<y&&(i=_(f),h(i));)f++;return r=e.slice(n,f),s.hasOwnProperty(r)?{type:"Literal",value:s[r],raw:r}:"this"===r?{type:"ThisExpression"}:{type:"Identifier",name:r}},A=function(e){for(var r,i,n=[],o=!1;f<y;){if(b(),(r=_(f))===e){o=!0,f++;break}44===r?f++:(i=C(),i&&"Compound"!==i.type||t("Expected comma",f),n.push(i))}return o||t("Expected "+String.fromCharCode(e),f),n},D=function(){var e,r;for(e=_(f),r=40===e?I():P(),b(),e=_(f);46===e||91===e||40===e;)f++,46===e?(b(),r={type:"MemberExpression",computed:!1,object:r,property:P()}):91===e?(r={type:"MemberExpression",computed:!0,object:r,property:C()},b(),e=_(f),93!==e&&t("Unclosed [",f),f++):40===e&&(r={type:"CallExpression",arguments:A(41),callee:r}),b(),e=_(f);return r},I=function(){f++;var e=C();if(b(),41===_(f))return f++,e;t("Unclosed (",f)},O=function(){return f++,{type:"ArrayExpression",elements:A(93)}},M=[];f<y;)n=_(f),59===n||44===n?f++:(p=C())?M.push(p):f<y&&t('Unexpected "'+v(f)+'"',f);return 1===M.length?M[0]:{type:"Compound",body:M}};if(p.version="0.3.1",p.toString=function(){return"JavaScript Expression Parser (JSEP) v"+p.version},p.addUnaryOp=function(e){return o=Math.max(e.length,o),r[e]=!0,this},p.addBinaryOp=function(e,t){return a=Math.max(e.length,a),i[e]=t,this},p.addLiteral=function(e,t){return s[e]=t,this},p.removeUnaryOp=function(e){return delete r[e],e.length===o&&(o=n(r)),this},p.removeAllUnaryOps=function(){return r={},o=0,this},p.removeBinaryOp=function(e){return delete i[e],e.length===a&&(a=n(i)),this},p.removeAllBinaryOps=function(){return i={},a=0,this},p.removeLiteral=function(e){return delete s[e],this},p.removeAllLiterals=function(){return s={},this},"undefined"==typeof exports){var f=e.jsep;e.jsep=p,p.noConflict=function(){return e.jsep===p&&(e.jsep=f),p}}else"undefined"!=typeof module&&module.exports?exports=module.exports=p:exports.parse=p}(this),"undefined"!=typeof jsep)return jsep.noConflict()}),define("Scene/ExpressionNodeType",["../Core/freezeObject"],function(e){"use strict";return e({VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18})}),define("Scene/Expression",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Check","../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/isArray","../Core/Math","../Core/RuntimeError","../ThirdParty/jsep","./ExpressionNodeType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t){this._expression=e,e=x(e,t),e=D(P(e)),d.addBinaryOp("=~",0),d.addBinaryOp("!~",0);var r;try{r=d(e)}catch(e){throw new c(e)}this._runtimeAst=U(this,r)}function f(e){return e-Math.floor(e)}function m(e){return Math.pow(2,e)}function g(e){return u.logBase(e,2)}function v(i){return function(n,o){if("number"==typeof o)return i(o);if(o instanceof e)return e.fromElements(i(o.x),i(o.y),J.getCartesian2());if(o instanceof t)return t.fromElements(i(o.x),i(o.y),i(o.z),J.getCartesian3());if(o instanceof r)return r.fromElements(i(o.x),i(o.y),i(o.z),i(o.w),J.getCartesian4());throw new c('Function "'+n+'" requires a vector or number argument. Argument is '+o+".")}}function _(i,n){return function(o,a,s){if(n&&"number"==typeof s){if("number"==typeof a)return i(a,s);if(a instanceof e)return e.fromElements(i(a.x,s),i(a.y,s),J.getCartesian2());if(a instanceof t)return t.fromElements(i(a.x,s),i(a.y,s),i(a.z,s),J.getCartesian3());if(a instanceof r)return r.fromElements(i(a.x,s),i(a.y,s),i(a.z,s),i(a.w,s),J.getCartesian4())}if("number"==typeof a&&"number"==typeof s)return i(a,s);if(a instanceof e&&s instanceof e)return e.fromElements(i(a.x,s.x),i(a.y,s.y),J.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(i(a.x,s.x),i(a.y,s.y),i(a.z,s.z),J.getCartesian3());if(a instanceof r&&s instanceof r)return r.fromElements(i(a.x,s.x),i(a.y,s.y),i(a.z,s.z),i(a.w,s.w),J.getCartesian4());throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+" and "+s+".")}}function y(i,n){return function(o,a,s,l){if(n&&"number"==typeof l){if("number"==typeof a&&"number"==typeof s)return i(a,s,l);if(a instanceof e&&s instanceof e)return e.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),J.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),i(a.z,s.z,l),J.getCartesian3());if(a instanceof r&&s instanceof r)return r.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),i(a.z,s.z,l),i(a.w,s.w,l),J.getCartesian4())}if("number"==typeof a&&"number"==typeof s&&"number"==typeof l)return i(a,s,l);if(a instanceof e&&s instanceof e&&l instanceof e)return e.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),J.getCartesian2());if(a instanceof t&&s instanceof t&&l instanceof t)return t.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),i(a.z,s.z,l.z),J.getCartesian3());if(a instanceof r&&s instanceof r&&l instanceof r)return r.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),i(a.z,s.z,l.z),i(a.w,s.w,l.w),J.getCartesian4())
  488. ;throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+", "+s+", and "+l+".")}}function b(i,n){if("number"==typeof n)return Math.abs(n);if(n instanceof e)return e.magnitude(n);if(n instanceof t)return t.magnitude(n);if(n instanceof r)return r.magnitude(n);throw new c('Function "'+i+'" requires a vector or number argument. Argument is '+n+".")}function C(i,n){if("number"==typeof n)return 1;if(n instanceof e)return e.normalize(n,J.getCartesian2());if(n instanceof t)return t.normalize(n,J.getCartesian3());if(n instanceof r)return r.normalize(n,J.getCartesian4());throw new c('Function "'+i+'" requires a vector or number argument. Argument is '+n+".")}function w(i,n,o){if("number"==typeof n&&"number"==typeof o)return Math.abs(n-o);if(n instanceof e&&o instanceof e)return e.distance(n,o);if(n instanceof t&&o instanceof t)return t.distance(n,o);if(n instanceof r&&o instanceof r)return r.distance(n,o);throw new c('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function S(i,n,o){if("number"==typeof n&&"number"==typeof o)return n*o;if(n instanceof e&&o instanceof e)return e.dot(n,o);if(n instanceof t&&o instanceof t)return t.dot(n,o);if(n instanceof r&&o instanceof r)return r.dot(n,o);throw new c('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function T(e,r,i){if(r instanceof t&&i instanceof t)return t.cross(r,i,J.getCartesian3());throw new c('Function "'+e+'" requires vec3 arguments. Arguments are '+r+" and "+i+".")}function E(e,t,r,i,n){this._type=e,this._value=t,this._left=r,this._right=i,this._test=n,this.evaluate=void 0,V(this)}function x(e,t){if(!o(t))return e;for(var r in t)if(t.hasOwnProperty(r)){var i=new RegExp("\\$\\{"+r+"\\}","g"),n="("+t[r]+")";o(n)&&(e=e.replace(i,n))}return e}function P(e){return e.replace(re,ie)}function A(e){return e.replace(ne,"\\")}function D(e){for(var t=e,r="",i=t.indexOf("${");i>=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o<i)n=t.indexOf("'",o+1),r+=t.substr(0,n+1),t=t.substr(n+1),i=t.indexOf("${");else if(a>=0&&a<i)n=t.indexOf('"',a+1),r+=t.substr(0,n+1),t=t.substr(n+1),i=t.indexOf("${");else{r+=t.substr(0,i);var s=t.indexOf("}");if(s<0)throw new c("Unmatched {.");r+="czm_"+t.substr(i+2,s-(i+2)),t=t.substr(s+1),i=t.indexOf("${")}}return r+=t}function I(e){var t=typeof e.value;return null===e.value?new E(h.LITERAL_NULL,null):"boolean"===t?new E(h.LITERAL_BOOLEAN,e.value):"number"===t?new E(h.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=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;p<l;++p)i[p]=U(e,s[p]);return new E(h.LITERAL_VECTOR,r,i)}if("isNaN"===r||"isFinite"===r)return 0===l?"isNaN"===r?new E(h.LITERAL_BOOLEAN,!0):new E(h.LITERAL_BOOLEAN,!1):(i=U(e,s[0]),new E(h.UNARY,r,i));if("isExactClass"===r||"isClass"===r){if(l<1||l>1)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<t.elements.length;u++)l[u]=U(e,t.elements[u]);r=new E(h.ARRAY,l)}return r}function V(e){e._type===h.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===h.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===h.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluategetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:o(ae[e._value])&&(e.evaluate=G(e._value)):e._type===h.BINARY?"+"===e._value?e.evaluate=e._evaluatePlus:"-"===e._value?e.evaluate=e._evaluateMinus:"*"===e._value?e.evaluate=e._evaluateTimes:"/"===e._value?e.evaluate=e._evaluateDivide:"%"===e._value?e.evaluate=e._evaluateMod:"==="===e._value?e.evaluate=e._evaluateEqualsStrict:"!=="===e._value?e.evaluate=e._evaluateNotEqualsStrict:"<"===e._value?e.evaluate=e._evaluateLessThan:"<="===e._value?e.evaluate=e._evaluateLessThanOrEquals:">"===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<r;++i)if(t[i]._type!==h.LITERAL_NUMBER)return;var o=t[0]._value,a=t[1]._value,s=t[2]._value,l=4===r?t[3]._value:1;return n.fromHsl(o,a,s,l,oe)}function Y(e){for(var t=e._left,r=t.length,i=0;i<r;++i)if(t[i]._type!==h.LITERAL_NUMBER)return;var n=oe;return n.red=t[0]._value/255,n.green=t[1]._value/255,n.blue=t[2]._value/255,n.alpha=4===r?t[3]._value:1,n}function X(e){return e%1==0?e.toFixed(1):e.toString()}function Q(e){return"vec3("+X(e.red)+", "+X(e.green)+", "+X(e.blue)+")"}function Z(e){return"vec4("+X(e.red)+", "+X(e.green)+", "+X(e.blue)+", "+X(e.alpha)+")"}function K(e,t,r,i){for(var n=e.length,o=new Array(n),a=0;a<n;++a)o[a]=e[a].getShaderExpression(t,r,i);return o}a(p.prototype,{expression:{get:function(){return this._expression}}});var J={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new e],cartesian3Array:[new t],cartesian4Array:[new r],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=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;u<l;++u){var d=s[u].evaluate(i,n);if("number"==typeof d)o.push(d);else if(d instanceof e)o.push(d.x,d.y);else if(d instanceof t)o.push(d.x,d.y,d.z);else{if(!(d instanceof r))throw new c(a+" argument must be a vector or number. Argument is "+d+".");o.push(d.x,d.y,d.z,d.w)}}var h=o.length,p=parseInt(a.charAt(3));if(0===h)throw new c("Invalid "+a+" constructor. No valid arguments.");if(h<p&&h>1)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<this._value.length;i++)r[i]=this._value[i].evaluate(e,t);return r},E.prototype._evaluateNot=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "!" requires a boolean argument. Argument is '+r+".");return!r},E.prototype._evaluateNegative=function(i,n){var o=this._left.evaluate(i,n);if(o instanceof e)return e.negate(o,J.getCartesian2());if(o instanceof t)return t.negate(o,J.getCartesian3());if(o instanceof r)return r.negate(o,J.getCartesian4());if("number"==typeof o)return-o;throw new c('Operator "-" requires a vector or number argument. Argument is '+o+".")},E.prototype._evaluatePositive=function(i,n){var o=this._left.evaluate(i,n);if(!(o instanceof e||o instanceof t||o instanceof r||"number"==typeof o))throw new c('Operator "+" requires a vector or number argument. Argument is '+o+".");return o},E.prototype._evaluateLessThan=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._evaluateLessThanOrEquals=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._evaluateGreaterThan=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._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<v;++y)_+=a[y],y<v-1&&(_+=", ");return _+=")";case h.LITERAL_REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.LITERAL_UNDEFINED:throw new c("Error generating style shader: undefined is not supported.");case h.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===p)return"u_tilesetTime"}},p}),define("Scene/ConditionsExpression",["../Core/clone","../Core/defined","../Core/defineProperties","./Expression"],function(e,t,r,i){"use strict";function n(t,r){this._conditionsExpression=e(t,!0),this._conditions=t.conditions,this._runtimeConditions=void 0,a(this,r)}function o(e,t){this.condition=e,this.expression=t}function a(e,r){var n=[],a=e._conditions;if(t(a)){for(var s=a.length,l=0;l<s;++l){var u=a[l],c=String(u[0]),d=String(u[1]);n.push(new o(new i(c,r),new i(d,r)))}e._runtimeConditions=n}}return r(n.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),n.prototype.evaluate=function(e,r,i){var n=this._runtimeConditions;if(t(n))for(var o=n.length,a=0;a<o;++a){var s=n[a];if(s.condition.evaluate(e,r))return s.expression.evaluate(e,r,i)}},n.prototype.evaluateColor=function(e,r,i){var n=this._runtimeConditions;if(t(n))for(var o=n.length,a=0;a<o;++a){var s=n[a];if(s.condition.evaluate(e,r))return s.expression.evaluateColor(e,r,i)}},n.prototype.getShaderFunction=function(e,r,i,n){var o=this._runtimeConditions;if(t(o)&&0!==o.length){for(var a="",s=o.length,l=0;l<s;++l){var u=o[l],c=u.condition.getShaderExpression(r,i),d=u.expression.getShaderExpression(r,i);a+=" "+(0===l?"if":"else if")+" ("+c+") \n { \n return "+d+"; \n } \n"}return a=n+" "+e+"() \n{ \n"+a+" return "+n+"(1.0); \n} \n"}},n}),define("Scene/Cesium3DTileStyle",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadJson","../Core/RequestScheduler","../ThirdParty/when","./ConditionsExpression","./Expression"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){this._style=void 0,this._ready=!1,this._color=void 0,this._show=void 0,this._pointSize=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1;var t;t="string"==typeof e?o(e):s.resolve(e);var r=this;this._readyPromise=t.then(function(e){return d(r,e),r})}function d(i,n){i._style=e(n,!0),n=t(n,t.EMPTY_OBJECT),i.color=n.color,i.show=n.show,i.pointSize=n.pointSize;var o={};if(r(n.meta)){var a=n.defines,s=t(n.meta,t.EMPTY_OBJECT);for(var l in s)s.hasOwnProperty(l)&&(o[l]=new u(s[l],a))}i._meta=o,i._ready=!0}return i(c.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){var i=t(this._style,t.EMPTY_OBJECT).defines;r(e)?"boolean"==typeof e?this._show=new u(String(e)):"string"==typeof e?this._show=new u(e,i):r(e.conditions)?this._show=new l(e,i):this._show=e:this._show=void 0,this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){var i=t(this._style,t.EMPTY_OBJECT).defines;r(e)?"string"==typeof e?this._color=new u(e,i):r(e.conditions)?this._color=new l(e,i):this._color=e:this._color=void 0,this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){var i=t(this._style,t.EMPTY_OBJECT).defines;r(e)?"number"==typeof e?this._pointSize=new u(String(e)):"string"==typeof e?this._pointSize=new u(e,i):r(e.conditions)?this._pointSize=new l(e,i):this._pointSize=e:this._pointSize=void 0,this._pointSizeShaderFunctionReady=!1}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}}),c.prototype.getColorShaderFunction=function(e,t,i){return this._colorShaderFunctionReady?this._colorShaderFunction:(this._colorShaderFunctionReady=!0,this._colorShaderFunction=r(this.color)?this.color.getShaderFunction(e,t,i,"vec4"):void 0,this._colorShaderFunction)},c.prototype.getShowShaderFunction=function(e,t,i){
  489. return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,this._showShaderFunction=r(this.show)?this.show.getShaderFunction(e,t,i,"bool"):void 0,this._showShaderFunction)},c.prototype.getPointSizeShaderFunction=function(e,t,i){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=r(this.pointSize)?this.pointSize.getShaderFunction(e,t,i,"float"):void 0,this._pointSizeShaderFunction)},c}),define("Scene/CircleEmitter",["../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,this._radius),o=i*Math.cos(r),a=i*Math.sin(r);t.position=e.fromElements(o,a,0,t.position),t.velocity=e.clone(e.UNIT_Z,t.velocity)},o}),define("Scene/ConeEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(e){this._angle=r(e,a)}var a=n.toRadians(30);return i(o.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}}),o.prototype.emit=function(t){var r=Math.tan(this._angle),i=n.randomBetween(0,n.TWO_PI),o=n.randomBetween(0,r),a=o*Math.cos(i),s=o*Math.sin(i);t.velocity=e.fromElements(a,s,1,t.velocity),e.normalize(t.velocity,t.velocity),t.position=e.clone(e.ZERO,t.position)},o}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function w(e,t,r,i){return oe=!1,se=!1,T(e,e._urlParts,function(n){return n(e,t,r,i)})}function S(e,t,r,i,n,o,a){return oe=!1,se=!1,ue=!1,de=!1,T(e,e._pickFeaturesUrlParts,function(s){return s(e,t,r,i,n,o,a)})}function T(e,t,r){for(var i="",n=0;n<t.length;++n){var o=t[n];i+="string"==typeof o?o:encodeURIComponent(r(o))}var s=e._proxy;return a(s)&&(i=s.getURL(i)),i}function E(e,t){if(a(e)){for(var r,i,n=[],o=0,s=Object.keys(t);o<e.length;){r=Number.MAX_VALUE,i=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&u<r&&(r=u,i=s[l])}a(i)?(o<r&&n.push(e.substring(o,r)),n.push(t[i]),o=r+i.length):(n.push(e.substring(o)),o=e.length)}return n}}function x(e,t,r){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var i=e.urlSchemeZeroPadding[t];if("string"==typeof i){var n=i.length;n>1&&(r=r.length>=n?r:new Array(n-r.toString().length+1).join("0")+r)}}return r}function P(e,t,r,i){return x(e,"{x}",t)}function A(e,t,r,i){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)&&i<n?n-i-1:i)}function M(e,t,r,i){return x(e,"{z}",i)}function R(e,t,r,i){var n=(t+r+i)%e._subdomains.length;return e._subdomains[n]}function L(e,t,r,i){oe||(e.tilingScheme.tileXYToRectangle(t,r,i,ae),ae.west=g.toDegrees(ae.west),ae.south=g.toDegrees(ae.south),ae.east=g.toDegrees(ae.east),ae.north=g.toDegrees(ae.north),oe=!0)}function N(e,t,r,i){return L(e,t,r,i),ae.west}function k(e,t,r,i){return L(e,t,r,i),ae.south}function F(e,t,r,i){return L(e,t,r,i),ae.east}function B(e,t,r,i){return L(e,t,r,i),ae.north}function U(e,t,r,i){se||(e.tilingScheme.tileXYToNativeRectangle(t,r,i,le),se=!0)}function V(e,t,r,i){return U(e,t,r,i),le.west}function z(e,t,r,i){return U(e,t,r,i),le.south}function G(e,t,r,i){return U(e,t,r,i),le.east}function H(e,t,r,i){return U(e,t,r,i),le.north}function W(e,t,r,i){return e.tileWidth}function j(e,t,r,i){return e.tileHeight}function q(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),ce.x}function Y(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),ce.y}function X(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),e.tileWidth-ce.x-1}function Q(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),e.tileHeight-ce.y-1}function Z(e,t,r,i,n,o,a){if(!ue){te(e,t,r,i,n,o);var s=pe,l=e.tilingScheme.tileXYToNativeRectangle(t,r,i,he);ce.x=e.tileWidth*(s.x-l.west)/l.width|0,ce.y=e.tileHeight*(l.north-s.y)/l.height|0,ue=!0}}function K(e,t,r,i,n,o,a){return g.toDegrees(n)}function J(e,t,r,i,n,o,a){return g.toDegrees(o)}function $(e,t,r,i,n,o,a){return te(e,t,r,i,n,o),pe.x}function ee(e,t,r,i,n,o,a){return te(e,t,r,i,n,o),pe.y}function te(e,t,r,i,n,o,a){if(!de){if(e.tilingScheme instanceof c)pe.x=g.toDegrees(n),pe.y=g.toDegrees(o);else{var s=fe;s.longitude=n,s.latitude=o,e.tilingScheme.projection.project(s,pe)}de=!0}}function re(e,t,r,i,n,o,a){return a}var ie={"{x}":P,"{y}":D,"{z}":M,"{s}":R,"{reverseX}":A,"{reverseY}":I,"{reverseZ}":O,"{westDegrees}":N,"{southDegrees}":k,"{eastDegrees}":F,"{northDegrees}":B,"{westProjected}":V,"{southProjected}":z,"{eastProjected}":G,"{northProjected}":H,"{width}":W,"{height}":j},ne=i(ie,{"{i}":q,"{j}":Y,"{reverseI}":X,"{reverseJ}":Q,"{longitudeDegrees}":K,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":re});s(C.prototype,{url:{get:function(){return this._url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),C.prototype.reinitialize=function(e){var t=this;t._readyPromise=y(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,d(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new _({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=v.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var r=e.credit;"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;x<E.length;x++)if(m.test(E.item(x).nodeName))h=E.item(x);else if(w.test(E.item(x).nodeName)){f=E.item(x);for(var P=E.item(x).childNodes,A=0;A<P.length;A++)C.test(P.item(A).nodeName)&&T.push(P.item(A))}else S.test(E.item(x).nodeName)&&(p=E.item(x));var D;if(!i(f)||!i(p))return D="Unable to find expected tilesets or bbox attributes in "+a(_,"tilemapresource.xml")+".",v=c.handleError(v,b,b.errorEvent,D,void 0,void 0,void 0,g),void(v.retry||y.reject(new u(D)));var I=r(n.fileExtension,h.getAttribute("extension")),O=r(n.tileWidth,parseInt(h.getAttribute("width"),10)),M=r(n.tileHeight,parseInt(h.getAttribute("height"),10)),R=r(n.minimumLevel,parseInt(T[0].getAttribute("order"),10)),L=r(n.maximumLevel,parseInt(T[T.length-1].getAttribute("order"),10)),N=f.getAttribute("profile"),k=n.tilingScheme;if(!i(k))if("geodetic"===N||"global-geodetic"===N)k=new o({ellipsoid:n.ellipsoid});else{if("mercator"!==N&&"global-mercator"!==N)return D=a(_,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+N+".",v=c.handleError(v,b,b.errorEvent,D,void 0,void 0,void 0,g),void(v.retry||y.reject(new u(D)));k=new d({ellipsoid:n.ellipsoid})}var F=l.clone(n.rectangle);if(!i(F)){var B,U,V,z;r(n.flipXY,!1)?(V=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),z=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(V=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),z=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var G="geodetic"===N||"mercator"===N;if(k instanceof o||G)B=t.fromDegrees(V.x,V.y),U=t.fromDegrees(z.x,z.y);else{var H=k.projection;B=H.unproject(V),U=H.unproject(z)}F=new l(B.longitude,B.latitude,U.longitude,U.latitude)}F.west<k.rectangle.west&&(F.west=k.rectangle.west),F.east>k.rectangle.east&&(F.east=k.rectangle.east),F.south<k.rectangle.south&&(F.south=k.rectangle.south),F.north>k.rectangle.north&&(F.north=k.rectangle.north);var 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<i;n++){var o=t[n];if(e.equals(o,r))return!0}return!1}function l(e){var t=e.element;if(r(t)){var i=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(t)}}function u(e,t){var i,n,a,s=e._displayedCredits.textCredits;for(i=0;i<t.length;i++)a=t[i],r(a)&&(n=s.indexOf(a),-1===n?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(i=0;i<s.length;i++)a=s[i],r(a)&&l(a)}function c(e,t){var i,n,o,s=e._displayedCredits.imageCredits;for(i=0;i<t.length;i++)o=t[i],r(o)&&(n=s.indexOf(o),-1===n?a(o,e._imageContainer):s.splice(n,1));for(i=0;i<s.length;i++)o=s[i],r(o)&&l(o)}function d(e,r){var i=document.createElement("span");i.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(i),e.appendChild(n),this._delimiter=t(r," • "),this._textContainer=n,this._imageContainer=i,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return d.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var r=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(r[e.id]=e)}},d.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var r=this._defaultTextCredits;s(r,e)||r.push(e)}},d.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?-1!==(t=this._defaultImageCredits.indexOf(e))&&this._defaultImageCredits.splice(t,1):-1!==(t=this._defaultTextCredits.indexOf(e))&&this._defaultTextCredits.splice(t,1)},d.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},d.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},d.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),i(this)},d.prototype.isDestroyed=function(){return!1},d}),define("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,r,i,n){"use strict";function o(r){r=e(r,e.EMPTY_OBJECT);var i=r.attributeName,o=r.perInstanceAttribute;t(o)||(o=!1);var a,s=e(r.glslDatatype,"vec3"),l="v_"+i;if("normal"===i||"tangent"===i||"bitangent"===i)a="vec4 getColor() { return vec4(("+l+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===i&&(s="vec2"),s){case"float":a="vec4 getColor() { return vec4(vec3("+l+"), 1.0); }\n";break;case"vec2":a="vec4 getColor() { return vec4("+l+", 0.0, 1.0); }\n";break;case"vec3":a="vec4 getColor() { return vec4("+l+", 1.0); }\n";break;case"vec4":a="vec4 getColor() { return "+l+"; }\n"}var u="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+s+" "+i+";\n")+"varying "+s+" "+l+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?l+" = czm_batchTable_"+i+"(batchId);\n":l+" = "+i+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",c="varying "+s+" "+l+";\n"+a+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(r.translucent,!1),this._vertexShaderSource=e(r.vertexShaderSource,u),this._fragmentShaderSource=e(r.fragmentShaderSource,c),this._renderState=n.getDefaultRenderState(!1,!1,r.renderState),this._closed=e(r.closed,!1),this._attributeName=i,this._glslDatatype=s}return r(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),define("Scene/DebugCameraPrimitive",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/FrustumGeometry","../Core/FrustumOutlineGeometry","../Core/GeometryInstance","../Core/Matrix3","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/Quaternion","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._camera=e.camera,this._color=i(e.color,t.CYAN),this._updateOnChange=i(e.updateOnChange,!0),this.show=i(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var y=new e,b=new c,C=new m,w=new p,S=new f,T=new d,E=new h,x=new t,P=[1,1e5];return _.prototype.update=function(i){if(this.show){var n,o,a=this._planesPrimitives,h=this._outlinePrimitives;if(this._updateOnChange){for(o=a.length,n=0;n<o;++n)h[n]=h[n]&&h[n].destroy(),a[n]=a[n]&&a[n].destroy();a.length=0,h.length=0}if(0===a.length){var _,A=this._camera,D=A.frustum;_=D instanceof p?w:D instanceof f?S:D instanceof d?T:E,_=D.clone(_);var I=i.frustumSplits,O=I.length-1;O<=0&&(I=P,I[0]=this._camera.frustum.near,I[1]=this._camera.frustum.far,O=1);var M=A.positionWC,R=A.directionWC,L=A.upWC,N=A.rightWC;N=e.negate(N,y);var k=b;c.setColumn(k,0,N,k),c.setColumn(k,1,L,k),c.setColumn(k,2,R,k);var F=m.fromRotationMatrix(k,C);for(a.length=h.length=O,n=0;n<O;++n)_.near=I[n],_.far=I[n+1],a[n]=new v({geometryInstances:new u({geometry:new s({origin:M,orientation:F,frustum:_,_drawNearPlane:0===n}),attributes:{color:r.fromColor(t.fromAlpha(this._color,.1,x))},id:this.id,pickPrimitive:this}),appearance:new g({translucent:!0,flat:!0}),asynchronous:!1}),h[n]=new v({geometryInstances:new u({geometry:new l({origin:M,orientation:F,frustum:_,_drawNearPlane:0===n}),attributes:{color:r.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new g({translucent:!1,flat:!0}),asynchronous:!1})}for(o=a.length,n=0;n<o;++n)h[n].update(i),a[n].update(i)}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return o(this)},_}),define("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this.length=r(e.length,1e7),this._length=void 0,this.width=r(e.width,2),this._width=void 0,this.show=r(e.show,!0),this.modelMatrix=a.clone(r(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(r){if(this.show){if(!i(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,i(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),d=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,d],appearance:new l,asynchronous:!1})}this._primitive.update(r)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),define("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),define("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),define("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,r){var i=e.radii,n=r.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,C),a=t.magnitude(o),s=t.normalize(o,w),l=t.normalize(t.cross(t.UNIT_Z,o,S),S),u=t.normalize(t.cross(s,l,T),T),c=Math.sqrt(t.magnitudeSquared(o)-1),d=t.multiplyByScalar(s,1/a,C),h=c/a,p=t.multiplyByScalar(l,h,w),f=t.multiplyByScalar(u,h,S),m=t.add(d,f,T);t.subtract(m,p,m),t.multiplyComponents(i,m,m),t.pack(m,b,0);var g=t.subtract(d,f,T);t.subtract(g,p,g),t.multiplyComponents(i,g,g),t.pack(g,b,3);var v=t.add(d,f,T);t.add(v,p,v),t.multiplyComponents(i,v,v),t.pack(v,b,6);var _=t.subtract(d,f,T);return t.add(_,p,_),t.multiplyComponents(i,_,_),t.pack(_,b,9),b}var b=n.supportsTypedArrays()?new Float32Array(12):[],C=new t,w=new t,S=new t,T=new t;return _.prototype.update=function(n){if(this._mode=n.mode,n.mode===v.SCENE3D){var g=n.context,_=n.mapProjection.ellipsoid;i(this._command)||(this._rs=d.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=h.fromCache({context:g,vertexShaderSource:m,fragmentShaderSource:f,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,_.maximumRadius),pass:c.OPAQUE,owner:this}));var b=y(_,n);if(i(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(b);else{var C=new o({attributes:{position:new a({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:b})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:g,geometry:C,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},_.prototype.execute=function(e,t){this._mode===v.SCENE3D&&this._command.execute(e,t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},_}),define("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,r,i,n,o){"use strict";function a(t){function r(t){var r=t.alpha;if(!e(r))return n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0);n._alpha=i.toRadians(r),n._beta=i.toRadians(t.beta),n._gamma=i.toRadians(t.gamma)}this._scene=t,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var n=this;window.addEventListener("deviceorientation",r,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",r,!1)}}function s(e,t,r,i){var a=e.direction,s=e.right,d=e.up,h=o.fromAxisAngle(a,r,u),p=o.fromAxisAngle(s,i,l),f=o.multiply(p,h,p),m=o.fromAxisAngle(d,t,u);o.multiply(m,f,f);var g=n.fromQuaternion(f,c);n.multiplyByVector(g,s,s),n.multiplyByVector(g,d,d),n.multiplyByVector(g,a,a)}var l=new o,u=new o,c=new n;return a.prototype.update=function(){if(e(this._alpha)){e(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var t=this._lastAlpha-this._alpha,r=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;s(this._scene.camera,-t,r,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._removeListener(),t(this)},a}),define("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),
  490. 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(e<t[0])return h=0;if(e>t[r-1])return h=r-2;if(e>=t[h]){if(h+1<r&&e<t[h+1])return h;if(h+2<r&&e<t[h+2])return++h}else if(h-1>=0&&e>=t[h-1])return--h;var i;for(i=0;i<r-2&&!(e>=t[i]&&e<t[i+1]);++i);return h=i}for(var a=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],s=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],d=0;d<s.length;++d)s[d]=(s[d]-c)/(u-c);var h=0,p=new e;return n.prototype.update=function(n){if(n.fog.enabled=this.enabled){var l=n.camera,d=l.positionCartographic;if(!t(d)||d.height>8e5||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]<i;)e._frameTimes.shift();var n=(r-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(r>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},r(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){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<n;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return r}),define("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nuniform sampler2D u_texture;\nuniform vec2 u_fxaaQualityRcpFrame;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\nu_texture,\nu_fxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(u_texture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n"}),define("ThirdParty/Shaders/FXAA3_11",[],function(){"use strict"
  491. ;return"#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n"}),define("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/FXAA","../ThirdParty/Shaders/FXAA3_11"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0;var t=new a({color:new r(0,0,0,0),depth:1,owner:this});this._clearCommand=t,this._qualityPreset=39}function b(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,i(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return y.prototype.update=function(r,n){var a=r.drawingBufferWidth,y=r.drawingBufferHeight,b=this._texture,C=!i(b)||b.width!==a||b.height!==y;if(C&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new p({context:r,width:a,height:y,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE,sampler:new h({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:f.LINEAR})}),r.depthTexture?this._depthStencilTexture=new p({context:r,width:a,height:y,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:r,width:a,height:y,format:c.DEPTH_STENCIL})),i(this._fbo)&&!C||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:r,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),!i(this._command)){var w="#define FXAA_QUALITY_PRESET "+this._qualityPreset+"\n"+_+"\n"+v;this._command=r.createViewportQuadCommand(w,{owner:this})}this._viewport.width=a,this._viewport.height=y;var S=!e.equals(this._viewport,n.viewport),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;a<o.length;++a){var s=o[a],l=new n;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),t(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}i.push(l)}return i}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===g)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===v)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===_)return c(e);if("ServiceExceptionReport"===t.localName)throw new i((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?d(e):f(e)}function l(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(g,"Feature"),o=0;o<i.length;++o){for(var a=i[o],s={},l=a.getElementsByTagNameNS(g,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var d=c.getAttribute("ref"),h=c.textContent.trim();s[d]=h}}var p=new n;p.data=a,p.properties=s,p.configureNameFromProperties(s),p.configureDescriptionFromProperties(s),t.push(p)}return t}function u(e){var t,r=e.documentElement,i=[],n=r.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}i.push(p(a,t))}else for(var c=r.getElementsByTagNameNS("*","FeatureInfo"),d=0;d<c.length;++d){var h=c[d];t={};for(var f=h.childNodes,m=0;m<f.length;++m){var g=f[m];g.nodeType===Node.ELEMENT_NODE&&(t[g.localName]=g.textContent)}i.push(p(h,t))}return i}function c(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(y,"featureMember"),n=0;n<i.length;++n){var o=i[n],a={};h(o,a),t.push(p(o,a))}return t}function d(e){for(var r,n=[],o=e.documentElement.childNodes,a=0;a<o.length;a++)if(o[a].nodeType===Node.ELEMENT_NODE){r=o[a];break}if(!t(r))throw new i("Unable to find first child of the feature info xml document");for(var s=r.childNodes,l=0;l<s.length;++l){var u=s[l];if(u.nodeType===Node.ELEMENT_NODE){var c={};h(u,c),n.push(p(u,c))}}return n}function h(e,t){for(var r=!0,i=0;i<e.childNodes.length;++i){var n=e.childNodes[i];n.nodeType===Node.ELEMENT_NODE&&(r=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&(n.hasChildNodes()&&h(n,t)&&(t[n.localName]=n.textContent))}return r}function p(e,t){var r=new n;return r.data=e,r.properties=t,r.configureNameFromProperties(t),r.configureDescriptionFromProperties(t),r}function f(e){var t=(new XMLSerializer).serializeToString(e),r=document.createElement("div"),i=document.createElement("pre");i.textContent=t,r.appendChild(i);var o=new n;return o.data=e,o.description=r.innerHTML,[o]}function m(e){if(!b.test(e)&&!C.test(e)){var t,r=w.exec(e);r&&r.length>1&&(t=r[1]);var i=new n;return i.name=t,i.description=e,i.data=e,[i]}}var g="http://www.mapinfo.com/mxp",v="http://www.esri.com/wms",_="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",b=/<body>\s*<\/body>/im,C=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,w=/<title>([\s\S]*)<\/title>/im;return o}),define("Shaders/GlobeFS",[],function(){"use strict"
  492. ;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){
  493. 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){
  494. 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)
  495. ;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),
  496. 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){
  497. 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,
  498. 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
  499. ;_.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),
  500. 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"
  501. ;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":
  502. 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
  503. ;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}
  504. 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)
  505. ;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}
  506. }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
  507. ;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),
  508. 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])
  509. }),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,
  510. 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
  511. ;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")
  512. ;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>&nbsp;&nbsp;&nbsp;&nbsp;"+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: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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}}
  513. 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="&times;",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,
  514. 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="&times;",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(){
  515. 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)})
  516. ;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}),
  517. 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,
  518. 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)}();