@visitscotland/component-library 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/client/manifest.json +1193 -1241
- package/dist/client/scripts/014696e80aae9192e359.js +1 -0
- package/dist/client/scripts/{768110f244f934f60565.js → 01ea361e28a56b3eefcd.js} +1 -1
- package/dist/client/scripts/02035cfde2b723d41fd2.js +1 -0
- package/dist/client/scripts/{d18b2a62bcce47355906.js → 03328a60362cb3651016.js} +1 -1
- package/dist/client/scripts/{8fca3cf4a6b47dd03ec2.js → 066d7b3e707ba3f07a31.js} +1 -1
- package/dist/client/scripts/{a3e65b8f7187d6fef46c.js → 09e119c9d66ee67f1eb8.js} +1 -1
- package/dist/client/scripts/0a96c285d8c41c9f354b.js +1 -0
- package/dist/client/scripts/{0fb04884047cd78dd040.js → 0e46b322bdc18ef31644.js} +1 -1
- package/dist/client/scripts/0ea050cf21103a863726.js +1 -0
- package/dist/client/scripts/0f504c087caa45ac5a91.js +1 -0
- package/dist/client/scripts/10892f1b937b50ba1d62.js +1 -0
- package/dist/client/scripts/{6ba1d8736d354a72a929.js → 108d85dc7a4a383fd057.js} +1 -1
- package/dist/client/scripts/{6ba1d8736d354a72a929.js.LICENSE.txt → 108d85dc7a4a383fd057.js.LICENSE.txt} +1 -1
- package/dist/client/scripts/{0767f178d388149bd392.js → 13014086fd8244546995.js} +1 -1
- package/dist/client/scripts/{15d19d418d289240628e.js → 1bb7e57b0ae059acb355.js} +1 -1
- package/dist/client/scripts/1c6fc241a7b9c4e10e81.js +1 -0
- package/dist/client/scripts/{894868e2b1aece1929b7.js → 1d2c28937df8b811947c.js} +1 -1
- package/dist/client/scripts/1ea58060bdd59b73f2cc.js +1 -0
- package/dist/client/scripts/{bcdf505d7af0a5b549f7.js → 20f54bb89165798ab7fa.js} +1 -1
- package/dist/client/scripts/{f7e21bd1ee3194fe4f9e.js → 27b848b5c58ce522eff9.js} +1 -1
- package/dist/client/scripts/{77565fda654b75c8d300.js → 285efd3dc49962c1ffb9.js} +1 -1
- package/dist/client/scripts/{06be5a40788608220924.js → 2dfbe8e2da6ca6808d5b.js} +1 -1
- package/dist/client/scripts/31a2579101bbbb9e5f30.js +1 -0
- package/dist/client/scripts/{f3c88f10ff0cecee4136.js → 31f9d972fa4753eaee60.js} +1 -1
- package/dist/client/scripts/35336d2943dd00299222.js +1 -0
- package/dist/client/scripts/{881b30f178e1a6dd0f5b.js → 35459f8c87dadd27e132.js} +1 -1
- package/dist/client/scripts/{0e20aaa05a36cd8048f2.js → 380522fadda741c9b3dc.js} +1 -1
- package/dist/client/scripts/3b406b51b28c32a41fa7.js +1 -0
- package/dist/client/scripts/{767ced5019a52e377db7.js → 3b782f9b1a48bb37ea1b.js} +1 -1
- package/dist/client/scripts/{946ddf507f7126cacd6f.js → 3f7b9965307d21e64c2d.js} +1 -1
- package/dist/client/scripts/4009c947df35b4d5c491.js +1 -0
- package/dist/client/scripts/{a5cac0ea963732ab4842.js → 42746f68f9fa10db59ad.js} +1 -1
- package/dist/client/scripts/{fc21280be0db72746eb1.js → 43310958bc4363082dd8.js} +1 -1
- package/dist/client/scripts/45f0025aa5e0e67e90af.js +1 -0
- package/dist/client/scripts/4859f9d07ba3901fa2d2.js +1 -0
- package/dist/client/scripts/4888c910526a478af55c.js +1 -0
- package/dist/client/scripts/{b1297de176912ca3e016.js → 48d53e3631b7bf81ef29.js} +1 -1
- package/dist/client/scripts/{f299c91e3375f635d678.js → 48e4dad7a650579d6b4e.js} +1 -1
- package/dist/client/scripts/{dc8ffc859bf0fa24a73a.js → 4f262ff6d88d67a5edb0.js} +1 -1
- package/dist/client/scripts/{39cea2687ae01dc1aa3f.js → 5101f1488ecbe8daf71c.js} +2 -2
- package/dist/client/scripts/{39cea2687ae01dc1aa3f.js.LICENSE.txt → 5101f1488ecbe8daf71c.js.LICENSE.txt} +3 -3
- package/dist/client/scripts/{5a695262345dd67bcf57.js → 57f474f5e19eb8baccea.js} +1 -1
- package/dist/client/scripts/5d2e8fcc89de9881e3f0.js +1 -0
- package/dist/client/scripts/5e005447771fd3cd6b2b.js +1 -0
- package/dist/client/scripts/62bdbadba4db64715c90.js +1 -0
- package/dist/client/scripts/{b6e3ad8ca787b28a3686.js → 62be177284dcb3826d3e.js} +1 -1
- package/dist/client/scripts/693c9fdb2abddc041fc8.js +1 -0
- package/dist/client/scripts/6c1ef7ce05ae842acdde.js +1 -0
- package/dist/client/scripts/{ec7a03c7626a87900e8f.js → 6cde0c4a56ffc9a6948a.js} +1 -1
- package/dist/client/scripts/6ce50cc9d208b577f33b.js +1 -0
- package/dist/client/scripts/{e8027df65498e3962468.js → 71533bdc41e1b0d7cf00.js} +1 -1
- package/dist/client/scripts/72914614ed8843afe8e7.js +1 -0
- package/dist/client/scripts/{7bdcf2afcd8cdec0a5d5.js → 72d1baeb2e66131db0da.js} +1 -1
- package/dist/client/scripts/{8b56fe1517ab4d98ad60.js → 743d1b4c9f1c3f1b0fec.js} +1 -1
- package/dist/client/scripts/{89f69635eb151c0743fd.js → 7454ae168051d0e27e19.js} +1 -1
- package/dist/client/scripts/{29a2484751dbe1c5dd1b.js → 756ad53dc252a74decdb.js} +2 -2
- package/dist/client/scripts/{29a2484751dbe1c5dd1b.js.LICENSE.txt → 756ad53dc252a74decdb.js.LICENSE.txt} +2 -2
- package/dist/client/scripts/790f51d005d7150b9f08.js +1 -0
- package/dist/client/scripts/7bec5bb5f97f2464b576.js +1 -0
- package/dist/client/scripts/{a4a4ccf4ff06adbfc89d.js → 7d1b6fb07a662ab1b389.js} +1 -1
- package/dist/client/scripts/7f0830b7d5e434d7a977.js +1 -0
- package/dist/client/scripts/{07c664894dd40b1ec2c4.js → 808a63db7e326de214a9.js} +1 -1
- package/dist/client/scripts/815727531bfef1c70c8f.js +1 -0
- package/dist/client/scripts/{e31b9fc0f6cf4e2bf822.js → 8278060cf6716a57e62c.js} +1 -1
- package/dist/client/scripts/{55fd4c070115ba389108.js → 829fb548fb318cc6c227.js} +1 -1
- package/dist/client/scripts/835ff83b6597e828c6fb.js +1 -0
- package/dist/client/scripts/{0742b07f5cbe3bd13a0e.js → 83e6099b792b76d2ee7f.js} +1 -1
- package/dist/client/scripts/{972d95b6bbc4747a583d.js → 87481837088a84e90ef5.js} +1 -1
- package/dist/client/scripts/8751d1ac21308fc7e78b.js +1 -0
- package/dist/client/scripts/{d6e2bcb97349bafc6845.js → 87c81786aba52ad2c8de.js} +1 -1
- package/dist/client/scripts/{169621f626f3b9a146f0.js → 8a8fc3d15b5f1307b1f3.js} +1 -1
- package/dist/client/scripts/{c0149c75a57e805eba11.js → 8b7ae0ee4655791853d1.js} +1 -1
- package/dist/client/scripts/{76eb53ffa89359303ca5.js → 8d66c9c61aafbfb8863a.js} +1 -1
- package/dist/client/scripts/8f688a3a5f483ff3f90f.js +1 -0
- package/dist/client/scripts/8fc24289899913dd4b9c.js +1 -0
- package/dist/client/scripts/{6e83c6f7c0a90b34622d.js → 90d734ebff6ad86a760a.js} +1 -1
- package/dist/client/scripts/{08084fd865f1ec5277ab.js → 91b2d5bc3c73cd4f18d5.js} +1 -1
- package/dist/client/scripts/{044bfb9482afdccb2697.js → 9423bad82a9386c620dd.js} +1 -1
- package/dist/client/scripts/{b81386e81ff33d989871.js → 951369ed2dd2c6687978.js} +1 -1
- package/dist/client/scripts/95b719eee541df398cb7.js +2 -0
- package/dist/client/scripts/{65d2c51e2beb03874a14.js.LICENSE.txt → 95b719eee541df398cb7.js.LICENSE.txt} +2 -0
- package/dist/client/scripts/{02f9c39b72d346193242.js → 981e11371f3edd17cf06.js} +1 -1
- package/dist/client/scripts/9999938ef7d992beb718.js +1 -0
- package/dist/client/scripts/{9f6f0e367cc189e40326.js → 9a0913e2bb7e116e722a.js} +1 -1
- package/dist/client/scripts/{a21d0b85ce3c288a603a.js → 9c28a3896802882e7e36.js} +1 -1
- package/dist/client/scripts/9cfa0f253a3aebd930a2.js +1 -0
- package/dist/client/scripts/{0f345f8314db04d9d435.js → 9e7c278f3a7892d627bc.js} +1 -1
- package/dist/client/scripts/{ebf40b1e9787e4c1bc89.js → 9faa3989454af4ae1646.js} +1 -1
- package/dist/client/scripts/{ba4de7594bba69128088.js → 9fc3879dcd92ead8420a.js} +1 -1
- package/dist/client/scripts/{2345cfa214f3fd86e5a7.js → a44a0614320595c1e401.js} +1 -1
- package/dist/client/scripts/{594d4a275d4ecc149321.js → a5720cb035b84b05a681.js} +1 -1
- package/dist/client/scripts/a6db4893a81bbd0fa783.js +1 -0
- package/dist/client/scripts/{dc0b35c5cbada76c8f91.js → a7873e3d286e50fba6c9.js} +1 -1
- package/dist/client/scripts/a78ff92ceead2d31f3a9.js +1 -0
- package/dist/client/scripts/a852c8dcfb617afa93f1.js +1 -0
- package/dist/client/scripts/a92bcf3f9625c73de815.js +1 -0
- package/dist/client/scripts/{58dc3d271d377f63d669.js → aea24adeebd8a85f0d9f.js} +1 -1
- package/dist/client/scripts/{768cf090f25d407328a7.js → afae1410930b1f62a50a.js} +1 -1
- package/dist/client/scripts/b0e6c2314243d68e28b0.js +1 -0
- package/dist/client/scripts/b4a23e7a73eae4480216.js +1 -0
- package/dist/client/scripts/{71fa1ec8ea0c9f1362ea.js → b4bb9618e977e9850320.js} +1 -1
- package/dist/client/scripts/{73ed30880b13b6906513.js → b5f382bd1ef86330d29d.js} +1 -1
- package/dist/client/scripts/b5fad640f69afe308f11.js +1 -0
- package/dist/client/scripts/{2e6f4d08f2c68a9da0a6.js → b6a50a2b854d09970111.js} +1 -1
- package/dist/client/scripts/{59722ca7df6b49712bfa.js → b780d82de69f5dc4cc7a.js} +1 -1
- package/dist/client/scripts/b9d33994c69b2a8de5fe.js +1 -0
- package/dist/client/scripts/{d0c0934289c2e798b85d.js → ba790fc15aa9dd2a524f.js} +1 -1
- package/dist/client/scripts/bdb8608eddf7bc7915c8.js +1 -0
- package/dist/client/scripts/{47fa21781c0aa040e130.js → bf90fba0f91fafe15a5e.js} +1 -1
- package/dist/client/scripts/{b1b153480a5b85445472.js → bfa150726b9638580f7f.js} +1 -1
- package/dist/client/scripts/c01ba1121e07f8275c28.js +1 -0
- package/dist/client/scripts/{2806750528d85460028f.js → c05223da24c7e1792d39.js} +1 -1
- package/dist/client/scripts/c2a488a59af6b939a61e.js +1 -0
- package/dist/client/scripts/{dcbb81204c96a54514b3.js → c31b6bc76dcbb113e1c3.js} +1 -1
- package/dist/client/scripts/{6f404e26a825f73c1d7d.js → c3dcd9d23d027dd49374.js} +1 -1
- package/dist/client/scripts/{d5aa3e50a36f5ee91c13.js → c5f754ac600e401a00d3.js} +1 -1
- package/dist/client/scripts/{6cc4b48d94ba68abe2c8.js → c7b72bcfc9e8773232d1.js} +1 -1
- package/dist/client/scripts/{90c6f26e959510c73a4f.js → ccd9487062dbcc1ebfc5.js} +1 -1
- package/dist/client/scripts/{ceb147d872c2cc6d8e43.js → cd7968f5815183867103.js} +1 -1
- package/dist/client/scripts/cdab1ed393767e094329.js +1 -0
- package/dist/client/scripts/{a5841e51763678db6089.js → ce05b548e362b5886d8d.js} +1 -1
- package/dist/client/scripts/{c3ccea24a5c73faaf99e.js → d26a3d80e6c77f61e906.js} +1 -1
- package/dist/client/scripts/{2313512dca4cba19c5cf.js → d2c54ba404a1cf66db40.js} +1 -1
- package/dist/client/scripts/{479f361ffb749af3a689.js → d4eeb46194941881aa05.js} +1 -1
- package/dist/client/scripts/{1166a7c8cccc5e33a8fa.js → d835aaf47a47f0edb3e6.js} +1 -1
- package/dist/client/scripts/{e5b18709069828a4363d.js → d8e6b1ff37198ab047be.js} +1 -1
- package/dist/client/scripts/{1a6fd9c46a800c7022a2.js → d903f620379252e22fa0.js} +1 -1
- package/dist/client/scripts/d942e5ec658c176d6750.js +1 -0
- package/dist/client/scripts/d9a1dbb415d11641ff9f.js +1 -0
- package/dist/client/scripts/{b71233fab69a4991c295.js → de4f0e5200e9af12acbd.js} +1 -1
- package/dist/client/scripts/{7239ca3af4d08b5e2c26.js → e19939887bfd61bfa771.js} +1 -1
- package/dist/client/scripts/e58799bb10a7008421cf.js +1 -0
- package/dist/client/scripts/{ad29eaecaf598090855e.js → e77e41fd26bfb87d7e49.js} +1 -1
- package/dist/client/scripts/{7061fd6c9ef6c41788c5.js → e7a8d37da2ffba5d13f1.js} +1 -1
- package/dist/client/scripts/{101d5fcbe71d6029396c.js → e9354c5fa1fa19dd1c4c.js} +1 -1
- package/dist/client/scripts/{d8471fe1072bae39c0d4.js → e9e4c7e535bc1ca52762.js} +1 -1
- package/dist/client/scripts/{6415433fa4aa0ec17e21.js → ea3032cf5cb7ce6ce3ca.js} +1 -1
- package/dist/client/scripts/ebfecb5cb9655ada3826.js +1 -0
- package/dist/client/scripts/{7017f9066e3a3499e110.js → ec628a75cf6053fcd008.js} +1 -1
- package/dist/client/scripts/{5da4558386ae97434fb7.js → ec98e9fccfc20586c905.js} +1 -1
- package/dist/client/scripts/f03174e16f719c89d9d5.js +1 -0
- package/dist/client/scripts/{229f593f0dcaff056aca.js → f03f3b5330d83aee3dc5.js} +1 -1
- package/dist/client/scripts/f304d9429842a3472c24.js +1 -0
- package/dist/client/scripts/{409fd959bc8c3f49497c.js → f345e980b578a38dcc9a.js} +1 -1
- package/dist/client/scripts/f4709b00f96deef67c51.js +1 -0
- package/dist/client/scripts/f5685cc9549af21468a2.js +1 -0
- package/dist/client/scripts/{9118978a47a3fcaaeeb3.js → f6a0b11764b771115ce2.js} +1 -1
- package/dist/client/scripts/{99adfd75fdf24fa48da0.js → fa9e094c4c8faa227f78.js} +1 -1
- package/dist/client/scripts/{e1ec993bb5b202cb69d5.js → fc5b93e6951cd07be80d.js} +1 -1
- package/dist/client/scripts/{581c0d593f05f48c8b33.js → fe7fd3da91146a0ad576.js} +1 -1
- package/dist/client/scripts/{41968f6b286ccfb1b6f2.js → fe88eb43d773b18a9f11.js} +1 -1
- package/dist/client/scripts/{8fea7091b1b3af2f8c5f.js → ff019a30624b95c825db.js} +1 -1
- package/dist/client/styles/d9a1dbb415d11641ff9f.css +1 -0
- package/dist/client/styles/ebfecb5cb9655ada3826.css +1 -0
- package/dist/client/styles/{229f593f0dcaff056aca.css → f03f3b5330d83aee3dc5.css} +1 -1
- package/dist/components/brandscotland-logo-BbDMkgti.js +1 -0
- package/dist/components/brandscotland-logo-CFk2vaAQ.mjs +4 -0
- package/dist/components/component-entry.d.ts +2 -0
- package/dist/components/components/accordion/Accordion.vue.d.ts +24 -0
- package/dist/components/components/accordion/components/AccordionItem.vue.d.ts +94 -0
- package/dist/components/components/accordion/components/AccordionToggle.vue.d.ts +39 -0
- package/dist/components/components/accordion/index.d.ts +103 -0
- package/dist/components/components/address/Address.vue.d.ts +2 -0
- package/dist/components/components/address/index.d.ts +5 -0
- package/dist/components/components/alert/Alert.vue.d.ts +2 -0
- package/dist/components/components/alert/index.d.ts +5 -0
- package/dist/components/components/article/Article.vue.d.ts +34 -0
- package/dist/components/components/article/components/ArticleSection.vue.d.ts +24 -0
- package/dist/components/components/article/components/ArticleSidebar.vue.d.ts +24 -0
- package/dist/components/components/article/index.d.ts +9 -0
- package/dist/components/components/banner/Banner.vue.d.ts +55 -0
- package/dist/components/components/banner/index.d.ts +3 -0
- package/dist/components/components/blog-details/BlogDetails.vue.d.ts +46 -0
- package/dist/components/components/blog-details/index.d.ts +3 -0
- package/dist/components/components/breadcrumb/Breadcrumb.vue.d.ts +2 -0
- package/dist/components/components/breadcrumb/components/BreadcrumbItem.vue.d.ts +67 -0
- package/dist/components/components/breadcrumb/index.d.ts +4 -0
- package/dist/components/components/button/Button.vue.d.ts +228 -0
- package/dist/components/components/button/index.d.ts +2 -0
- package/dist/components/components/button-toggle-group/ButtonToggleGroup.vue.d.ts +68 -0
- package/dist/components/components/button-toggle-group/index.d.ts +2 -0
- package/dist/components/components/canned-search/CannedSearch.vue.d.ts +135 -0
- package/dist/components/components/canned-search/components/CannedSearchBadges.vue.d.ts +76 -0
- package/dist/components/components/canned-search/components/CannedSearchCategories.vue.d.ts +28 -0
- package/dist/components/components/canned-search/components/CannedSearchCuisines.vue.d.ts +22 -0
- package/dist/components/components/canned-search/components/CannedSearchDates.vue.d.ts +41 -0
- package/dist/components/components/canned-search/components/CannedSearchDuration.vue.d.ts +35 -0
- package/dist/components/components/canned-search/components/CannedSearchLogos.vue.d.ts +73 -0
- package/dist/components/components/canned-search/components/CannedSearchPrice.vue.d.ts +50 -0
- package/dist/components/components/canned-search/components/CannedSearchProductCard.vue.d.ts +141 -0
- package/dist/components/components/canned-search/components/CannedSearchStars.vue.d.ts +39 -0
- package/dist/components/components/canned-search/components/CannedSearchSubHeading.vue.d.ts +43 -0
- package/dist/components/components/canned-search/components/CannedSearchSummaryBox.vue.d.ts +67 -0
- package/dist/components/components/canned-search/components/CannedSearchTourDeparts.vue.d.ts +43 -0
- package/dist/components/components/canned-search/components/CannedSearchTourRuns.vue.d.ts +59 -0
- package/dist/components/components/canned-search/index.d.ts +27 -0
- package/dist/components/components/caption/Caption.vue.d.ts +82 -0
- package/dist/components/components/caption/components/CaptionImageMap.vue.d.ts +67 -0
- package/dist/components/components/caption/index.d.ts +7 -0
- package/dist/components/components/carbon-calculator/CarbonCalculator.vue.d.ts +239 -0
- package/dist/components/components/carbon-calculator/components/CarbonCalculatorIntro.vue.d.ts +2 -0
- package/dist/components/components/carbon-calculator/components/CarbonCalculatorQuestion.vue.d.ts +151 -0
- package/dist/components/components/carbon-calculator/components/CarbonCalculatorResults.vue.d.ts +204 -0
- package/dist/components/components/carbon-calculator/components/CarbonCalculatorRunningTotal.vue.d.ts +45 -0
- package/dist/components/components/carbon-calculator/components/CarbonCalculatorTip.vue.d.ts +23 -0
- package/dist/components/components/carbon-calculator/index.d.ts +5 -0
- package/dist/components/components/carousel/Carousel.vue.d.ts +134 -0
- package/dist/components/components/carousel/components/CarouselSlide.vue.d.ts +176 -0
- package/dist/components/components/carousel/index.d.ts +7 -0
- package/dist/components/components/checkbox/Checkbox.vue.d.ts +218 -0
- package/dist/components/components/checkbox/index.d.ts +2 -0
- package/dist/components/components/cookie-checker/CookieChecker.vue.d.ts +17 -0
- package/dist/components/components/cookie-checker/index.d.ts +2 -0
- package/dist/components/components/description-list/DescriptionList.vue.d.ts +20 -0
- package/dist/components/components/description-list/components/DescriptionListItem.vue.d.ts +20 -0
- package/dist/components/components/description-list/index.d.ts +4 -0
- package/dist/components/components/dropdown/Dropdown.vue.d.ts +16 -0
- package/dist/components/components/dropdown/components/DropdownItem.vue.d.ts +2 -0
- package/dist/components/components/dropdown/index.d.ts +4 -0
- package/dist/components/components/embed-wrapper/EmbedWrapper.vue.d.ts +78 -0
- package/dist/components/components/embed-wrapper/index.d.ts +5 -0
- package/dist/components/components/footer/Footer.vue.d.ts +2 -0
- package/dist/components/components/footer/components/FooterAccordionItem.vue.d.ts +84 -0
- package/dist/components/components/footer/components/FooterCopyright.vue.d.ts +36 -0
- package/dist/components/components/footer/components/FooterNavList.vue.d.ts +24 -0
- package/dist/components/components/footer/components/FooterNavListItem.vue.d.ts +54 -0
- package/dist/components/components/footer/components/FooterSocialItem.vue.d.ts +53 -0
- package/dist/components/components/footer/components/FooterSocialMenu.vue.d.ts +2 -0
- package/dist/components/components/footer/components/FooterUtilityList.vue.d.ts +2 -0
- package/dist/components/components/footer/index.d.ts +19 -0
- package/dist/components/components/form/Form.vue.d.ts +339 -0
- package/dist/components/components/form/index.d.ts +5 -0
- package/dist/components/components/global-menu/GlobalMenu.vue.d.ts +39 -0
- package/dist/components/components/global-menu/components/GlobalMenuDropdown.vue.d.ts +48 -0
- package/dist/components/components/global-menu/components/GlobalMenuLanguage.vue.d.ts +49 -0
- package/dist/components/components/global-menu/components/GlobalMenuLanguageItem.vue.d.ts +66 -0
- package/dist/components/components/global-menu/components/GlobalMenuList.vue.d.ts +32 -0
- package/dist/components/components/global-menu/index.d.ts +13 -0
- package/dist/components/components/grid/Col.vue.d.ts +2 -0
- package/dist/components/components/grid/Container.vue.d.ts +2 -0
- package/dist/components/components/grid/Row.vue.d.ts +2 -0
- package/dist/components/components/grid/index.d.ts +5 -0
- package/dist/components/components/heading/Heading.vue.d.ts +78 -0
- package/dist/components/components/heading/index.d.ts +2 -0
- package/dist/components/components/html-error/HtmlError.vue.d.ts +35 -0
- package/dist/components/components/html-error/index.d.ts +5 -0
- package/dist/components/components/icentre/Icentre.vue.d.ts +2 -0
- package/dist/components/components/icentre/index.d.ts +5 -0
- package/dist/components/components/icon/Icon.vue.d.ts +142 -0
- package/dist/components/components/icon/index.d.ts +88 -0
- package/dist/components/components/icon-list/IconList.vue.d.ts +20 -0
- package/dist/components/components/icon-list/components/IconListItem.vue.d.ts +32 -0
- package/dist/components/components/icon-list/index.d.ts +7 -0
- package/dist/components/components/image-with-caption/ImageWithCaption.vue.d.ts +276 -0
- package/dist/components/components/image-with-caption/index.d.ts +5 -0
- package/dist/components/components/img/Img.vue.d.ts +121 -0
- package/dist/components/components/img/index.d.ts +2 -0
- package/dist/components/components/index.d.ts +115 -0
- package/dist/components/components/input/Input.vue.d.ts +310 -0
- package/dist/components/components/input/index.d.ts +2 -0
- package/dist/components/components/itineraries/Itinerary.vue.d.ts +43 -0
- package/dist/components/components/itineraries/components/ItineraryDay.vue.d.ts +66 -0
- package/dist/components/components/itineraries/components/ItineraryStop.vue.d.ts +46 -0
- package/dist/components/components/itineraries/components/ItineraryStopInfo.vue.d.ts +175 -0
- package/dist/components/components/itineraries/components/ItineraryTips.vue.d.ts +8 -0
- package/dist/components/components/itineraries/index.d.ts +8 -0
- package/dist/components/components/itineraries/itineraries.store.d.ts +31 -0
- package/dist/components/components/link/Link.vue.d.ts +133 -0
- package/dist/components/components/link/index.d.ts +5 -0
- package/dist/components/components/link-list/LinkList.vue.d.ts +2 -0
- package/dist/components/components/link-list/components/LinkListItem.vue.d.ts +77 -0
- package/dist/components/components/link-list/index.d.ts +7 -0
- package/dist/components/components/list/List.vue.d.ts +50 -0
- package/dist/components/components/list/index.d.ts +2 -0
- package/dist/components/components/listicle/ListicleItem.vue.d.ts +52 -0
- package/dist/components/components/listicle/index.d.ts +5 -0
- package/dist/components/components/loading-spinner/LoadingSpinner.vue.d.ts +18 -0
- package/dist/components/components/loading-spinner/index.d.ts +5 -0
- package/dist/components/components/map/Map.vue.d.ts +370 -0
- package/dist/components/components/map/components/MapMarker.vue.d.ts +87 -0
- package/dist/components/components/map/index.d.ts +7 -0
- package/dist/components/components/map-index.d.ts +4 -0
- package/dist/components/components/map-marker-icon/MapMarkerIcon.vue.d.ts +50 -0
- package/dist/components/components/map-marker-icon/index.d.ts +5 -0
- package/dist/components/components/map-with-sidebar/MapWithSidebar.vue.d.ts +366 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarButtons.vue.d.ts +39 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarCategory.vue.d.ts +57 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarControls.vue.d.ts +16 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarDetail.vue.d.ts +36 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarListItem.vue.d.ts +65 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarPanel.vue.d.ts +274 -0
- package/dist/components/components/map-with-sidebar/components/MapWithSidebarSubcategory.vue.d.ts +35 -0
- package/dist/components/components/map-with-sidebar/index.d.ts +19 -0
- package/dist/components/components/mega-nav/MegaNav.vue.d.ts +169 -0
- package/dist/components/components/mega-nav/components/MegaNavAccordionItem.vue.d.ts +84 -0
- package/dist/components/components/mega-nav/components/MegaNavDropdown.vue.d.ts +44 -0
- package/dist/components/components/mega-nav/components/MegaNavDropdownContainer.vue.d.ts +57 -0
- package/dist/components/components/mega-nav/components/MegaNavFeaturedEvent.vue.d.ts +29 -0
- package/dist/components/components/mega-nav/components/MegaNavFeaturedItem.vue.d.ts +48 -0
- package/dist/components/components/mega-nav/components/MegaNavList.vue.d.ts +22 -0
- package/dist/components/components/mega-nav/components/MegaNavListItem.vue.d.ts +58 -0
- package/dist/components/components/mega-nav/components/MegaNavMobileMenu.vue.d.ts +24 -0
- package/dist/components/components/mega-nav/components/MegaNavStaticLink.vue.d.ts +54 -0
- package/dist/components/components/mega-nav/components/MegaNavTopMenu.vue.d.ts +2 -0
- package/dist/components/components/megalinks/Megalinks.vue.d.ts +128 -0
- package/dist/components/components/megalinks/components/megalink-link-list/MegalinkLinkList.vue.d.ts +194 -0
- package/dist/components/components/megalinks/components/megalink-link-list/index.d.ts +5 -0
- package/dist/components/components/megalinks/components/megalink-multi-image/MegalinkMultiImage.vue.d.ts +233 -0
- package/dist/components/components/megalinks/components/megalink-multi-image/index.d.ts +5 -0
- package/dist/components/components/megalinks/components/megalink-single-image/MegalinkSingleImage.vue.d.ts +59 -0
- package/dist/components/components/megalinks/components/megalink-single-image/index.d.ts +5 -0
- package/dist/components/components/megalinks/index.d.ts +5 -0
- package/dist/components/components/modal/Modal.vue.d.ts +82 -0
- package/dist/components/components/modal/index.d.ts +2 -0
- package/dist/components/components/module-wrapper/ModuleWrapper.vue.d.ts +22 -0
- package/dist/components/components/module-wrapper/index.d.ts +5 -0
- package/dist/components/components/number-input/NumberInput.vue.d.ts +294 -0
- package/dist/components/components/number-input/index.d.ts +2 -0
- package/dist/components/components/page-intro/PageIntro.vue.d.ts +60 -0
- package/dist/components/components/page-intro/index.d.ts +2 -0
- package/dist/components/components/panel/Panel.vue.d.ts +2 -0
- package/dist/components/components/panel/index.d.ts +2 -0
- package/dist/components/components/product-search/ProductSearch.vue.d.ts +64 -0
- package/dist/components/components/product-search/components/Autocomplete.vue.d.ts +37 -0
- package/dist/components/components/product-search/components/DateInput.vue.d.ts +27 -0
- package/dist/components/components/product-search/components/DateRange.vue.d.ts +48 -0
- package/dist/components/components/product-search/components/GuestSelector.vue.d.ts +15 -0
- package/dist/components/components/product-search/components/GuestSelectorNumberGroup.vue.d.ts +45 -0
- package/dist/components/components/product-search/components/GuestSelectorRow.vue.d.ts +31 -0
- package/dist/components/components/product-search/components/ProductSearchEmbed.vue.d.ts +55 -0
- package/dist/components/components/product-search/index.d.ts +2 -0
- package/dist/components/components/progress-bar/ProgressBar.vue.d.ts +96 -0
- package/dist/components/components/progress-bar/index.d.ts +5 -0
- package/dist/components/components/quote/Quote.vue.d.ts +21 -0
- package/dist/components/components/quote/index.d.ts +23 -0
- package/dist/components/components/radio-button/RadioButton.vue.d.ts +233 -0
- package/dist/components/components/recaptcha/Recaptcha.vue.d.ts +111 -0
- package/dist/components/components/recaptcha/index.d.ts +5 -0
- package/dist/components/components/rich-text-wrapper/RichTextWrapper.vue.d.ts +24 -0
- package/dist/components/components/rich-text-wrapper/index.d.ts +5 -0
- package/dist/components/components/select/Select.vue.d.ts +213 -0
- package/dist/components/components/select/index.d.ts +2 -0
- package/dist/components/components/site-search/SiteSearch.vue.d.ts +27 -0
- package/dist/components/components/site-search/components/SiteSearchForm.vue.d.ts +100 -0
- package/dist/components/components/site-search/index.d.ts +7 -0
- package/dist/components/components/ski-scotland/ski-scotland-card/SkiScotlandCard.vue.d.ts +336 -0
- package/dist/components/components/ski-scotland/ski-scotland-card/index.d.ts +5 -0
- package/dist/components/components/ski-scotland/ski-scotland-status/SkiScotlandStatus.vue.d.ts +689 -0
- package/dist/components/components/ski-scotland/ski-scotland-status/index.d.ts +5 -0
- package/dist/components/components/skip-to/SkipTo.vue.d.ts +28 -0
- package/dist/components/components/skip-to/index.d.ts +5 -0
- package/dist/components/components/social-credit-link/SocialCreditLink.vue.d.ts +50 -0
- package/dist/components/components/social-credit-link/index.d.ts +5 -0
- package/dist/components/components/social-share/SocialShare.vue.d.ts +141 -0
- package/dist/components/components/social-share/components/SocialShareItem.vue.d.ts +76 -0
- package/dist/components/components/social-share/index.d.ts +7 -0
- package/dist/components/components/stretched-link-card/StretchedLinkCard.vue.d.ts +219 -0
- package/dist/components/components/stretched-link-card/components/StretchedLinkPanels.vue.d.ts +67 -0
- package/dist/components/components/stretched-link-card/index.d.ts +7 -0
- package/dist/components/components/summary-box/SummaryBoxList.vue.d.ts +2 -0
- package/dist/components/components/summary-box/components/SummaryBoxDistanceListItem.vue.d.ts +99 -0
- package/dist/components/components/summary-box/components/SummaryBoxListItem.vue.d.ts +67 -0
- package/dist/components/components/summary-box/index.d.ts +5 -0
- package/dist/components/components/svg/Svg.vue.d.ts +75 -0
- package/dist/components/components/svg/index.d.ts +5 -0
- package/dist/components/components/svg-link/SvgLink.vue.d.ts +126 -0
- package/dist/components/components/svg-link/index.d.ts +5 -0
- package/dist/components/components/table/Table.vue.d.ts +41 -0
- package/dist/components/components/table/components/TableBody.vue.d.ts +2 -0
- package/dist/components/components/table/components/TableDataCell.vue.d.ts +20 -0
- package/dist/components/components/table/components/TableFooter.vue.d.ts +2 -0
- package/dist/components/components/table/components/TableHead.vue.d.ts +2 -0
- package/dist/components/components/table/components/TableHeaderCell.vue.d.ts +20 -0
- package/dist/components/components/table/components/TableRow.vue.d.ts +2 -0
- package/dist/components/components/table/index.d.ts +9 -0
- package/dist/components/components/tabs/Tabs.vue.d.ts +2 -0
- package/dist/components/components/tabs/components/TabItem.vue.d.ts +18 -0
- package/dist/components/components/tabs/index.d.ts +9 -0
- package/dist/components/components/tag/Tag.vue.d.ts +18 -0
- package/dist/components/components/tag/index.d.ts +5 -0
- package/dist/components/components/tag-manager-wrapper/TagManagerWrapper.vue.d.ts +48 -0
- package/dist/components/components/tag-manager-wrapper/index.d.ts +2 -0
- package/dist/components/components/toggle-button/ToggleButton.vue.d.ts +24 -0
- package/dist/components/components/toggle-button/index.d.ts +5 -0
- package/dist/components/components/tooltip/Tooltip.vue.d.ts +39 -0
- package/dist/components/components/tooltip/index.d.ts +2 -0
- package/dist/components/components/video/Video.vue.d.ts +264 -0
- package/dist/components/components/video-caption/VideoCaption.vue.d.ts +96 -0
- package/dist/components/components/video-caption/index.d.ts +5 -0
- package/dist/components/components/warning/Warning.vue.d.ts +60 -0
- package/dist/components/components/warning/index.d.ts +5 -0
- package/dist/components/constants.d.ts +14 -0
- package/dist/components/cookie-coo-Bc1O8aR_.js +1 -0
- package/dist/components/cookie-coo-BpVlZYES.mjs +4 -0
- package/dist/components/deprecated-BJ2e68Yo.js +13 -0
- package/dist/components/deprecated-SV4OJNeR.mjs +16 -0
- package/dist/components/directives/click-outside.d.ts +5 -0
- package/dist/components/directives/hand-down-focus.d.ts +7 -0
- package/dist/components/fonts.css +1 -0
- package/dist/components/highland-cow-6AoCzBpF.mjs +18 -0
- package/dist/components/highland-cow-DlMGnebG.js +15 -0
- package/dist/components/iCentre-BLimkPxI.mjs +46 -0
- package/dist/components/iCentre-BnLcpIw8.js +43 -0
- package/dist/components/icons.css +9 -0
- package/dist/components/instagram-filled-CGGEG-Rb.mjs +4 -0
- package/dist/components/instagram-filled-CvF3WA5q.js +1 -0
- package/dist/components/maps.css +1 -0
- package/dist/components/maps.js +508 -0
- package/dist/components/maps.mjs +20815 -0
- package/dist/components/mixins/__mocks__/verifyCookiesMixin.d.ts +13 -0
- package/dist/components/mixins/ariaDescriptionMixin.d.ts +6 -0
- package/dist/components/mixins/cookieMixin.d.ts +12 -0
- package/dist/components/mixins/dataLayerMixin.d.ts +19 -0
- package/dist/components/mixins/mapIconMapping.d.ts +8 -0
- package/dist/components/mixins/srcSetMixin.d.ts +9 -0
- package/dist/components/mixins/validateFormElementMixin.d.ts +37 -0
- package/dist/components/mixins/verifyCookiesMixin.d.ts +13 -0
- package/dist/components/no-js-coo-BEt1aICD.js +1 -0
- package/dist/components/no-js-coo-BgxQI1Or.mjs +4 -0
- package/dist/components/os-logo-maps-DUN8X-lQ.mjs +13 -0
- package/dist/components/os-logo-maps-QXAuept_.js +10 -0
- package/dist/components/os-logo-maps-white-BTtf_Eki.js +7 -0
- package/dist/components/os-logo-maps-white-SKYtuD6d.mjs +10 -0
- package/dist/components/prototype-DQocvgQh.js +13 -0
- package/dist/components/prototype-lvwJzV8T.mjs +16 -0
- package/dist/components/ready-CWPx4e9A.mjs +15 -0
- package/dist/components/ready-D9pdKFkx.js +12 -0
- package/dist/components/review-7L3On10m.js +12 -0
- package/dist/components/review-CknihZl_.mjs +15 -0
- package/dist/components/stores/cookies.store.d.ts +19 -0
- package/dist/components/stores/dataLayer.store.d.ts +32 -0
- package/dist/components/stores/index.d.ts +4 -0
- package/dist/components/stores/map.store.d.ts +49 -0
- package/dist/components/stores/video.store.d.ts +21 -0
- package/dist/components/types/types.d.ts +33 -0
- package/dist/components/utils/axios.d.ts +1 -0
- package/dist/components/utils/breakpoints.d.ts +2 -0
- package/dist/components/utils/check-vendor-library.d.ts +2 -0
- package/dist/components/utils/data-layer-templates.d.ts +17 -0
- package/dist/components/utils/event-bus.d.ts +15 -0
- package/dist/components/utils/get-env-value.d.ts +2 -0
- package/dist/components/utils/get-token.d.ts +2 -0
- package/dist/components/utils/hash-code.d.ts +2 -0
- package/dist/components/utils/js-is-disabled.d.ts +2 -0
- package/dist/components/utils/lang.d.ts +8 -0
- package/dist/components/utils/one-trust.d.ts +11 -0
- package/dist/components/utils/os-branding.d.ts +14 -0
- package/dist/components/utils/required-cookies-data.d.ts +8 -0
- package/dist/components/utils/svg-context.d.ts +2 -0
- package/dist/components/utils/utils.d.ts +11 -0
- package/dist/components/v4-Dx4zqkIC.mjs +7197 -0
- package/dist/components/v4-tWlzORDj.js +36 -0
- package/dist/components/v4.css +1 -0
- package/dist/components/visitscotland-logo-BEiiuSpo.mjs +7 -0
- package/dist/components/visitscotland-logo-NoymCLtN.js +4 -0
- package/dist/components/vs-component-library.css +1 -0
- package/dist/components/vs-component-library.js +334 -0
- package/dist/components/vs-component-library.mjs +33377 -0
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/dist/ssr/styles/{7de538737e9da242b06b.css → 2eb2ef074b456be4560b.css} +7 -6
- package/package.json +1 -1
- package/dist/client/scripts/22667a258087a1250b73.js +0 -1
- package/dist/client/scripts/23348ae8c72907e38980.js +0 -1
- package/dist/client/scripts/2a6eb9437415815a7c8b.js +0 -1
- package/dist/client/scripts/2d1919731dec95c3ab78.js +0 -1
- package/dist/client/scripts/2e55f379e6484c0f2739.js +0 -1
- package/dist/client/scripts/377d2b3d73725d46c3b9.js +0 -1
- package/dist/client/scripts/386f7ca55b7614ccfff6.js +0 -1
- package/dist/client/scripts/478bda1ed98f48e890ad.js +0 -1
- package/dist/client/scripts/49598e01d3e5612354ed.js +0 -1
- package/dist/client/scripts/4c79c3b75fe74372b440.js +0 -1
- package/dist/client/scripts/4d939c5862fea5e64e5c.js +0 -1
- package/dist/client/scripts/4ef6e4944d6fdb2418e8.js +0 -1
- package/dist/client/scripts/5017a70de73841a396da.js +0 -1
- package/dist/client/scripts/53a30f855892e62d2940.js +0 -1
- package/dist/client/scripts/5569bb64f8f5205efa41.js +0 -1
- package/dist/client/scripts/57a4d1a4d7414143c481.js +0 -1
- package/dist/client/scripts/58a7210037a7cf7843b0.js +0 -1
- package/dist/client/scripts/5a78fd7739edf164bffc.js +0 -1
- package/dist/client/scripts/5ca7c046bdea4196601e.js +0 -1
- package/dist/client/scripts/5d1af8b5899f0a7d20b5.js +0 -1
- package/dist/client/scripts/5d25dbe04690abb995ba.js +0 -1
- package/dist/client/scripts/64719834daea9cc3b873.js +0 -1
- package/dist/client/scripts/65d2c51e2beb03874a14.js +0 -2
- package/dist/client/scripts/6738510c4fca5f603347.js +0 -1
- package/dist/client/scripts/6845c21345c034494aab.js +0 -1
- package/dist/client/scripts/729011a4abbe01b0cea6.js +0 -1
- package/dist/client/scripts/7579965411b0db902771.js +0 -1
- package/dist/client/scripts/758ca7e7bbf77700b5d7.js +0 -1
- package/dist/client/scripts/779a65202af7a338c32d.js +0 -1
- package/dist/client/scripts/7d93bd4d75d38f0c1081.js +0 -1
- package/dist/client/scripts/81d43a254f83ac1fac0e.js +0 -1
- package/dist/client/scripts/84a4ea2c7d457a79308f.js +0 -1
- package/dist/client/scripts/8be9f3f7c4f0ecaea47f.js +0 -1
- package/dist/client/scripts/919631fb24656f33aa98.js +0 -1
- package/dist/client/scripts/9533abb03a5f0ad78094.js +0 -1
- package/dist/client/scripts/9ee700f699a455060e6a.js +0 -1
- package/dist/client/scripts/a317639b5ddbe33db1d2.js +0 -1
- package/dist/client/scripts/a5d6f1695cd294d57e3b.js +0 -1
- package/dist/client/scripts/b0abfbd0ce8ee009bbaa.js +0 -1
- package/dist/client/scripts/b2ea6a5920815ba86d22.js +0 -1
- package/dist/client/scripts/b52dbf68eb33409ade23.js +0 -1
- package/dist/client/scripts/b9b99f2c079244b8b432.js +0 -1
- package/dist/client/scripts/bca4c55702f5864efab5.js +0 -1
- package/dist/client/scripts/bcfd753d0a237fa59b10.js +0 -1
- package/dist/client/scripts/be11d55bc40fb537c896.js +0 -1
- package/dist/client/scripts/c7926d3671e25f37b18c.js +0 -1
- package/dist/client/scripts/c984c5ad55ad99e7a7fb.js +0 -1
- package/dist/client/scripts/cca6d4f7491cd652d4a3.js +0 -1
- package/dist/client/scripts/cd29f6c4eb6a02d22d9f.js +0 -1
- package/dist/client/scripts/d27968d1a36d191eb9e9.js +0 -1
- package/dist/client/scripts/d6908717cd98b1d8fa93.js +0 -1
- package/dist/client/scripts/dc21fd6b49512f41b9c3.js +0 -1
- package/dist/client/scripts/dd47fa74f0feee2a3c07.js +0 -1
- package/dist/client/scripts/e3c091de489a13ec670e.js +0 -1
- package/dist/client/scripts/fcc93c767715a1bfc0ca.js +0 -1
- package/dist/client/styles/84a4ea2c7d457a79308f.css +0 -1
- /package/dist/client/scripts/{8c3b19634e8fd15ad558.js → 2109495bcb3ad9b2c1bc.js} +0 -0
- /package/dist/client/scripts/{931783350ba482ac58ea.js → 30915f258985633764de.js} +0 -0
- /package/dist/client/styles/{9ee700f699a455060e6a.css → 014696e80aae9192e359.css} +0 -0
- /package/dist/client/styles/{768110f244f934f60565.css → 01ea361e28a56b3eefcd.css} +0 -0
- /package/dist/client/styles/{7d93bd4d75d38f0c1081.css → 02035cfde2b723d41fd2.css} +0 -0
- /package/dist/client/styles/{8fca3cf4a6b47dd03ec2.css → 066d7b3e707ba3f07a31.css} +0 -0
- /package/dist/client/styles/{a3e65b8f7187d6fef46c.css → 09e119c9d66ee67f1eb8.css} +0 -0
- /package/dist/client/styles/{5d1af8b5899f0a7d20b5.css → 0a96c285d8c41c9f354b.css} +0 -0
- /package/dist/client/styles/{0fb04884047cd78dd040.css → 0e46b322bdc18ef31644.css} +0 -0
- /package/dist/client/styles/{c7926d3671e25f37b18c.css → 0ea050cf21103a863726.css} +0 -0
- /package/dist/client/styles/{4ef6e4944d6fdb2418e8.css → 0f504c087caa45ac5a91.css} +0 -0
- /package/dist/client/styles/{22667a258087a1250b73.css → 10892f1b937b50ba1d62.css} +0 -0
- /package/dist/client/styles/{15d19d418d289240628e.css → 1bb7e57b0ae059acb355.css} +0 -0
- /package/dist/client/styles/{b52dbf68eb33409ade23.css → 1c6fc241a7b9c4e10e81.css} +0 -0
- /package/dist/client/styles/{386f7ca55b7614ccfff6.css → 1ea58060bdd59b73f2cc.css} +0 -0
- /package/dist/client/styles/{77565fda654b75c8d300.css → 285efd3dc49962c1ffb9.css} +0 -0
- /package/dist/client/styles/{06be5a40788608220924.css → 2dfbe8e2da6ca6808d5b.css} +0 -0
- /package/dist/client/styles/{2d1919731dec95c3ab78.css → 31a2579101bbbb9e5f30.css} +0 -0
- /package/dist/client/styles/{f3c88f10ff0cecee4136.css → 31f9d972fa4753eaee60.css} +0 -0
- /package/dist/client/styles/{d27968d1a36d191eb9e9.css → 35336d2943dd00299222.css} +0 -0
- /package/dist/client/styles/{0e20aaa05a36cd8048f2.css → 380522fadda741c9b3dc.css} +0 -0
- /package/dist/client/styles/{b2ea6a5920815ba86d22.css → 3b406b51b28c32a41fa7.css} +0 -0
- /package/dist/client/styles/{767ced5019a52e377db7.css → 3b782f9b1a48bb37ea1b.css} +0 -0
- /package/dist/client/styles/{946ddf507f7126cacd6f.css → 3f7b9965307d21e64c2d.css} +0 -0
- /package/dist/client/styles/{8be9f3f7c4f0ecaea47f.css → 4009c947df35b4d5c491.css} +0 -0
- /package/dist/client/styles/{a317639b5ddbe33db1d2.css → 45f0025aa5e0e67e90af.css} +0 -0
- /package/dist/client/styles/{779a65202af7a338c32d.css → 4888c910526a478af55c.css} +0 -0
- /package/dist/client/styles/{b1297de176912ca3e016.css → 48d53e3631b7bf81ef29.css} +0 -0
- /package/dist/client/styles/{f299c91e3375f635d678.css → 48e4dad7a650579d6b4e.css} +0 -0
- /package/dist/client/styles/{dc8ffc859bf0fa24a73a.css → 4f262ff6d88d67a5edb0.css} +0 -0
- /package/dist/client/styles/{5a695262345dd67bcf57.css → 57f474f5e19eb8baccea.css} +0 -0
- /package/dist/client/styles/{b9b99f2c079244b8b432.css → 5d2e8fcc89de9881e3f0.css} +0 -0
- /package/dist/client/styles/{dc21fd6b49512f41b9c3.css → 5e005447771fd3cd6b2b.css} +0 -0
- /package/dist/client/styles/{5569bb64f8f5205efa41.css → 62bdbadba4db64715c90.css} +0 -0
- /package/dist/client/styles/{be11d55bc40fb537c896.css → 6c1ef7ce05ae842acdde.css} +0 -0
- /package/dist/client/styles/{ec7a03c7626a87900e8f.css → 6cde0c4a56ffc9a6948a.css} +0 -0
- /package/dist/client/styles/{4c79c3b75fe74372b440.css → 6ce50cc9d208b577f33b.css} +0 -0
- /package/dist/client/styles/{e8027df65498e3962468.css → 71533bdc41e1b0d7cf00.css} +0 -0
- /package/dist/client/styles/{a5d6f1695cd294d57e3b.css → 72914614ed8843afe8e7.css} +0 -0
- /package/dist/client/styles/{7bdcf2afcd8cdec0a5d5.css → 72d1baeb2e66131db0da.css} +0 -0
- /package/dist/client/styles/{89f69635eb151c0743fd.css → 7454ae168051d0e27e19.css} +0 -0
- /package/dist/client/styles/{b0abfbd0ce8ee009bbaa.css → 790f51d005d7150b9f08.css} +0 -0
- /package/dist/client/styles/{49598e01d3e5612354ed.css → 7bec5bb5f97f2464b576.css} +0 -0
- /package/dist/client/styles/{a4a4ccf4ff06adbfc89d.css → 7d1b6fb07a662ab1b389.css} +0 -0
- /package/dist/client/styles/{e3c091de489a13ec670e.css → 7f0830b7d5e434d7a977.css} +0 -0
- /package/dist/client/styles/{07c664894dd40b1ec2c4.css → 808a63db7e326de214a9.css} +0 -0
- /package/dist/client/styles/{377d2b3d73725d46c3b9.css → 815727531bfef1c70c8f.css} +0 -0
- /package/dist/client/styles/{55fd4c070115ba389108.css → 829fb548fb318cc6c227.css} +0 -0
- /package/dist/client/styles/{64719834daea9cc3b873.css → 835ff83b6597e828c6fb.css} +0 -0
- /package/dist/client/styles/{972d95b6bbc4747a583d.css → 87481837088a84e90ef5.css} +0 -0
- /package/dist/client/styles/{cd29f6c4eb6a02d22d9f.css → 8751d1ac21308fc7e78b.css} +0 -0
- /package/dist/client/styles/{d6e2bcb97349bafc6845.css → 87c81786aba52ad2c8de.css} +0 -0
- /package/dist/client/styles/{c0149c75a57e805eba11.css → 8b7ae0ee4655791853d1.css} +0 -0
- /package/dist/client/styles/{76eb53ffa89359303ca5.css → 8d66c9c61aafbfb8863a.css} +0 -0
- /package/dist/client/styles/{7579965411b0db902771.css → 8f688a3a5f483ff3f90f.css} +0 -0
- /package/dist/client/styles/{23348ae8c72907e38980.css → 8fc24289899913dd4b9c.css} +0 -0
- /package/dist/client/styles/{6e83c6f7c0a90b34622d.css → 90d734ebff6ad86a760a.css} +0 -0
- /package/dist/client/styles/{08084fd865f1ec5277ab.css → 91b2d5bc3c73cd4f18d5.css} +0 -0
- /package/dist/client/styles/{044bfb9482afdccb2697.css → 9423bad82a9386c620dd.css} +0 -0
- /package/dist/client/styles/{5d25dbe04690abb995ba.css → 9999938ef7d992beb718.css} +0 -0
- /package/dist/client/styles/{9f6f0e367cc189e40326.css → 9a0913e2bb7e116e722a.css} +0 -0
- /package/dist/client/styles/{758ca7e7bbf77700b5d7.css → 9cfa0f253a3aebd930a2.css} +0 -0
- /package/dist/client/styles/{ebf40b1e9787e4c1bc89.css → 9faa3989454af4ae1646.css} +0 -0
- /package/dist/client/styles/{ba4de7594bba69128088.css → 9fc3879dcd92ead8420a.css} +0 -0
- /package/dist/client/styles/{594d4a275d4ecc149321.css → a5720cb035b84b05a681.css} +0 -0
- /package/dist/client/styles/{dc0b35c5cbada76c8f91.css → a7873e3d286e50fba6c9.css} +0 -0
- /package/dist/client/styles/{5a78fd7739edf164bffc.css → a78ff92ceead2d31f3a9.css} +0 -0
- /package/dist/client/styles/{2a6eb9437415815a7c8b.css → a92bcf3f9625c73de815.css} +0 -0
- /package/dist/client/styles/{58dc3d271d377f63d669.css → aea24adeebd8a85f0d9f.css} +0 -0
- /package/dist/client/styles/{fcc93c767715a1bfc0ca.css → b0e6c2314243d68e28b0.css} +0 -0
- /package/dist/client/styles/{cca6d4f7491cd652d4a3.css → b4a23e7a73eae4480216.css} +0 -0
- /package/dist/client/styles/{73ed30880b13b6906513.css → b5f382bd1ef86330d29d.css} +0 -0
- /package/dist/client/styles/{57a4d1a4d7414143c481.css → b5fad640f69afe308f11.css} +0 -0
- /package/dist/client/styles/{59722ca7df6b49712bfa.css → b780d82de69f5dc4cc7a.css} +0 -0
- /package/dist/client/styles/{bca4c55702f5864efab5.css → b9d33994c69b2a8de5fe.css} +0 -0
- /package/dist/client/styles/{d0c0934289c2e798b85d.css → ba790fc15aa9dd2a524f.css} +0 -0
- /package/dist/client/styles/{4d939c5862fea5e64e5c.css → bdb8608eddf7bc7915c8.css} +0 -0
- /package/dist/client/styles/{5017a70de73841a396da.css → c01ba1121e07f8275c28.css} +0 -0
- /package/dist/client/styles/{2806750528d85460028f.css → c05223da24c7e1792d39.css} +0 -0
- /package/dist/client/styles/{81d43a254f83ac1fac0e.css → c2a488a59af6b939a61e.css} +0 -0
- /package/dist/client/styles/{6f404e26a825f73c1d7d.css → c3dcd9d23d027dd49374.css} +0 -0
- /package/dist/client/styles/{6cc4b48d94ba68abe2c8.css → c7b72bcfc9e8773232d1.css} +0 -0
- /package/dist/client/styles/{ceb147d872c2cc6d8e43.css → cd7968f5815183867103.css} +0 -0
- /package/dist/client/styles/{c984c5ad55ad99e7a7fb.css → cdab1ed393767e094329.css} +0 -0
- /package/dist/client/styles/{a5841e51763678db6089.css → ce05b548e362b5886d8d.css} +0 -0
- /package/dist/client/styles/{c3ccea24a5c73faaf99e.css → d26a3d80e6c77f61e906.css} +0 -0
- /package/dist/client/styles/{2313512dca4cba19c5cf.css → d2c54ba404a1cf66db40.css} +0 -0
- /package/dist/client/styles/{e5b18709069828a4363d.css → d8e6b1ff37198ab047be.css} +0 -0
- /package/dist/client/styles/{5ca7c046bdea4196601e.css → d942e5ec658c176d6750.css} +0 -0
- /package/dist/client/styles/{b71233fab69a4991c295.css → de4f0e5200e9af12acbd.css} +0 -0
- /package/dist/client/styles/{919631fb24656f33aa98.css → e58799bb10a7008421cf.css} +0 -0
- /package/dist/client/styles/{7061fd6c9ef6c41788c5.css → e7a8d37da2ffba5d13f1.css} +0 -0
- /package/dist/client/styles/{5da4558386ae97434fb7.css → ec98e9fccfc20586c905.css} +0 -0
- /package/dist/client/styles/{bcfd753d0a237fa59b10.css → f03174e16f719c89d9d5.css} +0 -0
- /package/dist/client/styles/{478bda1ed98f48e890ad.css → f304d9429842a3472c24.css} +0 -0
- /package/dist/client/styles/{6738510c4fca5f603347.css → f4709b00f96deef67c51.css} +0 -0
- /package/dist/client/styles/{729011a4abbe01b0cea6.css → f5685cc9549af21468a2.css} +0 -0
- /package/dist/client/styles/{9118978a47a3fcaaeeb3.css → f6a0b11764b771115ce2.css} +0 -0
- /package/dist/client/styles/{581c0d593f05f48c8b33.css → fe7fd3da91146a0ad576.css} +0 -0
- /package/dist/client/styles/{8fea7091b1b3af2f8c5f.css → ff019a30624b95c825db.css} +0 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("./v4-tWlzORDj.js"),R=require("vue"),Jo=require("pinia"),Cp=require("bootstrap-vue-next");let Na="";typeof window<"u"&&(Na=document.currentScript);const u_={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(y){if(Na!==""){this.options.div=Na.getAttribute("data-div")||this.options.div,this.options.logo=Na.getAttribute("data-logo")||this.options.logo,this.options.statement=Na.getAttribute("data-statement")||this.options.statement,this.options.prefix=Na.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Na.getAttribute("data-suffix")||this.options.suffix,y=typeof y<"u"?y:{},Object.assign(this.options,y);const v=document.getElementById(this.options.div);let S="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(S="os-api-branding logo white");let M=this.options.statement;M=M.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(M=`${this.options.prefix}<span>|</span>${M}`),this.options.suffix!==""&&(M=`${M}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(l=>l.remove());const O=document.createElement("div");O.className=S,v.appendChild(O);const Z=document.createElement("div");Z.className="os-api-branding copyright",Z.innerHTML=M,v.appendChild(Z)}}},Zi=Jo.defineStore("map",()=>{const y=R.ref([]),v=R.ref([]),S=R.ref(null),M=R.ref(null),O=R.ref(null);function Z(Fe){y.value.push({id:Fe.id,filters:Fe.filters,places:Fe.places,activePins:Fe.activePins,hovered:"",activePlace:null})}function l(Fe){y.value.forEach(tt=>{tt.id===Fe.mapId&&(tt.hovered=Fe.hoveredFeature)})}function ae(Fe){y.value.forEach(tt=>{tt.id===Fe.mapId&&(tt.activePlace=Fe.activeFeature)})}function Y(Fe){v.value=Fe}function ye(Fe){S.value=Fe}function me(Fe){M.value=Fe}function Ee(Fe){return y.value.find(tt=>tt.id===Fe)}function le(Fe){return y.value.find(Ne=>Ne.id===Fe).hovered}function ge(Fe){return y.value.find(Ne=>Ne.id===Fe).activePlace}return{maps:y,activeSubcatFilters:v,selectedSubCategory:S,activeMarkerPos:M,activePlace:O,addMapInstance:Z,setHoveredPlace:l,setActivePlace:ae,setActiveSubcatFilters:Y,setSelectedSubcat:ye,setActiveMarkerPos:me,getMapById:Ee,getHoveredStop:le,getActivePlace:ge}});var Fy={exports:{}};(function(y,v){(function(S,M){y.exports=M()})(oe.commonjsGlobal,function(){var S,M,O;function Z(l,ae){if(!S)S=ae;else if(!M)M=ae;else{var Y="var sharedChunk = {}; ("+S+")(sharedChunk); ("+M+")(sharedChunk);",ye={};S(ye),O=ae(ye),typeof window<"u"&&(O.workerUrl=window.URL.createObjectURL(new Blob([Y],{type:"text/javascript"})))}}return Z(["exports"],function(l){function ae(e,t){return e(t={exports:{}},t.exports),t.exports}var Y=ye;function ye(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}ye.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},ye.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},ye.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},ye.prototype.solveCurveX=function(e,t){var r,a,u,c,h;for(t===void 0&&(t=1e-6),u=e,h=0;h<8;h++){if(c=this.sampleCurveX(u)-e,Math.abs(c)<t)return u;var m=this.sampleCurveDerivativeX(u);if(Math.abs(m)<1e-6)break;u-=c/m}if((u=e)<(r=0))return r;if(u>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(u),Math.abs(c-e)<t)return u;e>c?r=u:a=u,u=.5*(a-r)+r}return u},ye.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var me=Ee;function Ee(e,t){this.x=e,this.y=t}Ee.prototype={clone:function(){return new Ee(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),u=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ee.convert=function(e){return e instanceof Ee?e:Array.isArray(e)?new Ee(e[0],e[1]):e};var le=typeof self<"u"?self:{},ge=Math.pow(2,53)-1;function Fe(e,t,r,a){var u=new Y(e,t,r,a);return function(c){return u.solve(c)}}var tt=Fe(.25,.1,.25,1);function Ne(e,t,r){return Math.min(r,Math.max(t,e))}function Nt(e,t,r){var a=r-t,u=((e-t)%a+a)%a+t;return u===t?r:u}function Ye(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var h in c)e[h]=c[h]}return e}var Ct=1;function zt(){return Ct++}function At(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function rr(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Kt(e,t){e.forEach(function(r){t[r]&&(t[r]=t[r].bind(t))})}function cr(e,t){return e.indexOf(t,e.length-t.length)!==-1}function pr(e,t,r){var a={};for(var u in e)a[u]=t.call(r||this,e[u],u,e);return a}function Hr(e,t,r){var a={};for(var u in e)t.call(r||this,e[u],u,e)&&(a[u]=e[u]);return a}function _r(e){return Array.isArray(e)?e.map(_r):typeof e=="object"&&e?pr(e,_r):e}var _i={};function Lt(e){_i[e]||(typeof console<"u"&&console.warn(e),_i[e]=!0)}function Tr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function To(e){for(var t=0,r=0,a=e.length,u=a-1,c=void 0,h=void 0;r<a;u=r++)t+=((h=e[u]).x-(c=e[r]).x)*(c.y+h.y);return t}function ii(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Io(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(a,u,c,h){var m=c||h;return t[u]=!m||m.toLowerCase(),""}),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var Eo=null;function ja(e){if(Eo==null){var t=e.navigator?e.navigator.userAgent:null;Eo=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Eo}function mn(e){try{var t=le[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Di,Gi,jn,$n,yn=le.performance&&le.performance.now?le.performance.now.bind(le.performance):Date.now.bind(Date),Ks=le.requestAnimationFrame||le.mozRequestAnimationFrame||le.webkitRequestAnimationFrame||le.msRequestAnimationFrame,Vr=le.cancelAnimationFrame||le.mozCancelAnimationFrame||le.webkitCancelAnimationFrame||le.msCancelAnimationFrame,rn={now:yn,frame:function(e){var t=Ks(e);return{cancel:function(){return Vr(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=le.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Di||(Di=le.document.createElement("a")),Di.href=e,Di.href},hardwareConcurrency:le.navigator&&le.navigator.hardwareConcurrency||4,get devicePixelRatio(){return le.devicePixelRatio},get prefersReducedMotion(){return!!le.matchMedia&&(Gi==null&&(Gi=le.matchMedia("(prefers-reduced-motion: reduce)")),Gi.matches)}},Rt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Wi={supported:!1,testSupport:function(e){!Ao&&$n&&(Li?mt(e):jn=e)}},Ao=!1,Li=!1;function mt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,$n),e.isContextLost())return;Wi.supported=!0}catch{}e.deleteTexture(t),Ao=!0}le.document&&(($n=le.document.createElement("img")).onload=function(){jn&&mt(jn),jn=null,Li=!0},$n.onerror=function(){Ao=!0,jn=null},$n.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var vn="01",Kr=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function xi(e){return e.indexOf("mapbox:")===0}Kr.prototype._createSkuToken=function(){var e=function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",vn,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},Kr.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Kr.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},Kr.prototype.normalizeStyleURL=function(e,t){if(!xi(e))return e;var r=bi(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeGlyphsURL=function(e,t){if(!xi(e))return e;var r=bi(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeSourceURL=function(e,t){if(!xi(e))return e;var r=bi(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},Kr.prototype.normalizeSpriteURL=function(e,t,r,a){var u=bi(e);return xi(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=""+t+r,Zn(u))},Kr.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!xi(e))return e;var r=bi(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(rn.devicePixelRatio>=2||t===512?"@2x":"")+(Wi.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(u){for(var c=0,h=u;c<h.length;c+=1){var m=h[c].match(/^access_token=(.*)$/);if(m)return m[1]}return null}(r.params)||Rt.ACCESS_TOKEN;return Rt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},Kr.prototype.canonicalizeTileURL=function(e,t){var r=bi(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var u=r.params;return t&&(u=u.filter(function(c){return!c.match(/^access_token=/)})),u.length&&(a+="?"+u.join("&")),a},Kr.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&xi(t),a=[],u=0,c=e.tiles||[];u<c.length;u+=1){var h=c[u];Ri(h)?a.push(this.canonicalizeTileURL(h,r)):a.push(h)}return a},Kr.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=bi(Rt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var u=e.params.indexOf("secure");u>=0&&e.params.splice(u,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Rt.REQUIRE_ACCESS_TOKEN)return Zn(e);if(!(t=t||Rt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter(function(c){return c.indexOf("access_token")===-1}),e.params.push("access_token="+t),Zn(e)};var Ys=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ri(e){return Ys.test(e)}var ta=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function bi(e){var t=e.match(ta);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Zn(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function Co(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(le.atob(t[1]).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var wi=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};wi.prototype.getStorageKey=function(e){var t,r=Co(Rt.ACCESS_TOKEN);return t=r&&r.u?le.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,function(a,u){return String.fromCharCode(+("0x"+u))})):Rt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},wi.prototype.fetchEventData=function(){var e=mn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=le.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var u=le.localStorage.getItem(r);u&&(this.anonId=u)}catch{Lt("Unable to read from LocalStorage")}},wi.prototype.saveEventData=function(){var e=mn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{le.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&le.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{Lt("Unable to write to LocalStorage")}},wi.prototype.processRequests=function(e){},wi.prototype.postEvent=function(e,t,r,a){var u=this;if(Rt.EVENTS_URL){var c=bi(Rt.EVENTS_URL);c.params.push("access_token="+(a||Rt.ACCESS_TOKEN||""));var h={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:vn,userId:this.anonId},m=t?Ye(h,t):h,_={url:Zn(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([m])};this.pendingRequest=ir(_,function(x){u.pendingRequest=null,r(x),u.saveEventData(),u.processRequests(a)})}},wi.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var Si,Gn,Fi=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,u,c){this.skuToken=u;var h=!(!c&&!Rt.ACCESS_TOKEN),m=Array.isArray(r)&&r.some(function(_){return xi(_)||Ri(_)});Rt.EVENTS_URL&&h&&m&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var u=this.queue.shift(),c=u.id,h=u.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),rr(this.anonId)||(this.anonId=At()),this.postEvent(h,{skuToken:this.skuToken},function(m){m||c&&(a.success[c]=!0)},r))}},t}(wi),$a=new(function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Rt.EVENTS_URL&&Rt.ACCESS_TOKEN&&Array.isArray(r)&&r.some(function(u){return xi(u)||Ri(u)})&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var u=Co(Rt.ACCESS_TOKEN),c=u?u.u:Rt.ACCESS_TOKEN,h=c!==this.eventData.tokenU;rr(this.anonId)||(this.anonId=At(),h=!0);var m=this.queue.shift();if(this.eventData.lastSuccess){var _=new Date(this.eventData.lastSuccess),x=new Date(m),w=(m-this.eventData.lastSuccess)/864e5;h=h||w>=1||w<-1||_.getDate()!==x.getDate()}else h=!0;if(!h)return this.processRequests();this.postEvent(m,{"enabled.telemetry":!1},function(T){T||(a.eventData.lastSuccess=m,a.eventData.tokenU=c)},r)}},t}(wi)),Za=$a.postTurnstileEvent.bind($a),ra=new Fi,ia=ra.postMapLoadEvent.bind(ra),Po=500,Ga=50;function ko(){le.caches&&!Si&&(Si=le.caches.open("mapbox-tiles"))}function na(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Wn,oa=1/0;function aa(){return Wn==null&&(Wn=le.OffscreenCanvas&&new le.OffscreenCanvas(1,1).getContext("2d")&&typeof le.createImageBitmap=="function"),Wn}var Wa={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Wa);var Xa=function(e){function t(r,a,u){a===401&&Ri(u)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=u,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),Xn=ii()?function(){return self.worker&&self.worker.referrer}:function(){return(le.location.protocol==="blob:"?le.parent:le).location.href},nn,on,Mo=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Xn())&&!/^\w+:/.test(r))){if(le.fetch&&le.Request&&le.AbortController&&le.Request.prototype.hasOwnProperty("signal"))return function(a,u){var c,h=new le.AbortController,m=new le.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Xn(),signal:h.signal}),_=!1,x=!1,w=(c=m.url).indexOf("sku=")>0&&Ri(c);a.type==="json"&&m.headers.set("Accept","application/json");var T=function(k,N,U){if(!x){if(k&&k.message!=="SecurityError"&&Lt(k),N&&U)return C(N);var K=Date.now();le.fetch(m).then(function(W){if(W.ok){var te=w?W.clone():null;return C(W,te,K)}return u(new Xa(W.statusText,W.status,a.url))}).catch(function(W){W.code!==20&&u(new Error(W.message))})}},C=function(k,N,U){(a.type==="arrayBuffer"?k.arrayBuffer():a.type==="json"?k.json():k.text()).then(function(K){x||(N&&U&&function(W,te,ne){if(ko(),Si){var se={status:te.status,statusText:te.statusText,headers:new le.Headers};te.headers.forEach(function(ve,Se){return se.headers.set(Se,ve)});var ce=Io(te.headers.get("Cache-Control")||"");ce["no-store"]||(ce["max-age"]&&se.headers.set("Expires",new Date(ne+1e3*ce["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-ne<42e4||function(ve,Se){if(Gn===void 0)try{new Response(new ReadableStream),Gn=!0}catch{Gn=!1}Gn?Se(ve.body):ve.blob().then(Se)}(te,function(ve){var Se=new le.Response(ve,se);ko(),Si&&Si.then(function(Ae){return Ae.put(na(W.url),Se)}).catch(function(Ae){return Lt(Ae.message)})}))}}(m,N,U),_=!0,u(null,K,k.headers.get("Cache-Control"),k.headers.get("Expires")))}).catch(function(K){x||u(new Error(K.message))})};return w?function(k,N){if(ko(),!Si)return N(null);var U=na(k.url);Si.then(function(K){K.match(U).then(function(W){var te=function(ne){if(!ne)return!1;var se=new Date(ne.headers.get("Expires")||0),ce=Io(ne.headers.get("Cache-Control")||"");return se>Date.now()&&!ce["no-cache"]}(W);K.delete(U),te&&K.put(U,W.clone()),N(null,W,te)}).catch(N)}).catch(N)}(m,T):T(null,null),{cancel:function(){x=!0,_||h.abort()}}}(e,t);if(ii()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(a,u){var c=new le.XMLHttpRequest;for(var h in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(h,a.headers[h]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){u(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var m=c.response;if(a.type==="json")try{m=JSON.parse(c.response)}catch(_){return u(_)}u(null,m,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new Xa(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}}(e,t)},sa=function(e,t){return Mo(Ye(e,{type:"arrayBuffer"}),t)},ir=function(e,t){return Mo(Ye(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";nn=[],on=0;var A=function(e,t){if(Wi.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),on>=Rt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return nn.push(r),r}on++;var a=!1,u=function(){if(!a)for(a=!0,on--;nn.length&&on<Rt.MAX_PARALLEL_IMAGE_REQUESTS;){var h=nn.shift();h.cancelled||(h.cancel=A(h.requestParameters,h.callback).cancel)}},c=sa(e,function(h,m,_,x){u(),h?t(h):m&&(aa()?function(w,T){var C=new le.Blob([new Uint8Array(w)],{type:"image/png"});le.createImageBitmap(C).then(function(k){T(null,k)}).catch(function(k){T(new Error("Could not load image because of "+k.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(m,t):function(w,T,C,k){var N=new le.Image,U=le.URL;N.onload=function(){T(null,N),U.revokeObjectURL(N.src),N.onload=null,le.requestAnimationFrame(function(){N.src=I})},N.onerror=function(){return T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var K=new le.Blob([new Uint8Array(w)],{type:"image/png"});N.cacheControl=C,N.expires=k,N.src=w.byteLength?U.createObjectURL(K):I}(m,t,_,x))});return{cancel:function(){c.cancel(),u()}}};function P(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function F(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var j=function(e,t){t===void 0&&(t={}),Ye(this,t),this.type=e},J=function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",Ye({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(j),ee=function(){};ee.prototype.on=function(e,t){return this._listeners=this._listeners||{},P(e,t,this._listeners),this},ee.prototype.off=function(e,t){return F(e,t,this._listeners),F(e,t,this._oneTimeListeners),this},ee.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},P(e,t,this._oneTimeListeners),this},ee.prototype.fire=function(e,t){typeof e=="string"&&(e=new j(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<u.length;a+=1)u[a].call(this,e);for(var c=0,h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<h.length;c+=1){var m=h[c];F(r,m,this._oneTimeListeners),m.call(this,e)}var _=this._eventedParent;_&&(Ye(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof J&&console.error(e.error);return this},ee.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ee.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var B={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},G=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function ie(e){var t=e.value;return t?[new G(e.key,t,"constants have been deprecated as of v8")]:[]}function xe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var h in c)e[h]=c[h]}return e}function we(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function fe(e){if(Array.isArray(e))return e.map(fe);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=fe(e[r]);return t}return we(e)}var be=function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Error),Ue=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var u=a[r];this.bindings[u[0]]=u[1]}};Ue.prototype.concat=function(e){return new Ue(this,e)},Ue.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ue.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Oe={kind:"null"},de={kind:"number"},De={kind:"string"},Ce={kind:"boolean"},ke={kind:"color"},ut={kind:"object"},ze={kind:"value"},yt={kind:"collator"},Ft={kind:"formatted"},pt={kind:"resolvedImage"};function Tt(e,t){return{kind:"array",itemType:e,N:t}}function gt(e){if(e.kind==="array"){var t=gt(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var Nr=[Oe,de,De,Ce,ke,Ft,ut,Tt(ze),pt];function Pt(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Pt(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=Nr;r<a.length;r+=1)if(!Pt(a[r],t))return null}}return"Expected "+gt(e)+" but found "+gt(t)+" instead."}function nr(e,t){return t.some(function(r){return r.kind===e.kind})}function Bt(e,t){return t.some(function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e})}var dt=ae(function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(m){return(m=Math.round(m))<0?0:m>255?255:m}function u(m){return a(m[m.length-1]==="%"?parseFloat(m)/100*255:parseInt(m))}function c(m){return(_=m[m.length-1]==="%"?parseFloat(m)/100:parseFloat(m))<0?0:_>1?1:_;var _}function h(m,_,x){return x<0?x+=1:x>1&&(x-=1),6*x<1?m+(_-m)*x*6:2*x<1?_:3*x<2?m+(_-m)*(2/3-x)*6:m}try{t.parseCSSColor=function(m){var _,x=m.replace(/ /g,"").toLowerCase();if(x in r)return r[x].slice();if(x[0]==="#")return x.length===4?(_=parseInt(x.substr(1),16))>=0&&_<=4095?[(3840&_)>>4|(3840&_)>>8,240&_|(240&_)>>4,15&_|(15&_)<<4,1]:null:x.length===7&&(_=parseInt(x.substr(1),16))>=0&&_<=16777215?[(16711680&_)>>16,(65280&_)>>8,255&_,1]:null;var w=x.indexOf("("),T=x.indexOf(")");if(w!==-1&&T+1===x.length){var C=x.substr(0,w),k=x.substr(w+1,T-(w+1)).split(","),N=1;switch(C){case"rgba":if(k.length!==4)return null;N=c(k.pop());case"rgb":return k.length!==3?null:[u(k[0]),u(k[1]),u(k[2]),N];case"hsla":if(k.length!==4)return null;N=c(k.pop());case"hsl":if(k.length!==3)return null;var U=(parseFloat(k[0])%360+360)%360/360,K=c(k[1]),W=c(k[2]),te=W<=.5?W*(K+1):W+K-W*K,ne=2*W-te;return[a(255*h(ne,te,U+1/3)),a(255*h(ne,te,U)),a(255*h(ne,te,U-1/3)),N];default:return null}}return null}}catch{}}).parseCSSColor,It=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};It.parse=function(e){if(e){if(e instanceof It)return e;if(typeof e=="string"){var t=dt(e);if(t)return new It(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},It.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},It.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},It.black=new It(0,0,0,1),It.white=new It(1,1,1,1),It.transparent=new It(0,0,0,0),It.red=new It(1,0,0,1);var Yr=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Yr.prototype.compare=function(e,t){return this.collator.compare(e,t)},Yr.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var la=function(e,t,r,a,u){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=u},Ir=function(e){this.sections=e};Ir.fromString=function(e){return new Ir([new la(e,null,null,null,null)])},Ir.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(e){return e.text.length!==0||e.image&&e.image.name.length!==0})},Ir.factory=function(e){return e instanceof Ir?e:Ir.fromString(e)},Ir.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(e){return e.text}).join("")},Ir.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var u={};a.fontStack&&(u["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(u["font-scale"]=a.scale),a.textColor&&(u["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(u)}}return e};var Jr=function(e){this.name=e.name,this.available=e.available};function Js(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ua(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof It||e instanceof Yr||e instanceof Ir||e instanceof Jr)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!ua(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!ua(e[a]))return!1;return!0}return!1}function or(e){if(e===null)return Oe;if(typeof e=="string")return De;if(typeof e=="boolean")return Ce;if(typeof e=="number")return de;if(e instanceof It)return ke;if(e instanceof Yr)return yt;if(e instanceof Ir)return Ft;if(e instanceof Jr)return pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,u=e;a<u.length;a+=1){var c=or(u[a]);if(t){if(t===c)continue;t=ze;break}t=c}return Tt(t||ze,r)}return ut}function ca(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof It||e instanceof Ir||e instanceof Jr?e.toString():JSON.stringify(e)}Jr.prototype.toString=function(){return this.name},Jr.fromString=function(e){return e?new Jr({name:e,available:!1}):null},Jr.prototype.serialize=function(){return["image",this.name]};var Ur=function(e,t){this.type=e,this.value=t};Ur.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ua(e[1]))return t.error("invalid value");var r=e[1],a=or(r),u=t.expectedType;return a.kind!=="array"||a.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(a=u),new Ur(a,r)},Ur.prototype.evaluate=function(){return this.value},Ur.prototype.eachChild=function(){},Ur.prototype.outputDefined=function(){return!0},Ur.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof It?["rgba"].concat(this.value.toArray()):this.value instanceof Ir?this.value.serialize():this.value};var Er=function(e){this.name="ExpressionEvaluationError",this.message=e};Er.prototype.toJSON=function(){return this.message};var Ti={string:De,number:de,boolean:Ce,object:ut},Zt=function(e,t){this.type=e,this.args=t};Zt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,u=e[0];if(u==="array"){var c,h;if(e.length>2){var m=e[1];if(typeof m!="string"||!(m in Ti)||m==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Ti[m],a++}else c=ze;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);h=e[2],a++}r=Tt(c,h)}else r=Ti[u];for(var _=[];a<e.length;a++){var x=t.parse(e[a],a,ze);if(!x)return null;_.push(x)}return new Zt(r,_)},Zt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Pt(this.type,or(r)))return r;if(t===this.args.length-1)throw new Er("Expected value to be of type "+gt(this.type)+", but found "+gt(or(r))+" instead.")}return null},Zt.prototype.eachChild=function(e){this.args.forEach(e)},Zt.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Zt.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map(function(u){return u.serialize()}))};var Oi=function(e){this.type=Ft,this.sections=e};Oi.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],u=!1,c=1;c<=e.length-1;++c){var h=e[c];if(u&&typeof h=="object"&&!Array.isArray(h)){u=!1;var m=null;if(h["font-scale"]&&!(m=t.parse(h["font-scale"],1,de)))return null;var _=null;if(h["text-font"]&&!(_=t.parse(h["text-font"],1,Tt(De))))return null;var x=null;if(h["text-color"]&&!(x=t.parse(h["text-color"],1,ke)))return null;var w=a[a.length-1];w.scale=m,w.font=_,w.textColor=x}else{var T=t.parse(e[c],1,ze);if(!T)return null;var C=T.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,a.push({content:T,scale:null,font:null,textColor:null})}}return new Oi(a)},Oi.prototype.evaluate=function(e){return new Ir(this.sections.map(function(t){var r=t.content.evaluate(e);return or(r)===pt?new la("",r,null,null,null):new la(ca(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},Oi.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},Oi.prototype.outputDefined=function(){return!1},Oi.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var u={};a.scale&&(u["font-scale"]=a.scale.serialize()),a.font&&(u["text-font"]=a.font.serialize()),a.textColor&&(u["text-color"]=a.textColor.serialize()),e.push(u)}return e};var fi=function(e){this.type=pt,this.input=e};fi.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,De);return r?new fi(r):t.error("No image name provided.")},fi.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=Jr.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},fi.prototype.eachChild=function(e){e(this.input)},fi.prototype.outputDefined=function(){return!1},fi.prototype.serialize=function(){return["image",this.input.serialize()]};var Ql={"to-boolean":Ce,"to-color":ke,"to-number":de,"to-string":De},Ii=function(e,t){this.type=e,this.args=t};Ii.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=Ql[r],u=[],c=1;c<e.length;c++){var h=t.parse(e[c],c,ze);if(!h)return null;u.push(h)}return new Ii(a,u)},Ii.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,u=this.args;a<u.length;a+=1){if(r=null,(t=u[a].evaluate(e))instanceof It)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Js(t[0],t[1],t[2],t[3])))return new It(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Er(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var h=null,m=0,_=this.args;m<_.length;m+=1){if((h=_[m].evaluate(e))===null)return 0;var x=Number(h);if(!isNaN(x))return x}throw new Er("Could not convert "+JSON.stringify(h)+" to number.")}return this.type.kind==="formatted"?Ir.fromString(ca(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Jr.fromString(ca(this.args[0].evaluate(e))):ca(this.args[0].evaluate(e))},Ii.prototype.eachChild=function(e){this.args.forEach(e)},Ii.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ii.prototype.serialize=function(){if(this.type.kind==="formatted")return new Oi([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new fi(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var Rc=["Unknown","Point","LineString","Polygon"],an=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};an.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},an.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Rc[this.feature.type]:this.feature.type:null},an.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},an.prototype.canonicalID=function(){return this.canonical},an.prototype.properties=function(){return this.feature&&this.feature.properties||{}},an.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=It.parse(e)),t};var zr=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};zr.prototype.evaluate=function(e){return this._evaluate(e,this.args)},zr.prototype.eachChild=function(e){this.args.forEach(e)},zr.prototype.outputDefined=function(){return!1},zr.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},zr.parse=function(e,t){var r,a=e[0],u=zr.definitions[a];if(!u)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(u)?u[0]:u.type,h=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,m=h.filter(function(We){var Be=We[0];return!Array.isArray(Be)||Be.length===e.length-1}),_=null,x=0,w=m;x<w.length;x+=1){var T=w[x],C=T[0],k=T[1];_=new bn(t.registry,t.path,null,t.scope);for(var N=[],U=!1,K=1;K<e.length;K++){var W=e[K],te=Array.isArray(C)?C[K-1]:C.type,ne=_.parse(W,1+N.length,te);if(!ne){U=!0;break}N.push(ne)}if(!U)if(Array.isArray(C)&&C.length!==N.length)_.error("Expected "+C.length+" arguments, but found "+N.length+" instead.");else{for(var se=0;se<N.length;se++){var ce=Array.isArray(C)?C[se]:C.type,ve=N[se];_.concat(se+1).checkSubtype(ce,ve.type)}if(_.errors.length===0)return new zr(a,c,k,N)}}if(m.length===1)(r=t.errors).push.apply(r,_.errors);else{for(var Se=(m.length?m:h).map(function(We){var Be;return Be=We[0],Array.isArray(Be)?"("+Be.map(gt).join(", ")+")":"("+gt(Be.type)+"...)"}).join(" | "),Ae=[],$e=1;$e<e.length;$e++){var Me=t.parse(e[$e],1+Ae.length);if(!Me)return null;Ae.push(gt(Me.type))}t.error("Expected arguments of type "+Se+", but found ("+Ae.join(", ")+") instead.")}return null},zr.register=function(e,t){for(var r in zr.definitions=t,t)e[r]=zr};var Xi=function(e,t,r){this.type=yt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function qr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Hn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Fc(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(r*u*8192),Math.round(a*u*8192)]}function Oc(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Qs(e,t){for(var r,a,u,c,h,m,_,x=!1,w=0,T=t.length;w<T;w++)for(var C=t[w],k=0,N=C.length;k<N-1;k++){if((c=(r=e)[0]-(a=C[k])[0])*(_=r[1]-(u=C[k+1])[1])-(m=r[0]-u[0])*(h=r[1]-a[1])==0&&c*m<=0&&h*_<=0)return!1;Oc(e,C[k],C[k+1])&&(x=!x)}return x}function Vc(e,t){for(var r=0;r<t.length;r++)if(Qs(e,t[r]))return!0;return!1}function eu(e,t,r,a){var u=a[0]-r[0],c=a[1]-r[1],h=(e[0]-r[0])*c-u*(e[1]-r[1]),m=(t[0]-r[0])*c-u*(t[1]-r[1]);return h>0&&m<0||h<0&&m>0}function Nc(e,t,r){for(var a=0,u=r;a<u.length;a+=1)for(var c=u[a],h=0;h<c.length-1;++h)if((T=[(w=c[h+1])[0]-(x=c[h])[0],w[1]-x[1]])[0]*(C=[(_=t)[0]-(m=e)[0],_[1]-m[1]])[1]-T[1]*C[0]!=0&&eu(m,_,x,w)&&eu(x,w,m,_))return!0;var m,_,x,w,T,C;return!1}function tu(e,t){for(var r=0;r<e.length;++r)if(!Qs(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Nc(e[a],e[a+1],t))return!1;return!0}function ru(e,t){for(var r=0;r<t.length;r++)if(tu(e,t[r]))return!0;return!1}function zo(e,t,r){for(var a=[],u=0;u<e.length;u++){for(var c=[],h=0;h<e[u].length;h++){var m=Fc(e[u][h],r);qr(t,m),c.push(m)}a.push(c)}return a}function el(e,t,r){for(var a=[],u=0;u<e.length;u++){var c=zo(e[u],t,r);a.push(c)}return a}function pa(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var u=.5*a,c=e[0]-r[0]>u?-a:r[0]-e[0]>u?a:0;c===0&&(c=e[0]-r[2]>u?-a:r[2]-e[0]>u?a:0),e[0]+=c}qr(t,e)}function iu(e,t,r,a){for(var u=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],h=[],m=0,_=e;m<_.length;m+=1)for(var x=0,w=_[m];x<w.length;x+=1){var T=w[x],C=[T.x+c[0],T.y+c[1]];pa(C,t,r,u),h.push(C)}return h}function Ha(e,t,r,a){for(var u,c=8192*Math.pow(2,a.z),h=[8192*a.x,8192*a.y],m=[],_=0,x=e;_<x.length;_+=1){for(var w=[],T=0,C=x[_];T<C.length;T+=1){var k=C[T],N=[k.x+h[0],k.y+h[1]];qr(t,N),w.push(N)}m.push(w)}if(t[2]-t[0]<=c/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(var U=0,K=m;U<K.length;U+=1)for(var W=0,te=K[U];W<te.length;W+=1)pa(te[W],t,r,c)}return m}Xi.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Ce);if(!a)return null;var u=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Ce);if(!u)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,De))?null:new Xi(a,u,c)},Xi.prototype.evaluate=function(e){return new Yr(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Xi.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Xi.prototype.outputDefined=function(){return!1},Xi.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Ei=function(e,t){this.type=Ce,this.geojson=e,this.geometries=t};function gn(e){if(e instanceof zr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof Ei)return!1;var t=!0;return e.eachChild(function(r){t&&!gn(r)&&(t=!1)}),t}function _n(e){if(e instanceof zr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild(function(r){t&&!_n(r)&&(t=!1)}),t}function Kn(e,t){if(e instanceof zr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(a){r&&!Kn(a,t)&&(r=!1)}),r}Ei.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ua(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var u=r.features[a].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new Ei(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new Ei(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new Ei(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ei.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=zo(r.coordinates,u,c),m=iu(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=m;_<x.length;_+=1)if(!Qs(x[_],h))return!1}if(r.type==="MultiPolygon"){var w=el(r.coordinates,u,c),T=iu(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var C=0,k=T;C<k.length;C+=1)if(!Vc(k[C],w))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var h=zo(r.coordinates,u,c),m=Ha(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var _=0,x=m;_<x.length;_+=1)if(!tu(x[_],h))return!1}if(r.type==="MultiPolygon"){var w=el(r.coordinates,u,c),T=Ha(t.geometry(),a,u,c);if(!Hn(a,u))return!1;for(var C=0,k=T;C<k.length;C+=1)if(!ru(k[C],w))return!1}return!0}(e,this.geometries)}return!1},Ei.prototype.eachChild=function(){},Ei.prototype.outputDefined=function(){return!0},Ei.prototype.serialize=function(){return["within",this.geojson]};var xn=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};xn.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new xn(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},xn.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},xn.prototype.eachChild=function(){},xn.prototype.outputDefined=function(){return!1},xn.prototype.serialize=function(){return["var",this.name]};var bn=function(e,t,r,a,u){t===void 0&&(t=[]),a===void 0&&(a=new Ue),u===void 0&&(u=[]),this.registry=e,this.path=t,this.key=t.map(function(c){return"["+c+"]"}).join(""),this.scope=a,this.errors=u,this.expectedType=r};function Ka(e,t){for(var r,a=e.length-1,u=0,c=a,h=0;u<=c;)if((r=e[h=Math.floor((u+c)/2)])<=t){if(h===a||t<e[h+1])return h;u=h+1}else{if(!(r>t))throw new Er("Input is not a number.");c=h-1}return 0}bn.prototype.parse=function(e,t,r,a,u){return u===void 0&&(u={}),t?this.concat(t,r,a)._parse(e,u):this._parse(e,u)},bn.prototype._parse=function(e,t){function r(x,w,T){return T==="assert"?new Zt(w,[x]):T==="coerce"?new Ii(w,[x]):x}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var u=this.registry[a];if(u){var c=u.parse(e,this);if(!c)return null;if(this.expectedType){var h=this.expectedType,m=c.type;if(h.kind!=="string"&&h.kind!=="number"&&h.kind!=="boolean"&&h.kind!=="object"&&h.kind!=="array"||m.kind!=="value")if(h.kind!=="color"&&h.kind!=="formatted"&&h.kind!=="resolvedImage"||m.kind!=="value"&&m.kind!=="string"){if(this.checkSubtype(h,m))return null}else c=r(c,h,t.typeAnnotation||"coerce");else c=r(c,h,t.typeAnnotation||"assert")}if(!(c instanceof Ur)&&c.type.kind!=="resolvedImage"&&function x(w){if(w instanceof xn)return x(w.boundExpression);if(w instanceof zr&&w.name==="error"||w instanceof Xi||w instanceof Ei)return!1;var T=w instanceof Ii||w instanceof Zt,C=!0;return w.eachChild(function(k){C=T?C&&x(k):C&&k instanceof Ur}),!!C&&gn(w)&&Kn(w,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var _=new an;try{c=new Ur(c.type,c.evaluate(_))}catch(x){return this.error(x.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},bn.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,u=r?this.scope.concat(r):this.scope;return new bn(this.registry,a,t||null,u,this.errors)},bn.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map(function(u){return"["+u+"]"}).join("");this.errors.push(new be(a,e))},bn.prototype.checkSubtype=function(e,t){var r=Pt(e,t);return r&&this.error(r),r};var ni=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,u=r;a<u.length;a+=1){var c=u[a],h=c[1];this.labels.push(c[0]),this.outputs.push(h)}};function hr(e,t,r){return e*(1-r)+t*r}ni.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=[],u=null;t.expectedType&&t.expectedType.kind!=="value"&&(u=t.expectedType);for(var c=1;c<e.length;c+=2){var h=c===1?-1/0:e[c],m=e[c+1],_=c,x=c+1;if(typeof h!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',_);if(a.length&&a[a.length-1][0]>=h)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',_);var w=t.parse(m,x,u);if(!w)return null;u=u||w.type,a.push([h,w])}return new ni(u,r,a)},ni.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;return a>=t[u-1]?r[u-1].evaluate(e):r[Ka(t,a)].evaluate(e)},ni.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},ni.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},ni.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Bo=Object.freeze({__proto__:null,number:hr,color:function(e,t,r){return new It(hr(e.r,t.r,r),hr(e.g,t.g,r),hr(e.b,t.b,r),hr(e.a,t.a,r))},array:function(e,t,r){return e.map(function(a,u){return hr(a,t[u],r)})}}),nu=6/29*3*(6/29),Uc=Math.PI/180,qc=180/Math.PI;function tl(e){return e>.008856451679035631?Math.pow(e,1/3):e/nu+4/29}function rl(e){return e>6/29?e*e*e:nu*(e-4/29)}function il(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nl(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ou(e){var t=nl(e.r),r=nl(e.g),a=nl(e.b),u=tl((.4124564*t+.3575761*r+.1804375*a)/.95047),c=tl((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(u-c),b:200*(c-tl((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function au(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*rl(t),r=.95047*rl(r),a=1.08883*rl(a),new It(il(3.2404542*r-1.5371385*t-.4985314*a),il(-.969266*r+1.8760108*t+.041556*a),il(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function jc(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var ha={forward:ou,reverse:au,interpolate:function(e,t,r){return{l:hr(e.l,t.l,r),a:hr(e.a,t.a,r),b:hr(e.b,t.b,r),alpha:hr(e.alpha,t.alpha,r)}}},fa={forward:function(e){var t=ou(e),r=t.l,a=t.a,u=t.b,c=Math.atan2(u,a)*qc;return{h:c<0?c+360:c,c:Math.sqrt(a*a+u*u),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Uc,r=e.c;return au({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:jc(e.h,t.h,r),c:hr(e.c,t.c,r),l:hr(e.l,t.l,r),alpha:hr(e.alpha,t.alpha,r)}}},su=Object.freeze({__proto__:null,lab:ha,hcl:fa}),Br=function(e,t,r,a,u){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,h=u;c<h.length;c+=1){var m=h[c],_=m[1];this.labels.push(m[0]),this.outputs.push(_)}};function ol(e,t,r,a){var u=a-r,c=e-r;return u===0?0:t===1?c/u:(Math.pow(t,c)-1)/(Math.pow(t,u)-1)}Br.interpolationFactor=function(e,t,r,a){var u=0;if(e.name==="exponential")u=ol(t,e.base,r,a);else if(e.name==="linear")u=ol(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;u=new Y(c[0],c[1],c[2],c[3]).solve(ol(t,1,r,a))}return u},Br.parse=function(e,t){var r=e[0],a=e[1],u=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var h=a[1];if(typeof h!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:h}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var m=a.slice(1);if(m.length!==4||m.some(function(K){return typeof K!="number"||K<0||K>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:m}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(u=t.parse(u,2,de)))return null;var _=[],x=null;r==="interpolate-hcl"||r==="interpolate-lab"?x=ke:t.expectedType&&t.expectedType.kind!=="value"&&(x=t.expectedType);for(var w=0;w<c.length;w+=2){var T=c[w],C=c[w+1],k=w+3,N=w+4;if(typeof T!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(_.length&&_[_.length-1][0]>=T)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);var U=t.parse(C,N,x);if(!U)return null;x=x||U.type,_.push([T,U])}return x.kind==="number"||x.kind==="color"||x.kind==="array"&&x.itemType.kind==="number"&&typeof x.N=="number"?new Br(x,r,a,u,_):t.error("Type "+gt(x)+" is not interpolatable.")},Br.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;if(a>=t[u-1])return r[u-1].evaluate(e);var c=Ka(t,a),h=Br.interpolationFactor(this.interpolation,a,t[c],t[c+1]),m=r[c].evaluate(e),_=r[c+1].evaluate(e);return this.operator==="interpolate"?Bo[this.type.kind.toLowerCase()](m,_,h):this.operator==="interpolate-hcl"?fa.reverse(fa.interpolate(fa.forward(m),fa.forward(_),h)):ha.reverse(ha.interpolate(ha.forward(m),ha.forward(_),h))},Br.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Br.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Br.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var wn=function(e,t){this.type=e,this.args=t};wn.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var u=[],c=0,h=e.slice(1);c<h.length;c+=1){var m=t.parse(h[c],1+u.length,r,void 0,{typeAnnotation:"omit"});if(!m)return null;r=r||m.type,u.push(m)}var _=a&&u.some(function(x){return Pt(a,x.type)});return new wn(_?ze:r,u)},wn.prototype.evaluate=function(e){for(var t,r=null,a=0,u=0,c=this.args;u<c.length&&(a++,(r=c[u].evaluate(e))&&r instanceof Jr&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);u+=1);return r},wn.prototype.eachChild=function(e){this.args.forEach(e)},wn.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},wn.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Sn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Sn.prototype.evaluate=function(e){return this.result.evaluate(e)},Sn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Sn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var u=e[a];if(typeof u!="string")return t.error("Expected string, but found "+typeof u+" instead.",a);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([u,c])}var h=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return h?new Sn(r,h):null},Sn.prototype.outputDefined=function(){return this.result.outputDefined()},Sn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var Yn=function(e,t,r){this.type=e,this.index=t,this.input=r};Yn.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,de),a=t.parse(e[2],2,Tt(t.expectedType||ze));return r&&a?new Yn(a.type.itemType,r,a):null},Yn.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Er("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new Er("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Er("Array index must be an integer, but found "+t+" instead.");return r[t]},Yn.prototype.eachChild=function(e){e(this.index),e(this.input)},Yn.prototype.outputDefined=function(){return!1},Yn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jn=function(e,t){this.type=Ce,this.needle=e,this.haystack=t};Jn.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);return r&&a?nr(r.type,[Ce,De,de,Oe,ze])?new Jn(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+gt(r.type)+" instead"):null},Jn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Bt(t,["boolean","string","number","null"]))throw new Er("Expected first argument to be of type boolean, string, number or null, but found "+gt(or(t))+" instead.");if(!Bt(r,["string","array"]))throw new Er("Expected second argument to be of type array or string, but found "+gt(or(r))+" instead.");return r.indexOf(t)>=0},Jn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Jn.prototype.outputDefined=function(){return!0},Jn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Tn=function(e,t,r){this.type=de,this.needle=e,this.haystack=t,this.fromIndex=r};Tn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);if(!r||!a)return null;if(!nr(r.type,[Ce,De,de,Oe,ze]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+gt(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Tn(r,a,u):null}return new Tn(r,a)},Tn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Bt(t,["boolean","string","number","null"]))throw new Er("Expected first argument to be of type boolean, string, number or null, but found "+gt(or(t))+" instead.");if(!Bt(r,["string","array"]))throw new Er("Expected second argument to be of type array or string, but found "+gt(or(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Tn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Tn.prototype.outputDefined=function(){return!1},Tn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Qn=function(e,t,r,a,u,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=u,this.otherwise=c};Qn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var u={},c=[],h=2;h<e.length-1;h+=2){var m=e[h],_=e[h+1];Array.isArray(m)||(m=[m]);var x=t.concat(h);if(m.length===0)return x.error("Expected at least one branch label.");for(var w=0,T=m;w<T.length;w+=1){var C=T[w];if(typeof C!="number"&&typeof C!="string")return x.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return x.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return x.error("Numeric branch labels must be integer values.");if(r){if(x.checkSubtype(r,or(C)))return null}else r=or(C);if(u[String(C)]!==void 0)return x.error("Branch labels must be unique.");u[String(C)]=c.length}var k=t.parse(_,h,a);if(!k)return null;a=a||k.type,c.push(k)}var N=t.parse(e[1],1,ze);if(!N)return null;var U=t.parse(e[e.length-1],e.length-1,a);return U?N.type.kind!=="value"&&t.concat(1).checkSubtype(r,N.type)?null:new Qn(r,a,N,u,c,U):null},Qn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(or(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Qn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Qn.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},Qn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},u=0,c=Object.keys(this.cases).sort();u<c.length;u+=1){var h=c[u];(T=a[this.cases[h]])===void 0?(a[this.cases[h]]=r.length,r.push([this.cases[h],[h]])):r[T][1].push(h)}for(var m=function(k){return e.inputType.kind==="number"?Number(k):k},_=0,x=r;_<x.length;_+=1){var w=x[_],T=w[0],C=w[1];t.push(C.length===1?m(C[0]):C.map(m)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var eo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};eo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],u=1;u<e.length-1;u+=2){var c=t.parse(e[u],u,Ce);if(!c)return null;var h=t.parse(e[u+1],u+1,r);if(!h)return null;a.push([c,h]),r=r||h.type}var m=t.parse(e[e.length-1],e.length-1,r);return m?new eo(r,a,m):null},eo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];if(a[0].evaluate(e))return u.evaluate(e)}return this.otherwise.evaluate(e)},eo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];e(a[0]),e(u)}e(this.otherwise)},eo.prototype.outputDefined=function(){return this.branches.every(function(e){return e[1].outputDefined()})&&this.otherwise.outputDefined()},eo.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var In=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function lu(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function uu(e,t,r,a){return a.compare(t,r)===0}function Ot(e,t,r){var a=e!=="=="&&e!=="!=";return function(){function u(c,h,m){this.type=Ce,this.lhs=c,this.rhs=h,this.collator=m,this.hasUntypedArgument=c.type.kind==="value"||h.type.kind==="value"}return u.parse=function(c,h){if(c.length!==3&&c.length!==4)return h.error("Expected two or three arguments.");var m=c[0],_=h.parse(c[1],1,ze);if(!_)return null;if(!lu(m,_.type))return h.concat(1).error('"'+m+`" comparisons are not supported for type '`+gt(_.type)+"'.");var x=h.parse(c[2],2,ze);if(!x)return null;if(!lu(m,x.type))return h.concat(2).error('"'+m+`" comparisons are not supported for type '`+gt(x.type)+"'.");if(_.type.kind!==x.type.kind&&_.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot compare types '"+gt(_.type)+"' and '"+gt(x.type)+"'.");a&&(_.type.kind==="value"&&x.type.kind!=="value"?_=new Zt(x.type,[_]):_.type.kind!=="value"&&x.type.kind==="value"&&(x=new Zt(_.type,[x])));var w=null;if(c.length===4){if(_.type.kind!=="string"&&x.type.kind!=="string"&&_.type.kind!=="value"&&x.type.kind!=="value")return h.error("Cannot use collator to compare non-string types.");if(!(w=h.parse(c[3],3,yt)))return null}return new u(_,x,w)},u.prototype.evaluate=function(c){var h=this.lhs.evaluate(c),m=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var _=or(h),x=or(m);if(_.kind!==x.kind||_.kind!=="string"&&_.kind!=="number")throw new Er('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+_.kind+", "+x.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var w=or(h),T=or(m);if(w.kind!=="string"||T.kind!=="string")return t(c,h,m)}return this.collator?r(c,h,m,this.collator.evaluate(c)):t(c,h,m)},u.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},u.prototype.outputDefined=function(){return!0},u.prototype.serialize=function(){var c=[e];return this.eachChild(function(h){c.push(h.serialize())}),c},u}()}In.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,de);if(!r||!a)return null;if(!nr(r.type,[Tt(ze),De,ze]))return t.error("Expected first argument to be of type array or string, but found "+gt(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new In(r.type,r,a,u):null}return new In(r.type,r,a)},In.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Bt(t,["string","array"]))throw new Er("Expected first argument to be of type array or string, but found "+gt(or(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},In.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var $c=Ot("==",function(e,t,r){return t===r},uu),Ya=Ot("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!uu(0,t,r,a)}),cu=Ot("<",function(e,t,r){return t<r},function(e,t,r,a){return a.compare(t,r)<0}),pu=Ot(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),hu=Ot("<=",function(e,t,r){return t<=r},function(e,t,r,a){return a.compare(t,r)<=0}),fu=Ot(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0}),to=function(e,t,r,a,u){this.type=De,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=u};to.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var u=null;if(a.locale&&!(u=t.parse(a.locale,1,De)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,De)))return null;var h=null;if(a["min-fraction-digits"]&&!(h=t.parse(a["min-fraction-digits"],1,de)))return null;var m=null;return a["max-fraction-digits"]&&!(m=t.parse(a["max-fraction-digits"],1,de))?null:new to(r,u,c,h,m)},to.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},to.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},to.prototype.outputDefined=function(){return!1},to.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var En=function(e){this.type=de,this.input=e};En.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+gt(r.type)+" instead."):new En(r):null},En.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new Er("Expected value to be of type string or array, but found "+gt(or(t))+" instead.")},En.prototype.eachChild=function(e){e(this.input)},En.prototype.outputDefined=function(){return!1},En.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var ro={"==":$c,"!=":Ya,">":pu,"<":cu,">=":fu,"<=":hu,array:Zt,at:Yn,boolean:Zt,case:eo,coalesce:wn,collator:Xi,format:Oi,image:fi,in:Jn,"index-of":Tn,interpolate:Br,"interpolate-hcl":Br,"interpolate-lab":Br,length:En,let:Sn,literal:Ur,match:Qn,number:Zt,"number-format":to,object:Zt,slice:In,step:ni,string:Zt,"to-boolean":Ii,"to-color":Ii,"to-number":Ii,"to-string":Ii,var:xn,within:Ei};function du(e,t){var r=t[0],a=t[1],u=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),u=u.evaluate(e);var h=c?c.evaluate(e):1,m=Js(r,a,u,h);if(m)throw new Er(m);return new It(r/255*h,a/255*h,u/255*h,h)}function mu(e,t){return e in t}function al(e,t){var r=t[e];return r===void 0?null:r}function io(e){return{type:e}}function yu(e){return{result:"success",value:e}}function no(e){return{result:"error",value:e}}function oo(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function vu(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function da(e){return!!e.expression&&e.expression.interpolated}function Ut(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function Ja(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Zc(e){return e}function Do(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function gu(e,t,r,a,u){return Do(typeof r===u?a[r]:void 0,e.default,t.default)}function Gc(e,t,r){if(Ut(r)!=="number")return Do(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var u=Ka(e.stops.map(function(c){return c[0]}),r);return e.stops[u][1]}function _u(e,t,r){var a=e.base!==void 0?e.base:1;if(Ut(r)!=="number")return Do(e.default,t.default);var u=e.stops.length;if(u===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];var c=Ka(e.stops.map(function(T){return T[0]}),r),h=function(T,C,k,N){var U=N-k,K=T-k;return U===0?0:C===1?K/U:(Math.pow(C,K)-1)/(Math.pow(C,U)-1)}(r,a,e.stops[c][0],e.stops[c+1][0]),m=e.stops[c][1],_=e.stops[c+1][1],x=Bo[t.type]||Zc;if(e.colorSpace&&e.colorSpace!=="rgb"){var w=su[e.colorSpace];x=function(T,C){return w.reverse(w.interpolate(w.forward(T),w.forward(C),h))}}return typeof m.evaluate=="function"?{evaluate:function(){for(var T=[],C=arguments.length;C--;)T[C]=arguments[C];var k=m.evaluate.apply(void 0,T),N=_.evaluate.apply(void 0,T);if(k!==void 0&&N!==void 0)return x(k,N,h)}}:x(m,_,h)}function Qa(e,t,r){return t.type==="color"?r=It.parse(r):t.type==="formatted"?r=Ir.fromString(r.toString()):t.type==="resolvedImage"?r=Jr.fromString(r.toString()):Ut(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),Do(r,e.default,t.default)}zr.register(ro,{error:[{kind:"error"},[De],function(e,t){throw new Er(t[0].evaluate(e))}],typeof:[De,[ze],function(e,t){return gt(or(t[0].evaluate(e)))}],"to-rgba":[Tt(de,4),[ke],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[ke,[de,de,de],du],rgba:[ke,[de,de,de,de],du],has:{type:Ce,overloads:[[[De],function(e,t){return mu(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return mu(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:ze,overloads:[[[De],function(e,t){return al(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return al(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[ze,[De],function(e,t){return al(t[0].evaluate(e),e.featureState||{})}],properties:[ut,[],function(e){return e.properties()}],"geometry-type":[De,[],function(e){return e.geometryType()}],id:[ze,[],function(e){return e.id()}],zoom:[de,[],function(e){return e.globals.zoom}],"heatmap-density":[de,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[de,[],function(e){return e.globals.lineProgress||0}],accumulated:[ze,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[de,io(de),function(e,t){for(var r=0,a=0,u=t;a<u.length;a+=1)r+=u[a].evaluate(e);return r}],"*":[de,io(de),function(e,t){for(var r=1,a=0,u=t;a<u.length;a+=1)r*=u[a].evaluate(e);return r}],"-":{type:de,overloads:[[[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[de],function(e,t){return-t[0].evaluate(e)}]]},"/":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[de,[],function(){return Math.LN2}],pi:[de,[],function(){return Math.PI}],e:[de,[],function(){return Math.E}],"^":[de,[de,de],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[de,[de],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[de,[de],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[de,[de],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[de,[de],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[de,[de],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[de,[de],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[de,[de],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[de,io(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,io(de),function(e,t){return Math.max.apply(Math,t.map(function(r){return r.evaluate(e)}))}],abs:[de,[de],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[de,[de],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[de,[de],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[de,[de],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[Ce,[De,ze],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Ce,[ze],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Ce,[De],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Ce,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<c}],"filter-id-<":[Ce,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<u}],"filter->":[Ce,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>c}],"filter-id->":[Ce,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>u}],"filter-<=":[Ce,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<=c}],"filter-id-<=":[Ce,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<=u}],"filter->=":[Ce,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>=c}],"filter-id->=":[Ce,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>=u}],"filter-has":[Ce,[ze],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ce,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Ce,[Tt(De)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ce,[Tt(ze)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ce,[De,Tt(ze)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ce,[De,Tt(ze)],function(e,t){var r=t[0],a=t[1];return function(u,c,h,m){for(;h<=m;){var _=h+m>>1;if(c[_]===u)return!0;c[_]>u?m=_-1:h=_+1}return!1}(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Ce,overloads:[[[Ce,Ce],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[io(Ce),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:Ce,overloads:[[[Ce,Ce],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[io(Ce),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Ce,[Ce],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Ce,[De],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[De,[De],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[De,[De],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[De,io(ze),function(e,t){return t.map(function(r){return ca(r.evaluate(e))}).join("")}],"resolved-locale":[De,[yt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Lo=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new an,this._defaultValue=t?function(r){return r.type==="color"&&Ja(r.default)?new It(0,0,0,0):r.type==="color"?It.parse(r.default)||null:r.default===void 0?null:r.default}(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function ma(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in ro}function es(e,t){var r=new bn(ro,[],t?function(u){var c={color:ke,string:De,number:de,enum:De,boolean:Ce,formatted:Ft,resolvedImage:pt};return u.type==="array"?Tt(c[u.value]||ze,u.length):c[u.type]}(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?yu(new Lo(a,t)):no(r.errors)}Lo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},Lo.prototype.evaluate=function(e,t,r,a,u,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c||null;try{var h=this.expression.evaluate(this._evaluator);if(h==null||typeof h=="number"&&h!=h)return this._defaultValue;if(this._enumValues&&!(h in this._enumValues))throw new Er("Expected value to be one of "+Object.keys(this._enumValues).map(function(m){return JSON.stringify(m)}).join(", ")+", but found "+JSON.stringify(h)+" instead.");return h}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}};var ya=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!_n(t.expression)};ya.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},ya.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)};var Ro=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!_n(t.expression),this.interpolationType=a};function xu(e,t){if((e=es(e,t)).result==="error")return e;var r=e.value.expression,a=gn(r);if(!a&&!oo(t))return no([new be("","data expressions not supported")]);var u=Kn(r,["zoom"]);if(!u&&!vu(t))return no([new be("","zoom expressions not supported")]);var c=function h(m){var _=null;if(m instanceof Sn)_=h(m.result);else if(m instanceof wn)for(var x=0,w=m.args;x<w.length&&!(_=h(w[x]));x+=1);else(m instanceof ni||m instanceof Br)&&m.input instanceof zr&&m.input.name==="zoom"&&(_=m);return _ instanceof be||m.eachChild(function(T){var C=h(T);C instanceof be?_=C:!_&&C?_=new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):_&&C&&_!==C&&(_=new be("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),_}(r);return c||u?c instanceof be?no([c]):c instanceof Br&&!da(t)?no([new be("",'"interpolate" expressions cannot be used with this property')]):yu(c?new Ro(a?"camera":"composite",e.value,c.labels,c instanceof Br?c.interpolation:void 0):new ya(a?"constant":"source",e.value)):no([new be("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Ro.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},Ro.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)},Ro.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Br.interpolationFactor(this.interpolationType,e,t,r):0};var Fo=function(e,t){this._parameters=e,this._specification=t,xe(this,function r(a,u){var c,h,m,_=u.type==="color",x=a.stops&&typeof a.stops[0][0]=="object",w=x||!(x||a.property!==void 0),T=a.type||(da(u)?"exponential":"interval");if(_&&((a=xe({},a)).stops&&(a.stops=a.stops.map(function(Me){return[Me[0],It.parse(Me[1])]})),a.default=It.parse(a.default?a.default:u.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!su[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(T==="exponential")c=_u;else if(T==="interval")c=Gc;else if(T==="categorical"){c=gu,h=Object.create(null);for(var C=0,k=a.stops;C<k.length;C+=1){var N=k[C];h[N[0]]=N[1]}m=typeof a.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=Qa}if(x){for(var U={},K=[],W=0;W<a.stops.length;W++){var te=a.stops[W],ne=te[0].zoom;U[ne]===void 0&&(U[ne]={zoom:ne,type:a.type,property:a.property,default:a.default,stops:[]},K.push(ne)),U[ne].stops.push([te[0].value,te[1]])}for(var se=[],ce=0,ve=K;ce<ve.length;ce+=1){var Se=ve[ce];se.push([U[Se].zoom,r(U[Se],u)])}var Ae={name:"linear"};return{kind:"composite",interpolationType:Ae,interpolationFactor:Br.interpolationFactor.bind(void 0,Ae),zoomStops:se.map(function(Me){return Me[0]}),evaluate:function(Me,We){var Be=Me.zoom;return _u({stops:se,base:a.base},u,Be).evaluate(Be,We)}}}if(w){var $e=T==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:$e,interpolationFactor:Br.interpolationFactor.bind(void 0,$e),zoomStops:a.stops.map(function(Me){return Me[0]}),evaluate:function(Me){return c(a,u,Me.zoom,h,m)}}}return{kind:"source",evaluate:function(Me,We){var Be=We&&We.properties?We.properties[a.property]:void 0;return Be===void 0?Do(a.default,u.default):c(a,u,Be,h,m)}}}(this._parameters,this._specification))};function Vi(e){var t=e.key,r=e.value,a=e.valueSpec||{},u=e.objectElementValidators||{},c=e.style,h=e.styleSpec,m=[],_=Ut(r);if(_!=="object")return[new G(t,r,"object expected, "+_+" found")];for(var x in r){var w=x.split(".")[0],T=a[w]||a["*"],C=void 0;if(u[w])C=u[w];else if(a[w])C=vt;else if(u["*"])C=u["*"];else{if(!a["*"]){m.push(new G(t,r[x],'unknown property "'+x+'"'));continue}C=vt}m=m.concat(C({key:(t&&t+".")+x,value:r[x],valueSpec:T,style:c,styleSpec:h,object:r,objectKey:x},r))}for(var k in a)u[k]||a[k].required&&a[k].default===void 0&&r[k]===void 0&&m.push(new G(t,r,'missing required property "'+k+'"'));return m}function bu(e){var t=e.value,r=e.valueSpec,a=e.style,u=e.styleSpec,c=e.key,h=e.arrayElementValidator||vt;if(Ut(t)!=="array")return[new G(c,t,"array expected, "+Ut(t)+" found")];if(r.length&&t.length!==r.length)return[new G(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new G(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var m={type:r.value,values:r.values};u.$version<7&&(m.function=r.function),Ut(r.value)==="object"&&(m=r.value);for(var _=[],x=0;x<t.length;x++)_=_.concat(h({array:t,arrayIndex:x,value:t[x],valueSpec:m,style:a,styleSpec:u,key:c+"["+x+"]"}));return _}function wu(e){var t=e.key,r=e.value,a=e.valueSpec,u=Ut(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new G(t,r,"number expected, "+u+" found")]:"minimum"in a&&r<a.minimum?[new G(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new G(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function Su(e){var t,r,a,u=e.valueSpec,c=we(e.value.type),h={},m=c!=="categorical"&&e.value.property===void 0,_=!m,x=Ut(e.value.stops)==="array"&&Ut(e.value.stops[0])==="array"&&Ut(e.value.stops[0][0])==="object",w=Vi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(k){if(c==="identity")return[new G(k.key,k.value,'identity function may not have a "stops" property')];var N=[],U=k.value;return N=N.concat(bu({key:k.key,value:U,valueSpec:k.valueSpec,style:k.style,styleSpec:k.styleSpec,arrayElementValidator:T})),Ut(U)==="array"&&U.length===0&&N.push(new G(k.key,U,"array must have at least one stop")),N},default:function(k){return vt({key:k.key,value:k.value,valueSpec:u,style:k.style,styleSpec:k.styleSpec})}}});return c==="identity"&&m&&w.push(new G(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||w.push(new G(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!da(e.valueSpec)&&w.push(new G(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(_&&!oo(e.valueSpec)?w.push(new G(e.key,e.value,"property functions not supported")):m&&!vu(e.valueSpec)&&w.push(new G(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!x||e.value.property!==void 0||w.push(new G(e.key,e.value,'"property" property is required')),w;function T(k){var N=[],U=k.value,K=k.key;if(Ut(U)!=="array")return[new G(K,U,"array expected, "+Ut(U)+" found")];if(U.length!==2)return[new G(K,U,"array length 2 expected, length "+U.length+" found")];if(x){if(Ut(U[0])!=="object")return[new G(K,U,"object expected, "+Ut(U[0])+" found")];if(U[0].zoom===void 0)return[new G(K,U,"object stop key must have zoom")];if(U[0].value===void 0)return[new G(K,U,"object stop key must have value")];if(a&&a>we(U[0].zoom))return[new G(K,U[0].zoom,"stop zoom values must appear in ascending order")];we(U[0].zoom)!==a&&(a=we(U[0].zoom),r=void 0,h={}),N=N.concat(Vi({key:K+"[0]",value:U[0],valueSpec:{zoom:{}},style:k.style,styleSpec:k.styleSpec,objectElementValidators:{zoom:wu,value:C}}))}else N=N.concat(C({key:K+"[0]",value:U[0],valueSpec:{},style:k.style,styleSpec:k.styleSpec},U));return ma(fe(U[1]))?N.concat([new G(K+"[1]",U[1],"expressions are not allowed in function stops.")]):N.concat(vt({key:K+"[1]",value:U[1],valueSpec:u,style:k.style,styleSpec:k.styleSpec}))}function C(k,N){var U=Ut(k.value),K=we(k.value),W=k.value!==null?k.value:N;if(t){if(U!==t)return[new G(k.key,W,U+" stop domain type must match previous stop domain type "+t)]}else t=U;if(U!=="number"&&U!=="string"&&U!=="boolean")return[new G(k.key,W,"stop domain value must be a number, string, or boolean")];if(U!=="number"&&c!=="categorical"){var te="number expected, "+U+" found";return oo(u)&&c===void 0&&(te+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new G(k.key,W,te)]}return c!=="categorical"||U!=="number"||isFinite(K)&&Math.floor(K)===K?c!=="categorical"&&U==="number"&&r!==void 0&&K<r?[new G(k.key,W,"stop domain values must appear in ascending order")]:(r=K,c==="categorical"&&K in h?[new G(k.key,W,"stop domain values must be unique")]:(h[K]=!0,[])):[new G(k.key,W,"integer expected, found "+K)]}}function ao(e){var t=(e.expressionContext==="property"?xu:es)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(a){return new G(""+e.key+a.key,e.value,a.message)});var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new G(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!_n(r))return[new G(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!_n(r))return[new G(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!Kn(r,["zoom","feature-state"]))return[new G(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!gn(r))return[new G(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function va(e){var t=e.key,r=e.value,a=e.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf(we(r))===-1&&u.push(new G(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(we(r))===-1&&u.push(new G(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),u}function ts(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!ts(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Fo.deserialize=function(e){return new Fo(e._parameters,e._specification)},Fo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var sl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function rs(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};ts(e)||(e=is(e));var t=es(e,sl);if(t.result==="error")throw new Error(t.value.map(function(r){return r.key+": "+r.message}).join(", "));return{filter:function(r,a,u){return t.value.evaluate(r,a,{},u)},needGeometry:function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var u=1;u<a.length;u++)if(r(a[u]))return!0;return!1}(e)}}function Wc(e,t){return e<t?-1:e>t?1:0}function is(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?ll(e[1],e[2],"=="):r==="!="?ns(ll(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?ll(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(is))):r==="all"?["all"].concat(e.slice(1).map(is)):r==="none"?["all"].concat(e.slice(1).map(is).map(ns)):r==="in"?Tu(e[1],e.slice(2)):r==="!in"?ns(Tu(e[1],e.slice(2))):r==="has"?Iu(e[1]):r==="!has"?ns(Iu(e[1])):r!=="within"||e}function ll(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Tu(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(r){return typeof r!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(Wc)]]:["filter-in-small",e,["literal",t]]}}function Iu(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function ns(e){return["!",e]}function ul(e){return ts(fe(e.value))?ao(xe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var a=r.value,u=r.key;if(Ut(a)!=="array")return[new G(u,a,"array expected, "+Ut(a)+" found")];var c,h=r.styleSpec,m=[];if(a.length<1)return[new G(u,a,"filter array must have at least 1 element")];switch(m=m.concat(va({key:u+"[0]",value:a[0],valueSpec:h.filter_operator,style:r.style,styleSpec:r.styleSpec})),we(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&we(a[1])==="$type"&&m.push(new G(u,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&m.push(new G(u,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=Ut(a[1]))!=="string"&&m.push(new G(u+"[1]",a[1],"string expected, "+c+" found"));for(var _=2;_<a.length;_++)c=Ut(a[_]),we(a[1])==="$type"?m=m.concat(va({key:u+"["+_+"]",value:a[_],valueSpec:h.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&m.push(new G(u+"["+_+"]",a[_],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var x=1;x<a.length;x++)m=m.concat(t({key:u+"["+x+"]",value:a[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=Ut(a[1]),a.length!==2?m.push(new G(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&m.push(new G(u+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=Ut(a[1]),a.length!==2?m.push(new G(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&m.push(new G(u+"[1]",a[1],"object expected, "+c+" found"))}return m}(e)}function cl(e,t){var r=e.key,a=e.style,u=e.styleSpec,c=e.value,h=e.objectKey,m=u[t+"_"+e.layerType];if(!m)return[];var _=h.match(/^(.*)-transition$/);if(t==="paint"&&_&&m[_[1]]&&m[_[1]].transition)return vt({key:r,value:c,valueSpec:u.transition,style:a,styleSpec:u});var x,w=e.valueSpec||m[h];if(!w)return[new G(r,c,'unknown property "'+h+'"')];if(Ut(c)==="string"&&oo(w)&&!w.tokens&&(x=/^{([^}]+)}$/.exec(c)))return[new G(r,c,'"'+h+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(x[1])+" }`.")];var T=[];return e.layerType==="symbol"&&(h==="text-field"&&a&&!a.glyphs&&T.push(new G(r,c,'use of "text-field" requires a style "glyphs" property')),h==="text-font"&&Ja(fe(c))&&we(c.type)==="identity"&&T.push(new G(r,c,'"text-font" does not support identity functions'))),T.concat(vt({key:e.key,value:c,valueSpec:w,style:a,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:h}))}function pl(e){return cl(e,"paint")}function ga(e){return cl(e,"layout")}function Eu(e){var t=[],r=e.value,a=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new G(a,r,'either "type" or "ref" is required'));var h,m=we(r.type),_=we(r.ref);if(r.id)for(var x=we(r.id),w=0;w<e.arrayIndex;w++){var T=u.layers[w];we(T.id)===x&&t.push(new G(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+T.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(N){N in r&&t.push(new G(a,r[N],'"'+N+'" is prohibited for ref layers'))}),u.layers.forEach(function(N){we(N.id)===_&&(h=N)}),h?h.ref?t.push(new G(a,r.ref,"ref cannot reference another ref layer")):m=we(h.type):t.push(new G(a,r.ref,'ref layer "'+_+'" not found'));else if(m!=="background")if(r.source){var C=u.sources&&u.sources[r.source],k=C&&we(C.type);C?k==="vector"&&m==="raster"?t.push(new G(a,r.source,'layer "'+r.id+'" requires a raster source')):k==="raster"&&m!=="raster"?t.push(new G(a,r.source,'layer "'+r.id+'" requires a vector source')):k!=="vector"||r["source-layer"]?k==="raster-dem"&&m!=="hillshade"?t.push(new G(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):m!=="line"||!r.paint||!r.paint["line-gradient"]||k==="geojson"&&C.lineMetrics||t.push(new G(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new G(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new G(a,r.source,'source "'+r.source+'" not found'))}else t.push(new G(a,r,'missing required property "source"'));return t=t.concat(Vi({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return vt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:ul,layout:function(N){return Vi({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function(U){return ga(xe({layerType:m},U))}}})},paint:function(N){return Vi({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function(U){return pl(xe({layerType:m},U))}}})}}}))}function so(e){var t=e.value,r=e.key,a=Ut(t);return a!=="string"?[new G(r,t,"string expected, "+a+" found")]:[]}var Gt={promoteId:function(e){var t=e.key,r=e.value;if(Ut(r)==="string")return so({key:t,value:r});var a=[];for(var u in r)a.push.apply(a,so({key:t+"."+u,value:r[u]}));return a}};function os(e){var t=e.value,r=e.key,a=e.styleSpec,u=e.style;if(!t.type)return[new G(r,t,'"type" is required')];var c,h=we(t.type);switch(h){case"vector":case"raster":case"raster-dem":return Vi({key:r,value:t,valueSpec:a["source_"+h.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Gt});case"geojson":if(c=Vi({key:r,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Gt}),t.cluster)for(var m in t.clusterProperties){var _=t.clusterProperties[m],x=_[0],w=typeof x=="string"?[x,["accumulated"],["get",m]]:x;c.push.apply(c,ao({key:r+"."+m+".map",value:_[1],expressionContext:"cluster-map"})),c.push.apply(c,ao({key:r+"."+m+".reduce",value:w,expressionContext:"cluster-reduce"}))}return c;case"video":return Vi({key:r,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return Vi({key:r,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new G(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return va({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:u,styleSpec:a})}}function lo(e){var t=e.value,r=e.styleSpec,a=r.light,u=e.style,c=[],h=Ut(t);if(t===void 0)return c;if(h!=="object")return c.concat([new G("light",t,"object expected, "+h+" found")]);for(var m in t){var _=m.match(/^(.*)-transition$/);c=c.concat(_&&a[_[1]]&&a[_[1]].transition?vt({key:m,value:t[m],valueSpec:r.transition,style:u,styleSpec:r}):a[m]?vt({key:m,value:t[m],valueSpec:a[m],style:u,styleSpec:r}):[new G(m,t[m],'unknown property "'+m+'"')])}return c}var An={"*":function(){return[]},array:bu,boolean:function(e){var t=e.value,r=e.key,a=Ut(t);return a!=="boolean"?[new G(r,t,"boolean expected, "+a+" found")]:[]},number:wu,color:function(e){var t=e.key,r=e.value,a=Ut(r);return a!=="string"?[new G(t,r,"color expected, "+a+" found")]:dt(r)===null?[new G(t,r,'color expected, "'+r+'" found')]:[]},constants:ie,enum:va,filter:ul,function:Su,layer:Eu,object:Vi,source:os,light:lo,string:so,formatted:function(e){return so(e).length===0?[]:ao(e)},resolvedImage:function(e){return so(e).length===0?[]:ao(e)}};function vt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&Ja(we(t))?Su(e):r.expression&&ma(fe(t))?ao(e):r.type&&An[r.type]?An[r.type](e):Vi(xe({},e,{valueSpec:r.type?a[r.type]:r}))}function qt(e){var t=e.value,r=e.key,a=so(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new G(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new G(r,t,'"glyphs" url must include a "{range}" token'))),a}function di(e,t){t===void 0&&(t=B);var r=[];return r=r.concat(vt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:qt,"*":function(){return[]}}})),e.constants&&(r=r.concat(ie({key:"constants",value:e.constants,style:e,styleSpec:t}))),_a(r)}function _a(e){return[].concat(e).sort(function(t,r){return t.line-r.line})}function Oo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return _a(e.apply(this,t))}}di.source=Oo(os),di.light=Oo(lo),di.layer=Oo(Eu),di.filter=Oo(ul),di.paintProperty=Oo(pl),di.layoutProperty=Oo(ga);var xa=di,Xc=xa.light,Hc=xa.paintProperty,ba=xa.layoutProperty;function wa(e,t){var r=!1;if(t&&t.length)for(var a=0,u=t;a<u.length;a+=1)e.fire(new J(new Error(u[a].message))),r=!0;return r}var sn=mr;function mr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var u=new Int32Array(this.arrayBuffer);e=u[0],this.d=(t=u[1])+2*(r=u[2]);for(var c=0;c<this.d*this.d;c++){var h=u[3+c],m=u[3+c+1];a.push(h===m?null:u.subarray(h,m))}var _=u[3+a.length+1];this.keys=u.subarray(u[3+a.length],_),this.bboxes=u.subarray(_),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var x=0;x<this.d*this.d;x++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var w=r/t*e;this.min=-w,this.max=e+w}mr.prototype.insert=function(e,t,r,a,u){this._forEachCell(t,r,a,u,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(u)},mr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},mr.prototype._insertCell=function(e,t,r,a,u,c){this.cells[u].push(c)},mr.prototype.query=function(e,t,r,a,u){var c=this.min,h=this.max;if(e<=c&&t<=c&&h<=r&&h<=a&&!u)return Array.prototype.slice.call(this.keys);var m=[];return this._forEachCell(e,t,r,a,this._queryCell,m,{},u),m},mr.prototype._queryCell=function(e,t,r,a,u,c,h,m){var _=this.cells[u];if(_!==null)for(var x=this.keys,w=this.bboxes,T=0;T<_.length;T++){var C=_[T];if(h[C]===void 0){var k=4*C;(m?m(w[k+0],w[k+1],w[k+2],w[k+3]):e<=w[k+2]&&t<=w[k+3]&&r>=w[k+0]&&a>=w[k+1])?(h[C]=!0,c.push(x[C])):h[C]=!1}}},mr.prototype._forEachCell=function(e,t,r,a,u,c,h,m){for(var _=this._convertToCellCoord(e),x=this._convertToCellCoord(t),w=this._convertToCellCoord(r),T=this._convertToCellCoord(a),C=_;C<=w;C++)for(var k=x;k<=T;k++){var N=this.d*k+C;if((!m||m(this._convertFromCellCoord(C),this._convertFromCellCoord(k),this._convertFromCellCoord(C+1),this._convertFromCellCoord(k+1)))&&u.call(this,e,t,r,a,N,c,h,m))return}},mr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},mr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},mr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var u=new Int32Array(t+r+this.keys.length+this.bboxes.length);u[0]=this.extent,u[1]=this.n,u[2]=this.padding;for(var c=t,h=0;h<e.length;h++){var m=e[h];u[3+h]=c,u.set(m,c),c+=m.length}return u[3+e.length]=c,u.set(this.keys,c),u[3+e.length+1]=c+=this.keys.length,u.set(this.bboxes,c),c+=this.bboxes.length,u.buffer};var Sa=le.ImageData,Au=le.ImageBitmap,fr={};function Ve(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),fr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var oi in Ve("Object",Object),sn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},sn.deserialize=function(e){return new sn(e.buffer)},Ve("Grid",sn),Ve("Color",It),Ve("Error",Error),Ve("ResolvedImage",Jr),Ve("StylePropertyFunction",Fo),Ve("StyleExpression",Lo,{omit:["_evaluator"]}),Ve("ZoomDependentExpression",Ro),Ve("ZoomConstantExpression",ya),Ve("CompoundExpression",zr,{omit:["_evaluate"]}),ro)ro[oi]._classRegistryKey||Ve("Expression_"+oi,ro[oi]);function as(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Vo(e){return Au&&e instanceof Au}function Ni(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(as(e)||Vo(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof Sa)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],u=0,c=e;u<c.length;u+=1)a.push(Ni(c[u],t));return a}if(typeof e=="object"){var h=e.constructor,m=h._classRegistryKey;if(!m)throw new Error("can't serialize object of unregistered class");var _=h.serialize?h.serialize(e,t):{};if(!h.serialize){for(var x in e)if(e.hasOwnProperty(x)&&!(fr[m].omit.indexOf(x)>=0)){var w=e[x];_[x]=fr[m].shallow.indexOf(x)>=0?w:Ni(w,t)}e instanceof Error&&(_.message=e.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(_.$name=m),_}throw new Error("can't serialize object of type "+typeof e)}function ai(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||as(e)||Vo(e)||ArrayBuffer.isView(e)||e instanceof Sa)return e;if(Array.isArray(e))return e.map(ai);if(typeof e=="object"){var t=e.$name||"Object",r=fr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),u=0,c=Object.keys(e);u<c.length;u+=1){var h=c[u];if(h!=="$name"){var m=e[h];a[h]=fr[t].shallow.indexOf(h)>=0?m:ai(m)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var hl=function(){this.first=!0};hl.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Pe={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function fl(e){for(var t=0,r=e;t<r.length;t+=1)if(ss(r[t].charCodeAt(0)))return!0;return!1}function ss(e){return!(e!==746&&e!==747&&(e<4352||!(Pe["Bopomofo Extended"](e)||Pe.Bopomofo(e)||Pe["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Pe["CJK Compatibility Ideographs"](e)||Pe["CJK Compatibility"](e)||Pe["CJK Radicals Supplement"](e)||Pe["CJK Strokes"](e)||!(!Pe["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Pe["CJK Unified Ideographs Extension A"](e)||Pe["CJK Unified Ideographs"](e)||Pe["Enclosed CJK Letters and Months"](e)||Pe["Hangul Compatibility Jamo"](e)||Pe["Hangul Jamo Extended-A"](e)||Pe["Hangul Jamo Extended-B"](e)||Pe["Hangul Jamo"](e)||Pe["Hangul Syllables"](e)||Pe.Hiragana(e)||Pe["Ideographic Description Characters"](e)||Pe.Kanbun(e)||Pe["Kangxi Radicals"](e)||Pe["Katakana Phonetic Extensions"](e)||Pe.Katakana(e)&&e!==12540||!(!Pe["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Pe["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Pe["Unified Canadian Aboriginal Syllabics"](e)||Pe["Unified Canadian Aboriginal Syllabics Extended"](e)||Pe["Vertical Forms"](e)||Pe["Yijing Hexagram Symbols"](e)||Pe["Yi Syllables"](e)||Pe["Yi Radicals"](e))))}function dl(e){return!(ss(e)||function(t){return!!(Pe["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Pe["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Pe["Letterlike Symbols"](t)||Pe["Number Forms"](t)||Pe["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Pe["Control Pictures"](t)&&t!==9251||Pe["Optical Character Recognition"](t)||Pe["Enclosed Alphanumerics"](t)||Pe["Geometric Shapes"](t)||Pe["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Pe["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Pe["CJK Symbols and Punctuation"](t)||Pe.Katakana(t)||Pe["Private Use Area"](t)||Pe["CJK Compatibility Forms"](t)||Pe["Small Form Variants"](t)||Pe["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(e))}function Ai(e){return e>=1424&&e<=2303||Pe["Arabic Presentation Forms-A"](e)||Pe["Arabic Presentation Forms-B"](e)}function si(e,t){return!(!t&&Ai(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Pe.Khmer(e))}function ls(e){for(var t=0,r=e;t<r.length;t+=1)if(Ai(r[t].charCodeAt(0)))return!0;return!1}var us=null,li="unavailable",ln=null,Cu=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(li="error"),us&&us(e)};function Ta(){ml.fire(new j("pluginStateChange",{pluginStatus:li,pluginURL:ln}))}var ml=new ee,yl=function(){return li},Ui=function(){if(li!=="deferred"||!ln)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");li="loading",Ta(),ln&&sa({url:ln},function(e){e?Cu(e):(li="loaded",Ta())})},mi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return li==="loaded"||mi.applyArabicShaping!=null},isLoading:function(){return li==="loading"},setState:function(e){li=e.pluginStatus,ln=e.pluginURL},isParsed:function(){return mi.applyArabicShaping!=null&&mi.processBidirectionalText!=null&&mi.processStyledBidirectionalText!=null},getPluginURL:function(){return ln}},ht=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new hl,this.transition={})};ht.prototype.isSupportedScript=function(e){return function(t,r){for(var a=0,u=t;a<u.length;a+=1)if(!si(u[a].charCodeAt(0),r))return!1;return!0}(e,mi.isLoaded())},ht.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ht.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Hi=function(e,t){this.property=e,this.value=t,this.expression=function(r,a){if(Ja(r))return new Fo(r,a);if(ma(r)){var u=xu(r,a);if(u.result==="error")throw new Error(u.value.map(function(h){return h.key+": "+h.message}).join(", "));return u.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=It.parse(r)),{kind:"constant",evaluate:function(){return c}}}(t===void 0?e.specification.default:t,e.specification)};Hi.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Hi.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Ci=function(e){this.property=e,this.value=new Hi(e,void 0)};Ci.prototype.transitioned=function(e,t){return new uo(this.property,this.value,t,Ye({},e.transition,this.transition),e.now)},Ci.prototype.untransitioned=function(){return new uo(this.property,this.value,null,{},0)};var Dr=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Dr.prototype.getValue=function(e){return _r(this._values[e].value.value)},Dr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ci(this._values[e].property)),this._values[e].value=new Hi(this._values[e].property,t===null?void 0:_r(t))},Dr.prototype.getTransition=function(e){return _r(this._values[e].transition)},Dr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ci(this._values[e].property)),this._values[e].transition=_r(t)||void 0},Dr.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},Dr.prototype.transitioned=function(e,t){for(var r=new Cn(this._properties),a=0,u=Object.keys(this._values);a<u.length;a+=1){var c=u[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},Dr.prototype.untransitioned=function(){for(var e=new Cn(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var uo=function(e,t,r,a,u){this.property=e,this.value=t,this.begin=u+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};uo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,u=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var h=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),u,function(m){if(m<=0)return 0;if(m>=1)return 1;var _=m*m,x=_*m;return 4*(m<.5?x:3*(m-_)+x-.75)}(h))}return u};var Cn=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Cn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ia(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a},Cn.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var qi=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};qi.prototype.getValue=function(e){return _r(this._values[e].value)},qi.prototype.setValue=function(e,t){this._values[e]=new Hi(this._values[e].property,t===null?void 0:_r(t))},qi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u)}return e},qi.prototype.possiblyEvaluate=function(e,t,r){for(var a=new Ia(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var h=c[u];a._values[h]=this._values[h].possiblyEvaluate(e,t,r)}return a};var jr=function(e,t,r){this.property=e,this.value=t,this.parameters=r};jr.prototype.isConstant=function(){return this.value.kind==="constant"},jr.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},jr.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var Ia=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ia.prototype.get=function(e){return this._values[e]};var Ze=function(e){this.specification=e};Ze.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},Ze.prototype.interpolate=function(e,t,r){var a=Bo[this.specification.type];return a?a(e,t,r):e};var qe=function(e,t){this.specification=e,this.overrides=t};qe.prototype.possiblyEvaluate=function(e,t,r,a){return new jr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},qe.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new jr(this,{kind:"constant",value:void 0},e.parameters);var a=Bo[this.specification.type];return a?new jr(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},qe.prototype.evaluate=function(e,t,r,a,u,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,u,c)};var cs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,u,c){if(r.value===void 0)return new jr(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var h=r.expression.evaluate(a,null,{},u,c),m=r.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,_=this._calculate(m,m,m,a);return new jr(this,{kind:"constant",value:_},a)}if(r.expression.kind==="camera"){var x=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new jr(this,{kind:"constant",value:x},a)}return new jr(this,r.expression,a)},t.prototype.evaluate=function(r,a,u,c,h,m){if(r.kind==="source"){var _=r.evaluate(a,u,c,h,m);return this._calculate(_,_,_,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},u,c),r.evaluate({zoom:Math.floor(a.zoom)},u,c),r.evaluate({zoom:Math.floor(a.zoom)+1},u,c),a):r.value},t.prototype._calculate=function(r,a,u,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:u,to:a}},t.prototype.interpolate=function(r){return r},t}(qe),$r=function(e){this.specification=e};$r.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var u=e.expression.evaluate(t,null,{},r,a);return this._calculate(u,u,u,t)}return this._calculate(e.expression.evaluate(new ht(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ht(Math.floor(t.zoom),t)),e.expression.evaluate(new ht(Math.floor(t.zoom+1),t)),t)}},$r.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},$r.prototype.interpolate=function(e){return e};var ji=function(e){this.specification=e};ji.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},ji.prototype.interpolate=function(){return!1};var Lr=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Hi(r,void 0),u=this.defaultTransitionablePropertyValues[t]=new Ci(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Ve("DataDrivenProperty",qe),Ve("DataConstantProperty",Ze),Ve("CrossFadedDataDrivenProperty",cs),Ve("CrossFadedProperty",$r),Ve("ColorRampProperty",ji);var Ki=function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new qi(a.layout)),a.paint)){for(var u in this._transitionablePaint=new Dr(a.paint),r.paint)this.setPaintProperty(u,r.paint[u],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ia(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,u){u===void 0&&(u={}),a!=null&&this._validate(ba,"layers."+this.id+".layout."+r,r,a,u)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return cr(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,u){if(u===void 0&&(u={}),a!=null&&this._validate(Hc,"layers."+this.id+".paint."+r,r,a,u))return!1;if(cr(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],h=c.property.specification["property-type"]==="cross-faded-data-driven",m=c.value.isDataDriven(),_=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var x=this._transitionablePaint._values[r].value;return x.isDataDriven()||m||h||this._handleOverridablePaintPropertyUpdate(r,_,x)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Hr(r,function(a,u){return!(a===void 0||u==="layout"&&!Object.keys(a).length||u==="paint"&&!Object.keys(a).length)})},t.prototype._validate=function(r,a,u,c,h){return h===void 0&&(h={}),(!h||h.validate!==!1)&&wa(this,r.call(xa,{key:a,layerType:this.type,objectKey:u,value:c,styleSpec:B,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof jr&&oo(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t}(ee),vl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ps=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},kt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ar(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map(function(u){var c=vl[u.type].BYTES_PER_ELEMENT,h=r=Pu(r,Math.max(t,c)),m=u.components||1;return a=Math.max(a,c),r+=c*m,{name:u.name,type:u.type,components:m,offset:h}}),size:Pu(r,Math.max(a,t)),alignment:t}}function Pu(e,t){return Math.ceil(e/t)*t}kt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},kt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},kt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},kt.prototype.clear=function(){this.length=0},kt.prototype.resize=function(e){this.reserve(e),this.length=e},kt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},kt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var co=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=u,r},t}(kt);co.prototype.bytesPerElement=4,Ve("StructArrayLayout2i4",co);var gl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,h){var m=4*r;return this.int16[m+0]=a,this.int16[m+1]=u,this.int16[m+2]=c,this.int16[m+3]=h,r},t}(kt);gl.prototype.bytesPerElement=8,Ve("StructArrayLayout4i8",gl);var un=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,m)},t.prototype.emplace=function(r,a,u,c,h,m,_){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=u,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=_,r},t}(kt);un.prototype.bytesPerElement=12,Ve("StructArrayLayout2i4i12",un);var ui=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,m)},t.prototype.emplace=function(r,a,u,c,h,m,_){var x=4*r,w=8*r;return this.int16[x+0]=a,this.int16[x+1]=u,this.uint8[w+4]=c,this.uint8[w+5]=h,this.uint8[w+6]=m,this.uint8[w+7]=_,r},t}(kt);ui.prototype.bytesPerElement=8,Ve("StructArrayLayout2i4ub8",ui);var No=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=u,r},t}(kt);No.prototype.bytesPerElement=8,Ve("StructArrayLayout2f8",No);var Yi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m,_,x,w,T){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,u,c,h,m,_,x,w,T)},t.prototype.emplace=function(r,a,u,c,h,m,_,x,w,T,C){var k=10*r;return this.uint16[k+0]=a,this.uint16[k+1]=u,this.uint16[k+2]=c,this.uint16[k+3]=h,this.uint16[k+4]=m,this.uint16[k+5]=_,this.uint16[k+6]=x,this.uint16[k+7]=w,this.uint16[k+8]=T,this.uint16[k+9]=C,r},t}(kt);Yi.prototype.bytesPerElement=20,Ve("StructArrayLayout10ui20",Yi);var hs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m,_,x,w,T,C,k){var N=this.length;return this.resize(N+1),this.emplace(N,r,a,u,c,h,m,_,x,w,T,C,k)},t.prototype.emplace=function(r,a,u,c,h,m,_,x,w,T,C,k,N){var U=12*r;return this.int16[U+0]=a,this.int16[U+1]=u,this.int16[U+2]=c,this.int16[U+3]=h,this.uint16[U+4]=m,this.uint16[U+5]=_,this.uint16[U+6]=x,this.uint16[U+7]=w,this.int16[U+8]=T,this.int16[U+9]=C,this.int16[U+10]=k,this.int16[U+11]=N,r},t}(kt);hs.prototype.bytesPerElement=24,Ve("StructArrayLayout4i4ui4i24",hs);var Uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var h=3*r;return this.float32[h+0]=a,this.float32[h+1]=u,this.float32[h+2]=c,r},t}(kt);Uo.prototype.bytesPerElement=12,Ve("StructArrayLayout3f12",Uo);var Ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t}(kt);Ea.prototype.bytesPerElement=4,Ve("StructArrayLayout1ul4",Ea);var _l=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m,_,x,w){var T=this.length;return this.resize(T+1),this.emplace(T,r,a,u,c,h,m,_,x,w)},t.prototype.emplace=function(r,a,u,c,h,m,_,x,w,T){var C=10*r,k=5*r;return this.int16[C+0]=a,this.int16[C+1]=u,this.int16[C+2]=c,this.int16[C+3]=h,this.int16[C+4]=m,this.int16[C+5]=_,this.uint32[k+3]=x,this.uint16[C+8]=w,this.uint16[C+9]=T,r},t}(kt);_l.prototype.bytesPerElement=20,Ve("StructArrayLayout6i1ul2ui20",_l);var qo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m){var _=this.length;return this.resize(_+1),this.emplace(_,r,a,u,c,h,m)},t.prototype.emplace=function(r,a,u,c,h,m,_){var x=6*r;return this.int16[x+0]=a,this.int16[x+1]=u,this.int16[x+2]=c,this.int16[x+3]=h,this.int16[x+4]=m,this.int16[x+5]=_,r},t}(kt);qo.prototype.bytesPerElement=12,Ve("StructArrayLayout2i2i2i12",qo);var po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h){var m=this.length;return this.resize(m+1),this.emplace(m,r,a,u,c,h)},t.prototype.emplace=function(r,a,u,c,h,m){var _=4*r,x=8*r;return this.float32[_+0]=a,this.float32[_+1]=u,this.float32[_+2]=c,this.int16[x+6]=h,this.int16[x+7]=m,r},t}(kt);po.prototype.bytesPerElement=16,Ve("StructArrayLayout2f1f2i16",po);var xl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,h){var m=12*r,_=3*r;return this.uint8[m+0]=a,this.uint8[m+1]=u,this.float32[_+1]=c,this.float32[_+2]=h,r},t}(kt);xl.prototype.bytesPerElement=12,Ve("StructArrayLayout2ub2f12",xl);var Pn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var h=3*r;return this.uint16[h+0]=a,this.uint16[h+1]=u,this.uint16[h+2]=c,r},t}(kt);Pn.prototype.bytesPerElement=6,Ve("StructArrayLayout3ui6",Pn);var kn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te){var ne=this.length;return this.resize(ne+1),this.emplace(ne,r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te)},t.prototype.emplace=function(r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te,ne){var se=24*r,ce=12*r,ve=48*r;return this.int16[se+0]=a,this.int16[se+1]=u,this.uint16[se+2]=c,this.uint16[se+3]=h,this.uint32[ce+2]=m,this.uint32[ce+3]=_,this.uint32[ce+4]=x,this.uint16[se+10]=w,this.uint16[se+11]=T,this.uint16[se+12]=C,this.float32[ce+7]=k,this.float32[ce+8]=N,this.uint8[ve+36]=U,this.uint8[ve+37]=K,this.uint8[ve+38]=W,this.uint32[ce+10]=te,this.int16[se+22]=ne,r},t}(kt);kn.prototype.bytesPerElement=48,Ve("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",kn);var fs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te,ne,se,ce,ve,Se,Ae,$e,Me,We,Be,lt){var Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te,ne,se,ce,ve,Se,Ae,$e,Me,We,Be,lt)},t.prototype.emplace=function(r,a,u,c,h,m,_,x,w,T,C,k,N,U,K,W,te,ne,se,ce,ve,Se,Ae,$e,Me,We,Be,lt,Qe){var je=34*r,ct=17*r;return this.int16[je+0]=a,this.int16[je+1]=u,this.int16[je+2]=c,this.int16[je+3]=h,this.int16[je+4]=m,this.int16[je+5]=_,this.int16[je+6]=x,this.int16[je+7]=w,this.uint16[je+8]=T,this.uint16[je+9]=C,this.uint16[je+10]=k,this.uint16[je+11]=N,this.uint16[je+12]=U,this.uint16[je+13]=K,this.uint16[je+14]=W,this.uint16[je+15]=te,this.uint16[je+16]=ne,this.uint16[je+17]=se,this.uint16[je+18]=ce,this.uint16[je+19]=ve,this.uint16[je+20]=Se,this.uint16[je+21]=Ae,this.uint16[je+22]=$e,this.uint32[ct+12]=Me,this.float32[ct+13]=We,this.float32[ct+14]=Be,this.float32[ct+15]=lt,this.float32[ct+16]=Qe,r},t}(kt);fs.prototype.bytesPerElement=68,Ve("StructArrayLayout8i15ui1ul4f68",fs);var Mn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t}(kt);Mn.prototype.bytesPerElement=4,Ve("StructArrayLayout1f4",Mn);var Pi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var h=3*r;return this.int16[h+0]=a,this.int16[h+1]=u,this.int16[h+2]=c,r},t}(kt);Pi.prototype.bytesPerElement=6,Ve("StructArrayLayout3i6",Pi);var bl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var h=4*r;return this.uint32[2*r+0]=a,this.uint16[h+2]=u,this.uint16[h+3]=c,r},t}(kt);bl.prototype.bytesPerElement=8,Ve("StructArrayLayout1ul2ui8",bl);var Aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=u,r},t}(kt);Aa.prototype.bytesPerElement=4,Ve("StructArrayLayout2ui4",Aa);var wl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t}(kt);wl.prototype.bytesPerElement=2,Ve("StructArrayLayout1ui2",wl);var ds=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,h){var m=4*r;return this.float32[m+0]=a,this.float32[m+1]=u,this.float32[m+2]=c,this.float32[m+3]=h,r},t}(kt);ds.prototype.bytesPerElement=16,Ve("StructArrayLayout4f16",ds);var i=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new me(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(ps);i.prototype.size=20;var o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t}(_l);Ve("CollisionBoxArray",o);var n=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(ps);n.prototype.size=48;var s=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t}(kn);Ve("PlacedSymbolArray",s);var p=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(ps);p.prototype.size=68;var f=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t}(fs);Ve("SymbolInstanceArray",f);var d=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t}(Mn);Ve("GlyphOffsetArray",d);var g=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t}(Pi);Ve("SymbolLineVertexArray",g);var b=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(ps);b.prototype.size=8;var E=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new b(this,r)},t}(bl);Ve("FeatureIndexArray",E);var z=Ar([{name:"a_pos",components:2,type:"Int16"}],4).members,D=function(e){e===void 0&&(e=[]),this.segments=e};function L(e,t){return 256*(e=Ne(Math.floor(e),0,255))+Ne(Math.floor(t),0,255)}D.prototype.prepareSegment=function(e,t,r,a){var u=this.segments[this.segments.length-1];return e>D.MAX_VERTEX_ARRAY_LENGTH&&Lt("Max vertices per segment is "+D.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!u||u.vertexLength+e>D.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==a)&&(u={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(u.sortKey=a),this.segments.push(u)),u},D.prototype.get=function(){return this.segments},D.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},D.simpleSegment=function(e,t,r,a){return new D([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},D.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ve("SegmentVector",D);var $=Ar([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),q=ae(function(e){e.exports=function(t,r){var a,u,c,h,m,_,x,w;for(u=t.length-(a=3&t.length),c=r,m=3432918353,_=461845907,w=0;w<u;)x=255&t.charCodeAt(w)|(255&t.charCodeAt(++w))<<8|(255&t.charCodeAt(++w))<<16|(255&t.charCodeAt(++w))<<24,++w,c=27492+(65535&(h=5*(65535&(c=(c^=x=(65535&(x=(x=(65535&x)*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*_+(((x>>>16)*_&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(x=0,a){case 3:x^=(255&t.charCodeAt(w+2))<<16;case 2:x^=(255&t.charCodeAt(w+1))<<8;case 1:c^=x=(65535&(x=(x=(65535&(x^=255&t.charCodeAt(w)))*m+(((x>>>16)*m&65535)<<16)&4294967295)<<15|x>>>17))*_+(((x>>>16)*_&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}}),H=ae(function(e){e.exports=function(t,r){for(var a,u=t.length,c=r^u,h=0;u>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),u-=4,++h;switch(u){case 3:c^=(255&t.charCodeAt(h+2))<<16;case 2:c^=(255&t.charCodeAt(h+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(h)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}}),V=q,X=H;V.murmur3=q,V.murmur2=X;var Q=function(){this.ids=[],this.positions=[],this.indexed=!1};Q.prototype.add=function(e,t,r,a){this.ids.push(pe(e)),this.positions.push(t,r,a)},Q.prototype.getPositions=function(e){for(var t=pe(e),r=0,a=this.ids.length-1;r<a;){var u=r+a>>1;this.ids[u]>=t?a=u:r=u+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},Q.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return function u(c,h,m,_){for(;m<_;){for(var x=c[m+_>>1],w=m-1,T=_+1;;){do w++;while(c[w]<x);do T--;while(c[T]>x);if(w>=T)break;ue(c,w,T),ue(h,3*w,3*T),ue(h,3*w+1,3*T+1),ue(h,3*w+2,3*T+2)}T-m<_-T?(u(c,h,m,T),m=T+1):(u(c,h,T+1,_),_=T)}}(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},Q.deserialize=function(e){var t=new Q;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var re=Math.pow(2,53)-1;function pe(e){var t=+e;return!isNaN(t)&&t<=re?t:V(String(e))}function ue(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Ve("FeaturePositionMap",Q);var he=function(e,t){this.gl=e.gl,this.location=t},_e=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t}(he),Ie=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t}(he),Te=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t}(he),Le=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t}(he),Ge=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t}(he),Ke=function(e){function t(r,a){e.call(this,r,a),this.current=It.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t}(he),He=new Float32Array(16),xt=function(e){function t(r,a){e.call(this,r,a),this.current=He}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t}(he);function Re(e){return[L(255*e.r,255*e.g),L(255*e.b,255*e.a)]}var nt=function(e,t,r){this.value=e,this.uniformNames=t.map(function(a){return"u_"+a}),this.type=r};nt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},nt.prototype.getBinding=function(e,t,r){return this.type==="color"?new Ke(e,t):new Ie(e,t)};var st=function(e,t){this.uniformNames=t.map(function(r){return"u_"+r}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};st.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},st.prototype.setUniform=function(e,t,r,a){var u=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)},st.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new Ge(e,t):new Ie(e,t)};var it=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(function(u){return{name:"a_"+u,type:"Float32",components:r==="color"?2:1,offset:0}}),this.paintVertexArray=new a};it.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.paintVertexArray.length,h=this.expression.evaluate(new ht(0),t,{},a,[],u);this.paintVertexArray.resize(e),this._setPaintValue(c,e,h)},it.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,u)},it.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=Re(r),u=e;u<t;u++)this.paintVertexArray.emplace(u,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},it.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},it.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var rt=function(e,t,r,a,u,c){this.expression=e,this.uniformNames=t.map(function(h){return"u_"+h+"_t"}),this.type=r,this.useIntegerZoom=a,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=t.map(function(h){return{name:"a_"+h,type:"Float32",components:r==="color"?4:2,offset:0}}),this.paintVertexArray=new c};rt.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.expression.evaluate(new ht(this.zoom),t,{},a,[],u),h=this.expression.evaluate(new ht(this.zoom+1),t,{},a,[],u),m=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(m,e,c,h)},rt.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,u,c)},rt.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var u=Re(r),c=Re(a),h=e;h<t;h++)this.paintVertexArray.emplace(h,u[0],u[1],c[0],c[1]);else{for(var m=e;m<t;m++)this.paintVertexArray.emplace(m,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},rt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},rt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},rt.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=Ne(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},rt.prototype.getBinding=function(e,t,r){return new Ie(e,t)};var at=function(e,t,r,a,u,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u};at.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},at.prototype.updatePaintArray=function(e,t,r,a,u){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],u)},at.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var u=a[r.min],c=a[r.mid],h=a[r.max];if(u&&c&&h)for(var m=e;m<t;m++)this.zoomInPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(m,c.tl[0],c.tl[1],c.br[0],c.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1],c.pixelRatio,h.pixelRatio)}},at.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,$.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,$.members,this.expression.isStateDependent))},at.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var et=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var u in e.paint._values)if(r(u)){var c=e.paint.get(u);if(c instanceof jr&&oo(c.property.specification)){var h=xr(u,e.type),m=c.value,_=c.property.specification.type,x=c.property.useIntegerZoom,w=c.property.specification["property-type"],T=w==="cross-faded"||w==="cross-faded-data-driven";if(m.kind==="constant")this.binders[u]=T?new st(m.value,h):new nt(m.value,h,_),a.push("/u_"+u);else if(m.kind==="source"||T){var C=Qt(u,_,"source");this.binders[u]=T?new at(m,_,x,t,C,e.id):new it(m,h,_,C),a.push("/a_"+u)}else{var k=Qt(u,_,"composite");this.binders[u]=new rt(m,h,_,x,t,k),a.push("/z_"+u)}}}this.cacheKey=a.sort().join("")};et.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof it||t instanceof rt?t.maxValue:0},et.prototype.populatePaintArrays=function(e,t,r,a,u){for(var c in this.binders){var h=this.binders[c];(h instanceof it||h instanceof rt||h instanceof at)&&h.populatePaintArray(e,t,r,a,u)}},et.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof st&&a.setConstantPatternPositions(e,t)}},et.prototype.updatePaintArrays=function(e,t,r,a,u){var c=!1;for(var h in e)for(var m=0,_=t.getPositions(h);m<_.length;m+=1){var x=_[m],w=r.feature(x.index);for(var T in this.binders){var C=this.binders[T];if((C instanceof it||C instanceof rt||C instanceof at)&&C.expression.isStateDependent===!0){var k=a.paint.get(T);C.expression=k.value,C.updatePaintArray(x.start,x.end,w,e[h],u),c=!0}}}return c},et.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof nt||r instanceof st)&&e.push.apply(e,r.uniformNames.map(function(a){return"#define HAS_UNIFORM_"+a}))}return e},et.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof it||r instanceof rt)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof at)for(var u=0;u<$.members.length;u++)e.push($.members[u].name)}return e},et.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof nt||r instanceof st||r instanceof rt)for(var a=0,u=r.uniformNames;a<u.length;a+=1)e.push(u[a])}return e},et.prototype.getPaintVertexBuffers=function(){return this._buffers},et.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var u=this.binders[a];if(u instanceof nt||u instanceof st||u instanceof rt)for(var c=0,h=u.uniformNames;c<h.length;c+=1){var m=h[c];if(t[m]){var _=u.getBinding(e,t[m],m);r.push({name:m,property:a,binding:_})}}}return r},et.prototype.setUniforms=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1){var h=c[u],m=h.name,_=h.property;this.binders[_].setUniform(h.binding,a,r.get(_),m)}},et.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof at){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof it||r instanceof rt)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},et.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof it||r instanceof rt||r instanceof at)&&r.upload(e)}this.updatePaintBuffers()},et.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof it||t instanceof rt||t instanceof at)&&t.destroy()}};var Je=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,u=e;a<u.length;a+=1){var c=u[a];this.programConfigurations[c.id]=new et(c,t,r)}this.needsUpload=!1,this._featureMap=new Q,this._bufferOffset=0};function xr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function Qt(e,t,r){var a={color:{source:No,composite:ds},number:{source:Mn,composite:No}},u=function(c){return{"line-pattern":{source:Yi,composite:Yi},"fill-pattern":{source:Yi,composite:Yi},"fill-extrusion-pattern":{source:Yi,composite:Yi}}[c]}(e);return u&&u[r]||a[t][r]}Je.prototype.populatePaintArrays=function(e,t,r,a,u,c){for(var h in this.programConfigurations)this.programConfigurations[h].populatePaintArrays(e,t,a,u,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},Je.prototype.updatePaintArrays=function(e,t,r,a){for(var u=0,c=r;u<c.length;u+=1){var h=c[u];this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,t,h,a)||this.needsUpload}},Je.prototype.get=function(e){return this.programConfigurations[e]},Je.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},Je.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Ve("ConstantBinder",nt),Ve("CrossFadedConstantBinder",st),Ve("SourceExpressionBinder",it),Ve("CrossFadedCompositeBinder",at),Ve("CompositeExpressionBinder",rt),Ve("ProgramConfiguration",et,{omit:["_buffers"]}),Ve("ProgramConfigurationSet",Je);var Rr=Math.pow(2,14)-1,Cr=-Rr-1;function Yt(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var u=r[a],c=0;c<u.length;c++){var h=u[c],m=Math.round(h.x*t),_=Math.round(h.y*t);h.x=Ne(m,Cr,Rr),h.y=Ne(_,Cr,Rr),(m<h.x||m>h.x+1||_<h.y||_>h.y+1)&&Lt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ar(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Yt(e):[]}}function ci(e,t,r,a,u){e.emplaceBack(2*t+(a+1)/2,2*r+(u+1)/2)}var Zr=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new co,this.indexArray=new Pn,this.segments=new D,this.programConfigurations=new Je(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function zn(e,t){for(var r=0;r<e.length;r++)if(Ji(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(Ji(e,t[a]))return!0;return!!Ca(e,t)}function Qr(e,t,r){return!!Ji(e,t)||!!Bn(t,e,r)}function $i(e,t){if(e.length===1)return Pa(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],u=0;u<a.length;u++)if(Ji(e,a[u]))return!0;for(var c=0;c<e.length;c++)if(Pa(t,e[c]))return!0;for(var h=0;h<t.length;h++)if(Ca(e,t[h]))return!0;return!1}function ki(e,t,r){if(e.length>1){if(Ca(e,t))return!0;for(var a=0;a<t.length;a++)if(Bn(t[a],e,r))return!0}for(var u=0;u<e.length;u++)if(Bn(e[u],t,r))return!0;return!1}function Ca(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],u=e[r+1],c=0;c<t.length-1;c++)if(jo(a,u,t[c],t[c+1]))return!0;return!1}function jo(e,t,r,a){return Tr(e,r,a)!==Tr(t,r,a)&&Tr(e,t,r)!==Tr(e,t,a)}function Bn(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var u=1;u<t.length;u++)if($o(e,t[u-1],t[u])<a)return!0;return!1}function $o(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var u=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(u<0?t:u>1?r:r.sub(t)._mult(u)._add(t))}function Pa(e,t){for(var r,a,u,c=!1,h=0;h<e.length;h++)for(var m=0,_=(r=e[h]).length-1;m<r.length;_=m++)(a=r[m]).y>t.y!=(u=r[_]).y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(c=!c);return c}function Ji(e,t){for(var r=!1,a=0,u=e.length-1;a<e.length;u=a++){var c=e[a],h=e[u];c.y>t.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(r=!r)}return r}function ka(e,t,r){var a=r[0],u=r[2];if(e.x<a.x&&t.x<a.x||e.x>u.x&&t.x>u.x||e.y<a.y&&t.y<a.y||e.y>u.y&&t.y>u.y)return!1;var c=Tr(e,t,r[0]);return c!==Tr(e,t,r[1])||c!==Tr(e,t,r[2])||c!==Tr(e,t,r[3])}function Qi(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function br(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function cn(e,t,r,a,u){if(!t[0]&&!t[1])return e;var c=me.convert(t)._mult(u);r==="viewport"&&c._rotate(-a);for(var h=[],m=0;m<e.length;m++)h.push(e[m].sub(c));return h}Zr.prototype.populate=function(e,t,r){var a=this.layers[0],u=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var h=0,m=e;h<m.length;h+=1){var _=m[h],x=_.feature,w=_.id,T=_.index,C=_.sourceLayerIndex,k=this.layers[0]._featureFilter.needGeometry,N=ar(x,k);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),N,r)){var U=c?c.evaluate(N,{},r):void 0,K={id:w,properties:x.properties,type:x.type,sourceLayerIndex:C,index:T,geometry:k?N.geometry:Yt(x),patterns:{},sortKey:U};u.push(K)}}c&&u.sort(function(Ae,$e){return Ae.sortKey-$e.sortKey});for(var W=0,te=u;W<te.length;W+=1){var ne=te[W],se=ne.geometry,ce=ne.index,ve=ne.sourceLayerIndex,Se=e[ce].feature;this.addFeature(ne,se,ce,r),t.featureIndex.insert(Se,se,ce,ve,this.index)}},Zr.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Zr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Zr.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Zr.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,z),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Zr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Zr.prototype.addFeature=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1)for(var h=0,m=c[u];h<m.length;h+=1){var _=m[h],x=_.x,w=_.y;if(!(x<0||x>=8192||w<0||w>=8192)){var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=T.vertexLength;ci(this.layoutVertexArray,x,w,-1,-1),ci(this.layoutVertexArray,x,w,1,-1),ci(this.layoutVertexArray,x,w,1,1),ci(this.layoutVertexArray,x,w,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Ve("CircleBucket",Zr,{omit:["layers"]});var Dn=new Lr({"circle-sort-key":new qe(B.layout_circle["circle-sort-key"])}),ho={paint:new Lr({"circle-radius":new qe(B.paint_circle["circle-radius"]),"circle-color":new qe(B.paint_circle["circle-color"]),"circle-blur":new qe(B.paint_circle["circle-blur"]),"circle-opacity":new qe(B.paint_circle["circle-opacity"]),"circle-translate":new Ze(B.paint_circle["circle-translate"]),"circle-translate-anchor":new Ze(B.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ze(B.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ze(B.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qe(B.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qe(B.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qe(B.paint_circle["circle-stroke-opacity"])}),layout:Dn},Et=typeof Float32Array<"u"?Float32Array:Array;function yi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ei(e,t,r){var a=t[0],u=t[1],c=t[2],h=t[3],m=t[4],_=t[5],x=t[6],w=t[7],T=t[8],C=t[9],k=t[10],N=t[11],U=t[12],K=t[13],W=t[14],te=t[15],ne=r[0],se=r[1],ce=r[2],ve=r[3];return e[0]=ne*a+se*m+ce*T+ve*U,e[1]=ne*u+se*_+ce*C+ve*K,e[2]=ne*c+se*x+ce*k+ve*W,e[3]=ne*h+se*w+ce*N+ve*te,e[4]=(ne=r[4])*a+(se=r[5])*m+(ce=r[6])*T+(ve=r[7])*U,e[5]=ne*u+se*_+ce*C+ve*K,e[6]=ne*c+se*x+ce*k+ve*W,e[7]=ne*h+se*w+ce*N+ve*te,e[8]=(ne=r[8])*a+(se=r[9])*m+(ce=r[10])*T+(ve=r[11])*U,e[9]=ne*u+se*_+ce*C+ve*K,e[10]=ne*c+se*x+ce*k+ve*W,e[11]=ne*h+se*w+ce*N+ve*te,e[12]=(ne=r[12])*a+(se=r[13])*m+(ce=r[14])*T+(ve=r[15])*U,e[13]=ne*u+se*_+ce*C+ve*K,e[14]=ne*c+se*x+ce*k+ve*W,e[15]=ne*h+se*w+ce*N+ve*te,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var fo,Kc=ei;function ms(e,t,r){var a=t[0],u=t[1],c=t[2],h=t[3];return e[0]=r[0]*a+r[4]*u+r[8]*c+r[12]*h,e[1]=r[1]*a+r[5]*u+r[9]*c+r[13]*h,e[2]=r[2]*a+r[6]*u+r[10]*c+r[14]*h,e[3]=r[3]*a+r[7]*u+r[11]*c+r[15]*h,e}fo=new Et(3),Et!=Float32Array&&(fo[0]=0,fo[1]=0,fo[2]=0),function(){var e=new Et(4);Et!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Yc=(function(){var e=new Et(2);Et!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,ho)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Zr(r)},t.prototype.queryRadius=function(r){var a=r;return Qi("circle-radius",this,a)+Qi("circle-stroke-width",this,a)+br(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,m,_,x){for(var w=cn(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),m.angle,_),T=this.paint.get("circle-radius").evaluate(a,u)+this.paint.get("circle-stroke-width").evaluate(a,u),C=this.paint.get("circle-pitch-alignment")==="map",k=C?w:function(Se,Ae){return Se.map(function($e){return Ma($e,Ae)})}(w,x),N=C?T*_:T,U=0,K=c;U<K.length;U+=1)for(var W=0,te=K[U];W<te.length;W+=1){var ne=te[W],se=C?ne:Ma(ne,x),ce=N,ve=ms([],[ne.x,ne.y,0,1],x);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ce*=ve[3]/m.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ce*=m.cameraToCenterDistance/ve[3]),Qr(k,se,ce))return!0}return!1},t}(Ki));function Ma(e,t){var r=ms([],[e.x,e.y,0,1],t);return new me(r[0]/r[3],r[1]/r[3])}var ku=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Zr);function Zo(e,t,r,a){var u=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==u*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(u*c*r);return e.width=u,e.height=c,e.data=a,e}function ys(e,t,r){var a=t.width,u=t.height;if(a!==e.width||u!==e.height){var c=Zo({},{width:a,height:u},r);Jc(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,u)},r),e.width=a,e.height=u,e.data=c.data}}function Jc(e,t,r,a,u,c){if(u.width===0||u.height===0)return t;if(u.width>e.width||u.height>e.height||r.x>e.width-u.width||r.y>e.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");for(var h=e.data,m=t.data,_=0;_<u.height;_++)for(var x=((r.y+_)*e.width+r.x)*c,w=((a.y+_)*t.width+a.x)*c,T=0;T<u.width*c;T++)m[w+T]=h[x+T];return t}Ve("HeatmapBucket",ku,{omit:["layers"]});var za=function(e,t){Zo(this,e,1,t)};za.prototype.resize=function(e){ys(this,e,1)},za.prototype.clone=function(){return new za({width:this.width,height:this.height},new Uint8Array(this.data))},za.copy=function(e,t,r,a,u){Jc(e,t,r,a,u,1)};var pi=function(e,t){Zo(this,e,4,t)};pi.prototype.resize=function(e){ys(this,e,4)},pi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},pi.prototype.clone=function(){return new pi({width:this.width,height:this.height},new Uint8Array(this.data))},pi.copy=function(e,t,r,a,u){Jc(e,t,r,a,u,4)},Ve("AlphaImage",za),Ve("RGBAImage",pi);var Mv={paint:new Lr({"heatmap-radius":new qe(B.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qe(B.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ze(B.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ji(B.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ze(B.paint_heatmap["heatmap-opacity"])})};function ff(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,u=e.image||new pi({width:r,height:a}),c=function(N,U,K){t[e.evaluationKey]=K;var W=e.expression.evaluate(t);u.data[N+U+0]=Math.floor(255*W.r/W.a),u.data[N+U+1]=Math.floor(255*W.g/W.a),u.data[N+U+2]=Math.floor(255*W.b/W.a),u.data[N+U+3]=Math.floor(255*W.a)};if(e.clips)for(var h=0,m=0;h<a;++h,m+=4*r)for(var _=0,x=0;_<r;_++,x+=4){var w=_/(r-1),T=e.clips[h];c(m,x,T.start*(1-w)+T.end*w)}else for(var C=0,k=0;C<r;C++,k+=4)c(0,k,C/(r-1));return u}var zv=function(e){function t(r){e.call(this,r,Mv),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new ku(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=ff({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t}(Ki),Bv={paint:new Lr({"hillshade-illumination-direction":new Ze(B.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ze(B.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ze(B.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ze(B.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ze(B.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ze(B.paint_hillshade["hillshade-accent-color"])})},Dv=function(e){function t(r){e.call(this,r,Bv)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t}(Ki),Lv=Ar([{name:"a_pos",components:2,type:"Int16"}],4).members,Qc=Mu,Rv=Mu;function Mu(e,t,r){r=r||2;var a,u,c,h,m,_,x,w=t&&t.length,T=w?t[0]*r:e.length,C=df(e,0,T,r,!0),k=[];if(!C||C.next===C.prev)return k;if(w&&(C=function(U,K,W,te){var ne,se,ce,ve=[];for(ne=0,se=K.length;ne<se;ne++)(ce=df(U,K[ne]*te,ne<se-1?K[ne+1]*te:U.length,te,!1))===ce.next&&(ce.steiner=!0),ve.push($v(ce));for(ve.sort(Uv),ne=0;ne<ve.length;ne++)qv(ve[ne],W),W=Go(W,W.next);return W}(e,t,C,r)),e.length>80*r){a=c=e[0],u=h=e[1];for(var N=r;N<T;N+=r)(m=e[N])<a&&(a=m),(_=e[N+1])<u&&(u=_),m>c&&(c=m),_>h&&(h=_);x=(x=Math.max(c-a,h-u))!==0?1/x:0}return Sl(C,k,r,a,u,x),k}function df(e,t,r,a,u){var c,h;if(u===rp(e,t,r,a)>0)for(c=t;c<r;c+=a)h=vf(c,e[c],e[c+1],h);else for(c=r-a;c>=t;c-=a)h=vf(c,e[c],e[c+1],h);return h&&zu(h,h.next)&&(Il(h),h=h.next),h}function Go(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!zu(a,a.next)&&yr(a.prev,a,a.next)!==0)a=a.next;else{if(Il(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Sl(e,t,r,a,u,c,h){if(e){!h&&c&&function(w,T,C,k){var N=w;do N.z===null&&(N.z=ep(N.x,N.y,T,C,k)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==w);N.prevZ.nextZ=null,N.prevZ=null,function(U){var K,W,te,ne,se,ce,ve,Se,Ae=1;do{for(W=U,U=null,se=null,ce=0;W;){for(ce++,te=W,ve=0,K=0;K<Ae&&(ve++,te=te.nextZ);K++);for(Se=Ae;ve>0||Se>0&&te;)ve!==0&&(Se===0||!te||W.z<=te.z)?(ne=W,W=W.nextZ,ve--):(ne=te,te=te.nextZ,Se--),se?se.nextZ=ne:U=ne,ne.prevZ=se,se=ne;W=te}se.nextZ=null,Ae*=2}while(ce>1)}(N)}(e,a,u,c);for(var m,_,x=e;e.prev!==e.next;)if(m=e.prev,_=e.next,c?Ov(e,a,u,c):Fv(e))t.push(m.i/r),t.push(e.i/r),t.push(_.i/r),Il(e),e=_.next,x=_.next;else if((e=_)===x){h?h===1?Sl(e=Vv(Go(e),t,r),t,r,a,u,c,2):h===2&&Nv(e,t,r,a,u,c):Sl(Go(e),t,r,a,u,c,1);break}}}function Fv(e){var t=e.prev,r=e,a=e.next;if(yr(t,r,a)>=0)return!1;for(var u=e.next.next;u!==e.prev;){if(vs(t.x,t.y,r.x,r.y,a.x,a.y,u.x,u.y)&&yr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function Ov(e,t,r,a){var u=e.prev,c=e,h=e.next;if(yr(u,c,h)>=0)return!1;for(var m=u.x>c.x?u.x>h.x?u.x:h.x:c.x>h.x?c.x:h.x,_=u.y>c.y?u.y>h.y?u.y:h.y:c.y>h.y?c.y:h.y,x=ep(u.x<c.x?u.x<h.x?u.x:h.x:c.x<h.x?c.x:h.x,u.y<c.y?u.y<h.y?u.y:h.y:c.y<h.y?c.y:h.y,t,r,a),w=ep(m,_,t,r,a),T=e.prevZ,C=e.nextZ;T&&T.z>=x&&C&&C.z<=w;){if(T!==e.prev&&T!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,T.x,T.y)&&yr(T.prev,T,T.next)>=0||(T=T.prevZ,C!==e.prev&&C!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,C.x,C.y)&&yr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;T&&T.z>=x;){if(T!==e.prev&&T!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,T.x,T.y)&&yr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;C&&C.z<=w;){if(C!==e.prev&&C!==e.next&&vs(u.x,u.y,c.x,c.y,h.x,h.y,C.x,C.y)&&yr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Vv(e,t,r){var a=e;do{var u=a.prev,c=a.next.next;!zu(u,c)&&mf(u,a,a.next,c)&&Tl(u,c)&&Tl(c,u)&&(t.push(u.i/r),t.push(a.i/r),t.push(c.i/r),Il(a),Il(a.next),a=e=c),a=a.next}while(a!==e);return Go(a)}function Nv(e,t,r,a,u,c){var h=e;do{for(var m=h.next.next;m!==h.prev;){if(h.i!==m.i&&Zv(h,m)){var _=yf(h,m);return h=Go(h,h.next),_=Go(_,_.next),Sl(h,t,r,a,u,c),void Sl(_,t,r,a,u,c)}m=m.next}h=h.next}while(h!==e)}function Uv(e,t){return e.x-t.x}function qv(e,t){if(t=function(a,u){var c,h=u,m=a.x,_=a.y,x=-1/0;do{if(_<=h.y&&_>=h.next.y&&h.next.y!==h.y){var w=h.x+(_-h.y)*(h.next.x-h.x)/(h.next.y-h.y);if(w<=m&&w>x){if(x=w,w===m){if(_===h.y)return h;if(_===h.next.y)return h.next}c=h.x<h.next.x?h:h.next}}h=h.next}while(h!==u);if(!c)return null;if(m===x)return c;var T,C=c,k=c.x,N=c.y,U=1/0;h=c;do m>=h.x&&h.x>=k&&m!==h.x&&vs(_<N?m:x,_,k,N,_<N?x:m,_,h.x,h.y)&&(T=Math.abs(_-h.y)/(m-h.x),Tl(h,a)&&(T<U||T===U&&(h.x>c.x||h.x===c.x&&jv(c,h)))&&(c=h,U=T)),h=h.next;while(h!==C);return c}(e,t)){var r=yf(t,e);Go(t,t.next),Go(r,r.next)}}function jv(e,t){return yr(e.prev,e,t.prev)<0&&yr(t.next,e,e.next)<0}function ep(e,t,r,a,u){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*u)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*u)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function $v(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function vs(e,t,r,a,u,c,h,m){return(u-h)*(t-m)-(e-h)*(c-m)>=0&&(e-h)*(a-m)-(r-h)*(t-m)>=0&&(r-h)*(c-m)-(u-h)*(a-m)>=0}function Zv(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(r,a){var u=r;do{if(u.i!==r.i&&u.next.i!==r.i&&u.i!==a.i&&u.next.i!==a.i&&mf(u,u.next,r,a))return!0;u=u.next}while(u!==r);return!1}(e,t)&&(Tl(e,t)&&Tl(t,e)&&function(r,a){var u=r,c=!1,h=(r.x+a.x)/2,m=(r.y+a.y)/2;do u.y>m!=u.next.y>m&&u.next.y!==u.y&&h<(u.next.x-u.x)*(m-u.y)/(u.next.y-u.y)+u.x&&(c=!c),u=u.next;while(u!==r);return c}(e,t)&&(yr(e.prev,e,t.prev)||yr(e,t.prev,t))||zu(e,t)&&yr(e.prev,e,e.next)>0&&yr(t.prev,t,t.next)>0)}function yr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function zu(e,t){return e.x===t.x&&e.y===t.y}function mf(e,t,r,a){var u=Du(yr(e,t,r)),c=Du(yr(e,t,a)),h=Du(yr(r,a,e)),m=Du(yr(r,a,t));return u!==c&&h!==m||!(u!==0||!Bu(e,r,t))||!(c!==0||!Bu(e,a,t))||!(h!==0||!Bu(r,e,a))||!(m!==0||!Bu(r,t,a))}function Bu(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Du(e){return e>0?1:e<0?-1:0}function Tl(e,t){return yr(e.prev,e,e.next)<0?yr(e,t,e.next)>=0&&yr(e,e.prev,t)>=0:yr(e,t,e.prev)<0||yr(e,e.next,t)<0}function yf(e,t){var r=new tp(e.i,e.x,e.y),a=new tp(t.i,t.x,t.y),u=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=u,u.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function vf(e,t,r,a){var u=new tp(e,t,r);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Il(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 tp(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 rp(e,t,r,a){for(var u=0,c=t,h=r-a;c<r;c+=a)u+=(e[h]-e[c])*(e[c+1]+e[h+1]),h=c;return u}function Gv(e,t,r,a,u){(function c(h,m,_,x,w){for(;x>_;){if(x-_>600){var T=x-_+1,C=m-_+1,k=Math.log(T),N=.5*Math.exp(2*k/3),U=.5*Math.sqrt(k*N*(T-N)/T)*(C-T/2<0?-1:1);c(h,m,Math.max(_,Math.floor(m-C*N/T+U)),Math.min(x,Math.floor(m+(T-C)*N/T+U)),w)}var K=h[m],W=_,te=x;for(El(h,_,m),w(h[x],K)>0&&El(h,_,x);W<te;){for(El(h,W,te),W++,te--;w(h[W],K)<0;)W++;for(;w(h[te],K)>0;)te--}w(h[_],K)===0?El(h,_,te):El(h,++te,x),te<=m&&(_=te+1),m<=te&&(x=te-1)}})(e,t,r,a||e.length-1,u||Wv)}function El(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Wv(e,t){return e<t?-1:e>t?1:0}function ip(e,t){var r=e.length;if(r<=1)return[e];for(var a,u,c=[],h=0;h<r;h++){var m=To(e[h]);m!==0&&(e[h].area=Math.abs(m),u===void 0&&(u=m<0),u===m<0?(a&&c.push(a),a=[e[h]]):a.push(e[h]))}if(a&&c.push(a),t>1)for(var _=0;_<c.length;_++)c[_].length<=t||(Gv(c[_],t,1,c[_].length-1,Xv),c[_]=c[_].slice(0,t));return c}function Xv(e,t){return t.area-e.area}function np(e,t,r){for(var a=r.patternDependencies,u=!1,c=0,h=t;c<h.length;c+=1){var m=h[c].paint.get(e+"-pattern");m.isConstant()||(u=!0);var _=m.constantOr(null);_&&(u=!0,a[_.to]=!0,a[_.from]=!0)}return u}function op(e,t,r,a,u){for(var c=u.patternDependencies,h=0,m=t;h<m.length;h+=1){var _=m[h],x=_.paint.get(e+"-pattern").value;if(x.kind!=="constant"){var w=x.evaluate({zoom:a-1},r,{},u.availableImages),T=x.evaluate({zoom:a},r,{},u.availableImages),C=x.evaluate({zoom:a+1},r,{},u.availableImages);T=T&&T.name?T.name:T,C=C&&C.name?C.name:C,c[w=w&&w.name?w.name:w]=!0,c[T]=!0,c[C]=!0,r.patterns[_.id]={min:w,mid:T,max:C}}}return r}Mu.deviation=function(e,t,r,a){var u=t&&t.length,c=Math.abs(rp(e,0,u?t[0]*r:e.length,r));if(u)for(var h=0,m=t.length;h<m;h++)c-=Math.abs(rp(e,t[h]*r,h<m-1?t[h+1]*r:e.length,r));var _=0;for(h=0;h<a.length;h+=3){var x=a[h]*r,w=a[h+1]*r,T=a[h+2]*r;_+=Math.abs((e[x]-e[T])*(e[w+1]-e[x+1])-(e[x]-e[w])*(e[T+1]-e[x+1]))}return c===0&&_===0?0:Math.abs((_-c)/c)},Mu.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,u=0;u<e.length;u++){for(var c=0;c<e[u].length;c++)for(var h=0;h<t;h++)r.vertices.push(e[u][c][h]);u>0&&r.holes.push(a+=e[u-1].length)}return r},Qc.default=Rv;var pn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new co,this.indexArray=new Pn,this.indexArray2=new Aa,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new D,this.segments2=new D,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};pn.prototype.populate=function(e,t,r){this.hasPattern=np("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),u=[],c=0,h=e;c<h.length;c+=1){var m=h[c],_=m.feature,x=m.id,w=m.index,T=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,k=ar(_,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var N=a?a.evaluate(k,{},r,t.availableImages):void 0,U={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:w,geometry:C?k.geometry:Yt(_),patterns:{},sortKey:N};u.push(U)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var K=0,W=u;K<W.length;K+=1){var te=W[K],ne=te.geometry,se=te.index,ce=te.sourceLayerIndex;if(this.hasPattern){var ve=op("fill",this.layers,te,this.zoom,t);this.patternFeatures.push(ve)}else this.addFeature(te,ne,se,r,{});t.featureIndex.insert(e[se].feature,ne,se,ce,this.index)}},pn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},pn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},pn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},pn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},pn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lv),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},pn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},pn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,h=ip(t,500);c<h.length;c+=1){for(var m=h[c],_=0,x=0,w=m;x<w.length;x+=1)_+=w[x].length;for(var T=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray),C=T.vertexLength,k=[],N=[],U=0,K=m;U<K.length;U+=1){var W=K[U];if(W.length!==0){W!==m[0]&&N.push(k.length/2);var te=this.segments2.prepareSegment(W.length,this.layoutVertexArray,this.indexArray2),ne=te.vertexLength;this.layoutVertexArray.emplaceBack(W[0].x,W[0].y),this.indexArray2.emplaceBack(ne+W.length-1,ne),k.push(W[0].x),k.push(W[0].y);for(var se=1;se<W.length;se++)this.layoutVertexArray.emplaceBack(W[se].x,W[se].y),this.indexArray2.emplaceBack(ne+se-1,ne+se),k.push(W[se].x),k.push(W[se].y);te.vertexLength+=W.length,te.primitiveLength+=W.length}}for(var ce=Qc(k,N),ve=0;ve<ce.length;ve+=3)this.indexArray.emplaceBack(C+ce[ve],C+ce[ve+1],C+ce[ve+2]);T.vertexLength+=_,T.primitiveLength+=ce.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Ve("FillBucket",pn,{omit:["layers","patternFeatures"]});var Hv=new Lr({"fill-sort-key":new qe(B.layout_fill["fill-sort-key"])}),Kv={paint:new Lr({"fill-antialias":new Ze(B.paint_fill["fill-antialias"]),"fill-opacity":new qe(B.paint_fill["fill-opacity"]),"fill-color":new qe(B.paint_fill["fill-color"]),"fill-outline-color":new qe(B.paint_fill["fill-outline-color"]),"fill-translate":new Ze(B.paint_fill["fill-translate"]),"fill-translate-anchor":new Ze(B.paint_fill["fill-translate-anchor"]),"fill-pattern":new cs(B.paint_fill["fill-pattern"])}),layout:Hv},Yv=function(e){function t(r){e.call(this,r,Kv)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var u=this.paint._values["fill-outline-color"];u.value.kind==="constant"&&u.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new pn(r)},t.prototype.queryRadius=function(){return br(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,m,_){return $i(cn(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),m.angle,_),c)},t.prototype.isTileClipped=function(){return!0},t}(Ki),Jv=Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,gf=gs;function gs(e,t,r,a,u){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=u,e.readFields(Qv,this,t)}function Qv(e,t,r){e==1?t.id=r.readVarint():e==2?function(a,u){for(var c=a.readVarint()+a.pos;a.pos<c;){var h=u._keys[a.readVarint()],m=u._values[a.readVarint()];u.properties[h]=m}}(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function eg(e){for(var t,r,a=0,u=0,c=e.length,h=c-1;u<c;h=u++)a+=((r=e[h]).x-(t=e[u]).x)*(t.y+r.y);return a}gs.types=["Unknown","Point","LineString","Polygon"],gs.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,u=0,c=0,h=0,m=[];e.pos<r;){if(u<=0){var _=e.readVarint();a=7&_,u=_>>3}if(u--,a===1||a===2)c+=e.readSVarint(),h+=e.readSVarint(),a===1&&(t&&m.push(t),t=[]),t.push(new me(c,h));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},gs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,u=0,c=0,h=1/0,m=-1/0,_=1/0,x=-1/0;e.pos<t;){if(a<=0){var w=e.readVarint();r=7&w,a=w>>3}if(a--,r===1||r===2)(u+=e.readSVarint())<h&&(h=u),u>m&&(m=u),(c+=e.readSVarint())<_&&(_=c),c>x&&(x=c);else if(r!==7)throw new Error("unknown command "+r)}return[h,_,m,x]},gs.prototype.toGeoJSON=function(e,t,r){var a,u,c=this.extent*Math.pow(2,r),h=this.extent*e,m=this.extent*t,_=this.loadGeometry(),x=gs.types[this.type];function w(k){for(var N=0;N<k.length;N++){var U=k[N];k[N]=[360*(U.x+h)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*(U.y+m)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<_.length;a++)T[a]=_[a][0];w(_=T);break;case 2:for(a=0;a<_.length;a++)w(_[a]);break;case 3:for(_=function(k){var N=k.length;if(N<=1)return[k];for(var U,K,W=[],te=0;te<N;te++){var ne=eg(k[te]);ne!==0&&(K===void 0&&(K=ne<0),K===ne<0?(U&&W.push(U),U=[k[te]]):U.push(k[te]))}return U&&W.push(U),W}(_),a=0;a<_.length;a++)for(u=0;u<_[a].length;u++)w(_[a][u])}_.length===1?_=_[0]:x="Multi"+x;var C={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(C.id=this.id),C};var _f=xf;function xf(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(tg,this,t),this.length=this._features.length}function tg(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(function(a){for(var u=null,c=a.readVarint()+a.pos;a.pos<c;){var h=a.readVarint()>>3;u=h===1?a.readString():h===2?a.readFloat():h===3?a.readDouble():h===4?a.readVarint64():h===5?a.readVarint():h===6?a.readSVarint():h===7?a.readBoolean():null}return u}(r))}function rg(e,t,r){if(e===3){var a=new _f(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}xf.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new gf(this._pbf,t,this.extent,this._keys,this._values)};var _s={VectorTile:function(e,t){this.layers=e.readFields(rg,{},t)},VectorTileFeature:gf,VectorTileLayer:_f},ig=_s.VectorTileFeature.types,ap=Math.pow(2,13);function Al(e,t,r,a,u,c,h,m){e.emplaceBack(t,r,2*Math.floor(a*ap)+h,u*ap*2,c*ap*2,Math.round(m))}var hn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new un,this.indexArray=new Pn,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new D,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function ng(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}hn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=np("fill-extrusion",this.layers,t);for(var a=0,u=e;a<u.length;a+=1){var c=u[a],h=c.feature,m=c.id,_=c.index,x=c.sourceLayerIndex,w=this.layers[0]._featureFilter.needGeometry,T=ar(h,w);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),T,r)){var C={id:m,sourceLayerIndex:x,index:_,geometry:w?T.geometry:Yt(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(op("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,_,r,{}),t.featureIndex.insert(h,C.geometry,_,x,this.index,!0)}}},hn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.features;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},hn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},hn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},hn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},hn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Jv),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},hn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},hn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,h=ip(t,500);c<h.length;c+=1){for(var m=h[c],_=0,x=0,w=m;x<w.length;x+=1)_+=w[x].length;for(var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,k=m;C<k.length;C+=1){var N=k[C];if(N.length!==0&&!((ct=N).every(function(ot){return ot.x<0})||ct.every(function(ot){return ot.x>8192})||ct.every(function(ot){return ot.y<0})||ct.every(function(ot){return ot.y>8192})))for(var U=0,K=0;K<N.length;K++){var W=N[K];if(K>=1){var te=N[K-1];if(!ng(W,te)){T.vertexLength+4>D.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var ne=W.sub(te)._perp()._unit(),se=te.dist(W);U+se>32768&&(U=0),Al(this.layoutVertexArray,W.x,W.y,ne.x,ne.y,0,0,U),Al(this.layoutVertexArray,W.x,W.y,ne.x,ne.y,0,1,U),Al(this.layoutVertexArray,te.x,te.y,ne.x,ne.y,0,0,U+=se),Al(this.layoutVertexArray,te.x,te.y,ne.x,ne.y,0,1,U);var ce=T.vertexLength;this.indexArray.emplaceBack(ce,ce+2,ce+1),this.indexArray.emplaceBack(ce+1,ce+2,ce+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+_>D.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),ig[e.type]==="Polygon"){for(var ve=[],Se=[],Ae=T.vertexLength,$e=0,Me=m;$e<Me.length;$e+=1){var We=Me[$e];if(We.length!==0){We!==m[0]&&Se.push(ve.length/2);for(var Be=0;Be<We.length;Be++){var lt=We[Be];Al(this.layoutVertexArray,lt.x,lt.y,0,0,1,1,0),ve.push(lt.x),ve.push(lt.y)}}}for(var Qe=Qc(ve,Se),je=0;je<Qe.length;je+=3)this.indexArray.emplaceBack(Ae+Qe[je],Ae+Qe[je+2],Ae+Qe[je+1]);T.primitiveLength+=Qe.length/3,T.vertexLength+=_}}var ct;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Ve("FillExtrusionBucket",hn,{omit:["layers","features"]});var og={paint:new Lr({"fill-extrusion-opacity":new Ze(B["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qe(B["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ze(B["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ze(B["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new cs(B["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qe(B["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qe(B["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ze(B["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ag=function(e){function t(r){e.call(this,r,og)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new hn(r)},t.prototype.queryRadius=function(){return br(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,m,_,x){var w=cn(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),m.angle,_),T=this.paint.get("fill-extrusion-height").evaluate(a,u),C=this.paint.get("fill-extrusion-base").evaluate(a,u),k=function(U,K,W,te){for(var ne=[],se=0,ce=U;se<ce.length;se+=1){var ve=ce[se],Se=[ve.x,ve.y,0,1];ms(Se,Se,K),ne.push(new me(Se[0]/Se[3],Se[1]/Se[3]))}return ne}(w,x),N=function(U,K,W,te){for(var ne=[],se=[],ce=te[8]*K,ve=te[9]*K,Se=te[10]*K,Ae=te[11]*K,$e=te[8]*W,Me=te[9]*W,We=te[10]*W,Be=te[11]*W,lt=0,Qe=U;lt<Qe.length;lt+=1){for(var je=[],ct=[],ot=0,_t=Qe[lt];ot<_t.length;ot+=1){var Xe=_t[ot],wt=Xe.x,Xt=Xe.y,er=te[0]*wt+te[4]*Xt+te[12],Jt=te[1]*wt+te[5]*Xt+te[13],Ht=te[2]*wt+te[6]*Xt+te[14],tr=te[3]*wt+te[7]*Xt+te[15],wr=Ht+Se,Sr=tr+Ae,Wr=er+$e,kr=Jt+Me,Xr=Ht+We,sr=tr+Be,Mr=new me((er+ce)/Sr,(Jt+ve)/Sr);Mr.z=wr/Sr,je.push(Mr);var ft=new me(Wr/sr,kr/sr);ft.z=Xr/sr,ct.push(ft)}ne.push(je),se.push(ct)}return[ne,se]}(c,C,T,x);return function(U,K,W){var te=1/0;$i(W,K)&&(te=bf(W,K[0]));for(var ne=0;ne<K.length;ne++)for(var se=K[ne],ce=U[ne],ve=0;ve<se.length-1;ve++){var Se=se[ve],Ae=[Se,se[ve+1],ce[ve+1],ce[ve],Se];zn(W,Ae)&&(te=Math.min(te,bf(W,Ae)))}return te!==1/0&&te}(N[0],N[1],k)},t}(Ki);function Cl(e,t){return e.x*t.x+e.y*t.y}function bf(e,t){if(e.length===1){for(var r,a=0,u=t[a++];!r||u.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],h=e[0],m=r.sub(u),_=c.sub(u),x=h.sub(u),w=Cl(m,m),T=Cl(m,_),C=Cl(_,_),k=Cl(x,m),N=Cl(x,_),U=w*C-T*T,K=(C*k-T*N)/U,W=(w*N-T*k)/U,te=u.z*(1-K-W)+r.z*K+c.z*W;if(isFinite(te))return te}return 1/0}for(var ne=1/0,se=0,ce=t;se<ce.length;se+=1)ne=Math.min(ne,ce[se].z);return ne}var sg=Ar([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,lg=Ar([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,ug=_s.VectorTileFeature.types,cg=Math.cos(Math.PI/180*37.5),wf=Math.pow(2,14)/.5,ti=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(r){return r.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(r){t.gradients[r.id]={}}),this.layoutVertexArray=new ui,this.layoutVertexArray2=new No,this.indexArray=new Pn,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new D,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(r){return r.isStateDependent()}).map(function(r){return r.id})};ti.prototype.populate=function(e,t,r){this.hasPattern=np("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),u=[],c=0,h=e;c<h.length;c+=1){var m=h[c],_=m.feature,x=m.id,w=m.index,T=m.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,k=ar(_,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),k,r)){var N=a?a.evaluate(k,{},r):void 0,U={id:x,properties:_.properties,type:_.type,sourceLayerIndex:T,index:w,geometry:C?k.geometry:Yt(_),patterns:{},sortKey:N};u.push(U)}}a&&u.sort(function(Se,Ae){return Se.sortKey-Ae.sortKey});for(var K=0,W=u;K<W.length;K+=1){var te=W[K],ne=te.geometry,se=te.index,ce=te.sourceLayerIndex;if(this.hasPattern){var ve=op("line",this.layers,te,this.zoom,t);this.patternFeatures.push(ve)}else this.addFeature(te,ne,se,r,{});t.featureIndex.insert(e[se].feature,ne,se,ce,this.index)}},ti.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},ti.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},ti.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ti.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ti.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,lg)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sg),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},ti.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ti.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},ti.prototype.addFeature=function(e,t,r,a,u){var c=this.layers[0].layout,h=c.get("line-join").evaluate(e,{}),m=c.get("line-cap"),_=c.get("line-miter-limit"),x=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var w=0,T=t;w<T.length;w+=1)this.addLine(T[w],e,h,m,_,x);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},ti.prototype.addLine=function(e,t,r,a,u,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var h=0;h<e.length-1;h++)this.totalDistance+=e[h].dist(e[h+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var m=ug[t.type]==="Polygon",_=e.length;_>=2&&e[_-1].equals(e[_-2]);)_--;for(var x=0;x<_-1&&e[x].equals(e[x+1]);)x++;if(!(_<(m?3:2))){r==="bevel"&&(u=1.05);var w,T=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray),k=void 0,N=void 0,U=void 0,K=void 0;this.e1=this.e2=-1,m&&(K=e[x].sub(w=e[_-2])._unit()._perp());for(var W=x;W<_;W++)if(!(N=W===_-1?m?e[x+1]:void 0:e[W+1])||!e[W].equals(N)){K&&(U=K),w&&(k=w),w=e[W],K=N?N.sub(w)._unit()._perp():U;var te=(U=U||K).add(K);te.x===0&&te.y===0||te._unit();var ne=U.x*K.x+U.y*K.y,se=te.x*K.x+te.y*K.y,ce=se!==0?1/se:1/0,ve=2*Math.sqrt(2-2*se),Se=se<cg&&k&&N,Ae=U.x*K.y-U.y*K.x>0;if(Se&&W>x){var $e=w.dist(k);if($e>2*T){var Me=w.sub(w.sub(k)._mult(T/$e)._round());this.updateDistance(k,Me),this.addCurrentVertex(Me,U,0,0,C),k=Me}}var We=k&&N,Be=We?r:m?"butt":a;if(We&&Be==="round"&&(ce<c?Be="miter":ce<=2&&(Be="fakeround")),Be==="miter"&&ce>u&&(Be="bevel"),Be==="bevel"&&(ce>2&&(Be="flipbevel"),ce<u&&(Be="miter")),k&&this.updateDistance(k,w),Be==="miter")te._mult(ce),this.addCurrentVertex(w,te,0,0,C);else if(Be==="flipbevel"){if(ce>100)te=K.mult(-1);else{var lt=ce*U.add(K).mag()/U.sub(K).mag();te._perp()._mult(lt*(Ae?-1:1))}this.addCurrentVertex(w,te,0,0,C),this.addCurrentVertex(w,te.mult(-1),0,0,C)}else if(Be==="bevel"||Be==="fakeround"){var Qe=-Math.sqrt(ce*ce-1),je=Ae?Qe:0,ct=Ae?0:Qe;if(k&&this.addCurrentVertex(w,U,je,ct,C),Be==="fakeround")for(var ot=Math.round(180*ve/Math.PI/20),_t=1;_t<ot;_t++){var Xe=_t/ot;if(Xe!==.5){var wt=Xe-.5;Xe+=Xe*wt*(Xe-1)*((1.0904+ne*(ne*(3.55645-1.43519*ne)-3.2452))*wt*wt+(.848013+ne*(.215638*ne-1.06021)))}var Xt=K.sub(U)._mult(Xe)._add(U)._unit()._mult(Ae?-1:1);this.addHalfVertex(w,Xt.x,Xt.y,!1,Ae,0,C)}N&&this.addCurrentVertex(w,K,-je,-ct,C)}else if(Be==="butt")this.addCurrentVertex(w,te,0,0,C);else if(Be==="square"){var er=k?1:-1;this.addCurrentVertex(w,te,er,er,C)}else Be==="round"&&(k&&(this.addCurrentVertex(w,U,0,0,C),this.addCurrentVertex(w,U,1,1,C,!0)),N&&(this.addCurrentVertex(w,K,-1,-1,C,!0),this.addCurrentVertex(w,K,0,0,C)));if(Se&&W<_-1){var Jt=w.dist(N);if(Jt>2*T){var Ht=w.add(N.sub(w)._mult(T/Jt)._round());this.updateDistance(w,Ht),this.addCurrentVertex(Ht,K,0,0,C),w=Ht}}}}},ti.prototype.addCurrentVertex=function(e,t,r,a,u,c){c===void 0&&(c=!1);var h=t.y*a-t.x,m=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,u),this.addHalfVertex(e,h,m,c,!0,-a,u),this.distance>wf/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,u,c))},ti.prototype.addHalfVertex=function(e,t,r,a,u,c,h){var m=.5*(this.lineClips?this.scaledDistance*(wf-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(u?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&m)<<2,m>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var _=h.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,_),h.primitiveLength++),u?this.e2=_:this.e1=_},ti.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ti.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Ve("LineBucket",ti,{omit:["layers","patternFeatures"]});var pg=new Lr({"line-cap":new Ze(B.layout_line["line-cap"]),"line-join":new qe(B.layout_line["line-join"]),"line-miter-limit":new Ze(B.layout_line["line-miter-limit"]),"line-round-limit":new Ze(B.layout_line["line-round-limit"]),"line-sort-key":new qe(B.layout_line["line-sort-key"])}),Sf={paint:new Lr({"line-opacity":new qe(B.paint_line["line-opacity"]),"line-color":new qe(B.paint_line["line-color"]),"line-translate":new Ze(B.paint_line["line-translate"]),"line-translate-anchor":new Ze(B.paint_line["line-translate-anchor"]),"line-width":new qe(B.paint_line["line-width"]),"line-gap-width":new qe(B.paint_line["line-gap-width"]),"line-offset":new qe(B.paint_line["line-offset"]),"line-blur":new qe(B.paint_line["line-blur"]),"line-dasharray":new $r(B.paint_line["line-dasharray"]),"line-pattern":new cs(B.paint_line["line-pattern"]),"line-gradient":new ji(B.paint_line["line-gradient"])}),layout:pg},Tf=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new ht(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,u,c){return a=Ye({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,u,c)},t}(qe))(Sf.paint.properties["line-width"].specification);Tf.useIntegerZoom=!0;var hg=function(e){function t(r){e.call(this,r,Sf),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ni,this.gradientVersion=(this.gradientVersion+1)%ge)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=Tf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new ti(r)},t.prototype.queryRadius=function(r){var a=r,u=If(Qi("line-width",this,a),Qi("line-gap-width",this,a)),c=Qi("line-offset",this,a);return u/2+Math.abs(c)+br(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,h,m,_){var x=cn(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,_),w=_/2*If(this.paint.get("line-width").evaluate(a,u),this.paint.get("line-gap-width").evaluate(a,u)),T=this.paint.get("line-offset").evaluate(a,u);return T&&(c=function(C,k){for(var N=[],U=new me(0,0),K=0;K<C.length;K++){for(var W=C[K],te=[],ne=0;ne<W.length;ne++){var se=W[ne],ce=W[ne+1],ve=ne===0?U:se.sub(W[ne-1])._unit()._perp(),Se=ne===W.length-1?U:ce.sub(se)._unit()._perp(),Ae=ve._add(Se)._unit();Ae._mult(1/(Ae.x*Se.x+Ae.y*Se.y)),te.push(Ae._mult(k)._add(se))}N.push(te)}return N}(c,T*_)),function(C,k,N){for(var U=0;U<k.length;U++){var K=k[U];if(C.length>=3){for(var W=0;W<K.length;W++)if(Ji(C,K[W]))return!0}if(ki(C,K,N))return!0}return!1}(x,c,w)},t.prototype.isTileClipped=function(){return!0},t}(Ki);function If(e,t){return t>0?t+2*e:e}var fg=Ar([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),dg=Ar([{name:"a_projected_pos",components:3,type:"Float32"}],4),mg=(Ar([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ar([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Ef=(Ar([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ar([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),yg=Ar([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function vg(e,t,r){return e.sections.forEach(function(a){a.text=function(u,c,h){var m=c.layout.get("text-transform").evaluate(h,{});return m==="uppercase"?u=u.toLocaleUpperCase():m==="lowercase"&&(u=u.toLocaleLowerCase()),mi.applyArabicShaping&&(u=mi.applyArabicShaping(u)),u}(a.text,t,r)}),e}Ar([{name:"triangle",components:3,type:"Uint16"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ar([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ar([{type:"Float32",name:"offsetX"}]),Ar([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Pl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Af=function(e,t,r,a,u){var c,h,m=8*u-a-1,_=(1<<m)-1,x=_>>1,w=-7,T=u-1,C=-1,k=e[t+T];for(T+=C,c=k&(1<<-w)-1,k>>=-w,w+=m;w>0;c=256*c+e[t+T],T+=C,w-=8);for(h=c&(1<<-w)-1,c>>=-w,w+=a;w>0;h=256*h+e[t+T],T+=C,w-=8);if(c===0)c=1-x;else{if(c===_)return h?NaN:1/0*(k?-1:1);h+=Math.pow(2,a),c-=x}return(k?-1:1)*h*Math.pow(2,c-a)},Cf=function(e,t,r,a,u,c){var h,m,_,x=8*c-u-1,w=(1<<x)-1,T=w>>1,C=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=0,N=1,U=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,h=w):(h=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-h))<1&&(h--,_*=2),(t+=h+T>=1?C/_:C*Math.pow(2,1-T))*_>=2&&(h++,_/=2),h+T>=w?(m=0,h=w):h+T>=1?(m=(t*_-1)*Math.pow(2,u),h+=T):(m=t*Math.pow(2,T-1)*Math.pow(2,u),h=0));u>=8;e[r+k]=255&m,k+=N,m/=256,u-=8);for(h=h<<u|m,x+=u;x>0;e[r+k]=255&h,k+=N,h/=256,x-=8);e[r+k-N]|=128*U},Lu=jt;function jt(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}jt.Varint=0,jt.Fixed64=1,jt.Bytes=2,jt.Fixed32=5;var Pf=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function mo(e){return e.type===jt.Bytes?e.readVarint()+e.pos:e.pos+1}function xs(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function kf(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var u=r.pos-1;u>=e;u--)r.buf[u+a]=r.buf[u]}function gg(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function _g(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function xg(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function bg(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function wg(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Sg(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Tg(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Ig(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Eg(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Ru(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function bs(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Mf(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ag(e,t,r){e===1&&r.readMessage(Cg,t)}function Cg(e,t,r){if(e===3){var a=r.readMessage(Pg,{}),u=a.width,c=a.height,h=a.left,m=a.top,_=a.advance;t.push({id:a.id,bitmap:new za({width:u+6,height:c+6},a.bitmap),metrics:{width:u,height:c,left:h,top:m,advance:_}})}}function Pg(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function zf(e){for(var t=0,r=0,a=0,u=e;a<u.length;a+=1){var c=u[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort(function(U,K){return K.h-U.h});for(var h=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],m=0,_=0,x=0,w=e;x<w.length;x+=1)for(var T=w[x],C=h.length-1;C>=0;C--){var k=h[C];if(!(T.w>k.w||T.h>k.h)){if(T.x=k.x,T.y=k.y,_=Math.max(_,T.y+T.h),m=Math.max(m,T.x+T.w),T.w===k.w&&T.h===k.h){var N=h.pop();C<h.length&&(h[C]=N)}else T.h===k.h?(k.x+=T.w,k.w-=T.w):T.w===k.w?(k.y+=T.h,k.h-=T.h):(h.push({x:k.x+T.w,y:k.y,w:k.w-T.w,h:T.h}),k.y+=T.h,k.h-=T.h);break}}return{w:m,h:_,fill:t/(m*_)||0}}jt.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),u=a>>3,c=this.pos;this.type=7&a,e(u,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Ru(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Mf(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Ru(this.buf,this.pos)+4294967296*Ru(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=Ru(this.buf,this.pos)+4294967296*Mf(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=Af(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Af(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(u,c,h){var m,_,x=h.buf;if(m=(112&(_=x[h.pos++]))>>4,_<128||(m|=(127&(_=x[h.pos++]))<<3,_<128)||(m|=(127&(_=x[h.pos++]))<<10,_<128)||(m|=(127&(_=x[h.pos++]))<<17,_<128)||(m|=(127&(_=x[h.pos++]))<<24,_<128)||(m|=(1&(_=x[h.pos++]))<<31,_<128))return xs(u,m,c);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Pf?function(r,a,u){return Pf.decode(r.subarray(a,u))}(this.buf,t,e):function(r,a,u){for(var c="",h=a;h<u;){var m,_,x,w=r[h],T=null,C=w>239?4:w>223?3:w>191?2:1;if(h+C>u)break;C===1?w<128&&(T=w):C===2?(192&(m=r[h+1]))==128&&(T=(31&w)<<6|63&m)<=127&&(T=null):C===3?(_=r[h+2],(192&(m=r[h+1]))==128&&(192&_)==128&&((T=(15&w)<<12|(63&m)<<6|63&_)<=2047||T>=55296&&T<=57343)&&(T=null)):C===4&&(_=r[h+2],x=r[h+3],(192&(m=r[h+1]))==128&&(192&_)==128&&(192&x)==128&&((T=(15&w)<<18|(63&m)<<12|(63&_)<<6|63&x)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,C=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),h+=C}return c}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==jt.Bytes)return e.push(this.readVarint(t));var r=mo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==jt.Bytes)return e.push(this.readSVarint());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==jt.Bytes)return e.push(this.readBoolean());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==jt.Bytes)return e.push(this.readFloat());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==jt.Bytes)return e.push(this.readDouble());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==jt.Bytes)return e.push(this.readFixed32());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==jt.Bytes)return e.push(this.readSFixed32());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==jt.Bytes)return e.push(this.readFixed64());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==jt.Bytes)return e.push(this.readSFixed64());var t=mo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===jt.Varint)for(;this.buf[this.pos++]>127;);else if(t===jt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===jt.Fixed32)this.pos+=4;else{if(t!==jt.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),bs(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),bs(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),bs(this.buf,-1&e,this.pos),bs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),bs(this.buf,-1&e,this.pos),bs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(t,r){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(c,h,m){m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,c>>>=7,m.buf[m.pos++]=127&c|128,m.buf[m.pos]=127&(c>>>=7)}(a,0,r),function(c,h){var m=(7&c)<<4;h.buf[h.pos++]|=m|((c>>>=3)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c|((c>>>=7)?128:0),c&&(h.buf[h.pos++]=127&c)))))}(u,r)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(a,u,c){for(var h,m,_=0;_<u.length;_++){if((h=u.charCodeAt(_))>55295&&h<57344){if(!m){h>56319||_+1===u.length?(a[c++]=239,a[c++]=191,a[c++]=189):m=h;continue}if(h<56320){a[c++]=239,a[c++]=191,a[c++]=189,m=h;continue}h=m-55296<<10|h-56320|65536,m=null}else m&&(a[c++]=239,a[c++]=191,a[c++]=189,m=null);h<128?a[c++]=h:(h<2048?a[c++]=h>>6|192:(h<65536?a[c++]=h>>12|224:(a[c++]=h>>18|240,a[c++]=h>>12&63|128),a[c++]=h>>6&63|128),a[c++]=63&h|128)}return c}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&kf(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Cf(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Cf(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&kf(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,jt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,gg,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,_g,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,wg,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,xg,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,bg,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Sg,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Tg,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Ig,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Eg,t)},writeBytesField:function(e,t){this.writeTag(e,jt.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,jt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,jt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,jt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,jt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,jt.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,jt.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,jt.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,jt.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,jt.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var Fu=function(e,t){var r=t.pixelRatio,a=t.version,u=t.stretchX,c=t.stretchY,h=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=u,this.stretchY=c,this.content=h,this.version=a},kl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};kl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},kl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},kl.tlbr.get=function(){return this.tl.concat(this.br)},kl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Fu.prototype,kl);var Ml=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var u=[];this.addImages(e,r,u),this.addImages(t,a,u);var c=zf(u),h=new pi({width:c.w||1,height:c.h||1});for(var m in e){var _=e[m],x=r[m].paddedRect;pi.copy(_.data,h,{x:0,y:0},{x:x.x+1,y:x.y+1},_.data)}for(var w in t){var T=t[w],C=a[w].paddedRect,k=C.x+1,N=C.y+1,U=T.data.width,K=T.data.height;pi.copy(T.data,h,{x:0,y:0},{x:k,y:N},T.data),pi.copy(T.data,h,{x:0,y:K-1},{x:k,y:N-1},{width:U,height:1}),pi.copy(T.data,h,{x:0,y:0},{x:k,y:N+K},{width:U,height:1}),pi.copy(T.data,h,{x:U-1,y:0},{x:k-1,y:N},{width:1,height:K}),pi.copy(T.data,h,{x:0,y:0},{x:k+U,y:N},{width:1,height:K})}this.image=h,this.iconPositions=r,this.patternPositions=a};Ml.prototype.addImages=function(e,t,r){for(var a in e){var u=e[a],c={x:0,y:0,w:u.data.width+2,h:u.data.height+2};r.push(c),t[a]=new Fu(c,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},Ml.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},Ml.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Ve("ImagePosition",Fu),Ve("ImageAtlas",Ml);var Mi={horizontal:1,vertical:2,horizontalOnly:3},ws=function(){this.scale=1,this.fontStack="",this.imageName=null};ws.forText=function(e,t){var r=new ws;return r.scale=e||1,r.fontStack=t,r},ws.forImage=function(e){var t=new ws;return t.imageName=e,t};var Gr=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Ou(e,t,r,a,u,c,h,m,_,x,w,T,C,k,N,U){var K,W=Gr.fromFeature(e,u);T===Mi.vertical&&W.verticalizePunctuation();var te=mi.processBidirectionalText,ne=mi.processStyledBidirectionalText;if(te&&W.sections.length===1){K=[];for(var se=0,ce=te(W.toString(),sp(W,x,c,t,a,k,N));se<ce.length;se+=1){var ve=ce[se],Se=new Gr;Se.text=ve,Se.sections=W.sections;for(var Ae=0;Ae<ve.length;Ae++)Se.sectionIndex.push(0);K.push(Se)}}else if(ne){K=[];for(var $e=0,Me=ne(W.text,W.sectionIndex,sp(W,x,c,t,a,k,N));$e<Me.length;$e+=1){var We=Me[$e],Be=new Gr;Be.text=We[0],Be.sectionIndex=We[1],Be.sections=W.sections,K.push(Be)}}else K=function(je,ct){for(var ot=[],_t=je.text,Xe=0,wt=0,Xt=ct;wt<Xt.length;wt+=1){var er=Xt[wt];ot.push(je.substring(Xe,er)),Xe=er}return Xe<_t.length&&ot.push(je.substring(Xe,_t.length)),ot}(W,sp(W,x,c,t,a,k,N));var lt=[],Qe={positionedLines:lt,text:W.toString(),top:w[1],bottom:w[1],left:w[0],right:w[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(je,ct,ot,_t,Xe,wt,Xt,er,Jt,Ht,tr,wr){for(var Sr=0,Wr=-17,kr=0,Xr=0,sr=er==="right"?1:er==="left"?0:.5,Mr=0,ft=0,Vt=Xe;ft<Vt.length;ft+=1){var Mt=Vt[ft];Mt.trim();var bt=Mt.getMaxScale(),ri=24*(bt-1),Fr={positionedGlyphs:[],lineOffset:0};je.positionedLines[Mr]=Fr;var $t=Fr.positionedGlyphs,dr=0;if(Mt.length()){for(var Or=0;Or<Mt.length();Or++){var St=Mt.getSection(Or),Ln=Mt.getSectionIndex(Or),zi=Mt.getCharCode(Or),Rn=0,lr=null,Fn=null,en=null,ks=24,Ra=!(Jt===Mi.horizontal||!tr&&!ss(zi)||tr&&(Vu[zi]||(_o=zi,Pe.Arabic(_o)||Pe["Arabic Supplement"](_o)||Pe["Arabic Extended-A"](_o)||Pe["Arabic Presentation Forms-A"](_o)||Pe["Arabic Presentation Forms-B"](_o))));if(St.imageName){var Ms=_t[St.imageName];if(!Ms)continue;en=St.imageName,je.iconsInText=je.iconsInText||!0,Fn=Ms.paddedRect;var go=Ms.displaySize;St.scale=24*St.scale/wr,Rn=ri+(24-go[1]*St.scale),ks=(lr={width:go[0],height:go[1],left:1,top:-3,advance:Ra?go[1]:go[0]}).advance;var zs=Ra?go[0]*St.scale-24*bt:go[1]*St.scale-24*bt;zs>0&&zs>dr&&(dr=zs)}else{var Xu=ot[St.fontStack],Bs=Xu&&Xu[zi];if(Bs&&Bs.rect)Fn=Bs.rect,lr=Bs.metrics;else{var Dl=ct[St.fontStack],Hu=Dl&&Dl[zi];if(!Hu)continue;lr=Hu.metrics}Rn=24*(bt-St.scale)}Ra?(je.verticalizable=!0,$t.push({glyph:zi,imageName:en,x:Sr,y:Wr+Rn,vertical:Ra,scale:St.scale,fontStack:St.fontStack,sectionIndex:Ln,metrics:lr,rect:Fn}),Sr+=ks*St.scale+Ht):($t.push({glyph:zi,imageName:en,x:Sr,y:Wr+Rn,vertical:Ra,scale:St.scale,fontStack:St.fontStack,sectionIndex:Ln,metrics:lr,rect:Fn}),Sr+=lr.advance*St.scale+Ht)}$t.length!==0&&(kr=Math.max(Sr-Ht,kr),Mg($t,0,$t.length-1,sr,dr)),Sr=0;var Ku=wt*bt+dr;Fr.lineOffset=Math.max(dr,ri),Wr+=Ku,Xr=Math.max(Ku,Xr),++Mr}else Wr+=wt,++Mr}var _o,Ll=Wr- -17,Ds=lp(Xt),Xo=Ds.horizontalAlign,Ls=Ds.verticalAlign;(function(Yu,Ju,Rl,Fl,Qu,Ol,Vl,Nl,ec){var Rs,tc=(Ju-Rl)*Qu;Rs=Ol!==Vl?-Nl*Fl- -17:(-Fl*ec+.5)*Vl;for(var Fs=0,Ul=Yu;Fs<Ul.length;Fs+=1)for(var Fa=0,ql=Ul[Fs].positionedGlyphs;Fa<ql.length;Fa+=1){var Os=ql[Fa];Os.x+=tc,Os.y+=Rs}})(je.positionedLines,sr,Xo,Ls,kr,Xr,wt,Ll,Xe.length),je.top+=-Ls*Ll,je.bottom=je.top+Ll,je.left+=-Xo*kr,je.right=je.left+kr}(Qe,t,r,a,K,h,m,_,T,x,C,U),!function(je){for(var ct=0,ot=je;ct<ot.length;ct+=1)if(ot[ct].positionedGlyphs.length!==0)return!1;return!0}(lt)&&Qe}Gr.fromFeature=function(e,t){for(var r=new Gr,a=0;a<e.sections.length;a++){var u=e.sections[a];u.image?r.addImageSection(u):r.addTextSection(u,t)}return r},Gr.prototype.length=function(){return this.text.length},Gr.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Gr.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Gr.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Gr.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,u=e.charCodeAt(r-1)||null;t+=a&&dl(a)&&!Pl[e[r+1]]||u&&dl(u)&&!Pl[e[r-1]]||!Pl[e[r]]?e[r]:Pl[e[r]]}return t}(this.text)},Gr.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&Vu[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&Vu[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Gr.prototype.substring=function(e,t){var r=new Gr;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Gr.prototype.toString=function(){return this.text},Gr.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce(function(t,r){return Math.max(t,e.sections[r].scale)},0)},Gr.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(ws.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Gr.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(ws.forImage(t)),this.sectionIndex.push(this.sections.length-1)):Lt("Reached maximum number of images 6401")}else Lt("Can't add FormattedSection with an empty image.")},Gr.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Vu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},vi={};function Bf(e,t,r,a,u,c){if(t.imageName){var h=a[t.imageName];return h?h.displaySize[0]*t.scale*24/c+u:0}var m=r[t.fontStack],_=m&&m[e];return _?_.metrics.advance*t.scale+u:0}function Df(e,t,r,a){var u=Math.pow(e-t,2);return a?e<t?u/2:2*u:u+Math.abs(r)*r}function kg(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function Lf(e,t,r,a,u,c){for(var h=null,m=Df(t,r,u,c),_=0,x=a;_<x.length;_+=1){var w=x[_],T=Df(t-w.x,r,u,c)+w.badness;T<=m&&(h=w,m=T)}return{index:e,x:t,priorBreak:h,badness:m}}function sp(e,t,r,a,u,c,h){if(c!=="point")return[];if(!e)return[];for(var m,_=[],x=function(K,W,te,ne,se,ce){for(var ve=0,Se=0;Se<K.length();Se++){var Ae=K.getSection(Se);ve+=Bf(K.getCharCode(Se),Ae,ne,se,W,ce)}return ve/Math.max(1,Math.ceil(ve/te))}(e,t,r,a,u,h),w=e.text.indexOf("")>=0,T=0,C=0;C<e.length();C++){var k=e.getSection(C),N=e.getCharCode(C);if(Vu[N]||(T+=Bf(N,k,a,u,t,h)),C<e.length()-1){var U=!((m=N)<11904||!(Pe["Bopomofo Extended"](m)||Pe.Bopomofo(m)||Pe["CJK Compatibility Forms"](m)||Pe["CJK Compatibility Ideographs"](m)||Pe["CJK Compatibility"](m)||Pe["CJK Radicals Supplement"](m)||Pe["CJK Strokes"](m)||Pe["CJK Symbols and Punctuation"](m)||Pe["CJK Unified Ideographs Extension A"](m)||Pe["CJK Unified Ideographs"](m)||Pe["Enclosed CJK Letters and Months"](m)||Pe["Halfwidth and Fullwidth Forms"](m)||Pe.Hiragana(m)||Pe["Ideographic Description Characters"](m)||Pe["Kangxi Radicals"](m)||Pe["Katakana Phonetic Extensions"](m)||Pe.Katakana(m)||Pe["Vertical Forms"](m)||Pe["Yi Radicals"](m)||Pe["Yi Syllables"](m)));(vi[N]||U||k.imageName)&&_.push(Lf(C+1,T,x,_,kg(N,e.getCharCode(C+1),U&&w),!1))}}return function K(W){return W?K(W.priorBreak).concat(W.index):[]}(Lf(e.length(),T,x,_,0,!0))}function lp(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Mg(e,t,r,a,u){if(a||u)for(var c=e[r],h=(e[r].x+c.metrics.advance*c.scale)*a,m=t;m<=r;m++)e[m].x-=h,e[m].y+=u}function Rf(e,t,r,a,u,c){var h,m=e.image;if(m.content){var _=m.content,x=m.pixelRatio||1;h=[_[0]/x,_[1]/x,m.displaySize[0]-_[2]/x,m.displaySize[1]-_[3]/x]}var w,T,C,k,N=t.left*c,U=t.right*c;r==="width"||r==="both"?(k=u[0]+N-a[3],T=u[0]+U+a[1]):T=(k=u[0]+(N+U-m.displaySize[0])/2)+m.displaySize[0];var K=t.top*c,W=t.bottom*c;return r==="height"||r==="both"?(w=u[1]+K-a[0],C=u[1]+W+a[2]):C=(w=u[1]+(K+W-m.displaySize[1])/2)+m.displaySize[1],{image:m,top:w,right:T,bottom:C,left:k,collisionPadding:h}}vi[10]=!0,vi[32]=!0,vi[38]=!0,vi[40]=!0,vi[41]=!0,vi[43]=!0,vi[45]=!0,vi[47]=!0,vi[173]=!0,vi[183]=!0,vi[8203]=!0,vi[8208]=!0,vi[8211]=!0,vi[8231]=!0;var Ss=function(e){function t(r,a,u,c){e.call(this,r,a),this.angle=u,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(me);function up(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ht(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,u=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var h=c=Math.max(0,c-1);h<a.length&&a[h]<e+1;)h++;h=Math.min(a.length-1,h);var m=a[c],_=a[h];return r.kind==="composite"?{kind:"composite",minZoom:m,maxZoom:_,interpolationType:u}:{kind:"camera",minZoom:m,maxZoom:_,minSize:r.evaluate(new ht(m)),maxSize:r.evaluate(new ht(_)),interpolationType:u}}function Ff(e,t,r){var a=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?hr(u/128,r.upperSize/128,t.uSizeT):a}function Of(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var u=e.interpolationType,c=u?Ne(Br.interpolationFactor(u,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=hr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Ve("Anchor",Ss);var zg=Object.freeze({__proto__:null,getSizeData:up,evaluateSizeForFeature:Ff,evaluateSizeForZoom:Of,SIZE_PACK_FACTOR:128});function Vf(e,t,r,a,u){if(t.segment===void 0)return!0;for(var c=t,h=t.segment+1,m=0;m>-r/2;){if(--h<0)return!1;m-=e[h].dist(c),c=e[h]}m+=e[h].dist(e[h+1]),h++;for(var _=[],x=0;m<r/2;){var w=e[h],T=e[h+1];if(!T)return!1;var C=e[h-1].angleTo(w)-w.angleTo(T);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:m,angleDelta:C}),x+=C;m-_[0].distance>a;)x-=_.shift().angleDelta;if(x>u)return!1;h++,m+=w.dist(T)}return!0}function Nf(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Uf(e,t,r){return e?.6*t*r:0}function qf(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Bg(e,t,r,a,u,c){for(var h=Uf(r,u,c),m=qf(r,a)*c,_=0,x=Nf(e)/2,w=0;w<e.length-1;w++){var T=e[w],C=e[w+1],k=T.dist(C);if(_+k>x){var N=(x-_)/k,U=hr(T.x,C.x,N),K=hr(T.y,C.y,N),W=new Ss(U,K,C.angleTo(T),w);return W._round(),!h||Vf(e,W,m,h,t)?W:void 0}_+=k}}function Dg(e,t,r,a,u,c,h,m,_){var x=Uf(a,c,h),w=qf(a,u),T=w*h,C=e[0].x===0||e[0].x===_||e[0].y===0||e[0].y===_;return t-T<t/4&&(t=T+t/4),function k(N,U,K,W,te,ne,se,ce,ve){for(var Se=ne/2,Ae=Nf(N),$e=0,Me=U-K,We=[],Be=0;Be<N.length-1;Be++){for(var lt=N[Be],Qe=N[Be+1],je=lt.dist(Qe),ct=Qe.angleTo(lt);Me+K<$e+je;){var ot=((Me+=K)-$e)/je,_t=hr(lt.x,Qe.x,ot),Xe=hr(lt.y,Qe.y,ot);if(_t>=0&&_t<ve&&Xe>=0&&Xe<ve&&Me-Se>=0&&Me+Se<=Ae){var wt=new Ss(_t,Xe,ct,Be);wt._round(),W&&!Vf(N,wt,ne,W,te)||We.push(wt)}}$e+=je}return ce||We.length||se||(We=k(N,$e/2,K,W,te,ne,se,!0,ve)),We}(e,C?t/2*m%t:(w/2+2*c)*h*m%t,t,x,r,T,C,!1,_)}function jf(e,t,r,a,u){for(var c=[],h=0;h<e.length;h++)for(var m=e[h],_=void 0,x=0;x<m.length-1;x++){var w=m[x],T=m[x+1];w.x<t&&T.x<t||(w.x<t?w=new me(t,w.y+(t-w.x)/(T.x-w.x)*(T.y-w.y))._round():T.x<t&&(T=new me(t,w.y+(t-w.x)/(T.x-w.x)*(T.y-w.y))._round()),w.y<r&&T.y<r||(w.y<r?w=new me(w.x+(r-w.y)/(T.y-w.y)*(T.x-w.x),r)._round():T.y<r&&(T=new me(w.x+(r-w.y)/(T.y-w.y)*(T.x-w.x),r)._round()),w.x>=a&&T.x>=a||(w.x>=a?w=new me(a,w.y+(a-w.x)/(T.x-w.x)*(T.y-w.y))._round():T.x>=a&&(T=new me(a,w.y+(a-w.x)/(T.x-w.x)*(T.y-w.y))._round()),w.y>=u&&T.y>=u||(w.y>=u?w=new me(w.x+(u-w.y)/(T.y-w.y)*(T.x-w.x),u)._round():T.y>=u&&(T=new me(w.x+(u-w.y)/(T.y-w.y)*(T.x-w.x),u)._round()),_&&w.equals(_[_.length-1])||c.push(_=[w]),_.push(T)))))}return c}function $f(e,t,r,a){var u=[],c=e.image,h=c.pixelRatio,m=c.paddedRect.w-2,_=c.paddedRect.h-2,x=e.right-e.left,w=e.bottom-e.top,T=c.stretchX||[[0,m]],C=c.stretchY||[[0,_]],k=function(_t,Xe){return _t+Xe[1]-Xe[0]},N=T.reduce(k,0),U=C.reduce(k,0),K=m-N,W=_-U,te=0,ne=N,se=0,ce=U,ve=0,Se=K,Ae=0,$e=W;if(c.content&&a){var Me=c.content;te=Nu(T,0,Me[0]),se=Nu(C,0,Me[1]),ne=Nu(T,Me[0],Me[2]),ce=Nu(C,Me[1],Me[3]),ve=Me[0]-te,Ae=Me[1]-se,Se=Me[2]-Me[0]-ne,$e=Me[3]-Me[1]-ce}var We=function(_t,Xe,wt,Xt){var er=Uu(_t.stretch-te,ne,x,e.left),Jt=qu(_t.fixed-ve,Se,_t.stretch,N),Ht=Uu(Xe.stretch-se,ce,w,e.top),tr=qu(Xe.fixed-Ae,$e,Xe.stretch,U),wr=Uu(wt.stretch-te,ne,x,e.left),Sr=qu(wt.fixed-ve,Se,wt.stretch,N),Wr=Uu(Xt.stretch-se,ce,w,e.top),kr=qu(Xt.fixed-Ae,$e,Xt.stretch,U),Xr=new me(er,Ht),sr=new me(wr,Ht),Mr=new me(wr,Wr),ft=new me(er,Wr),Vt=new me(Jt/h,tr/h),Mt=new me(Sr/h,kr/h),bt=t*Math.PI/180;if(bt){var ri=Math.sin(bt),Fr=Math.cos(bt),$t=[Fr,-ri,ri,Fr];Xr._matMult($t),sr._matMult($t),ft._matMult($t),Mr._matMult($t)}var dr=_t.stretch+_t.fixed,Or=Xe.stretch+Xe.fixed;return{tl:Xr,tr:sr,bl:ft,br:Mr,tex:{x:c.paddedRect.x+1+dr,y:c.paddedRect.y+1+Or,w:wt.stretch+wt.fixed-dr,h:Xt.stretch+Xt.fixed-Or},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vt,pixelOffsetBR:Mt,minFontScaleX:Se/h/x,minFontScaleY:$e/h/w,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var Be=Zf(T,K,N),lt=Zf(C,W,U),Qe=0;Qe<Be.length-1;Qe++)for(var je=Be[Qe],ct=Be[Qe+1],ot=0;ot<lt.length-1;ot++)u.push(We(je,lt[ot],ct,lt[ot+1]));else u.push(We({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:_+1}));return u}function Nu(e,t,r){for(var a=0,u=0,c=e;u<c.length;u+=1){var h=c[u];a+=Math.max(t,Math.min(r,h[1]))-Math.max(t,Math.min(r,h[0]))}return a}function Zf(e,t,r){for(var a=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var h=c[u],m=h[0],_=h[1],x=a[a.length-1];a.push({fixed:m-x.stretch,stretch:x.stretch}),a.push({fixed:m-x.stretch,stretch:x.stretch+(_-m)})}return a.push({fixed:t+1,stretch:r}),a}function Uu(e,t,r,a){return e/t*r+a}function qu(e,t,r,a){return e-t*r/a}var ju=function(e,t,r,a,u,c,h,m,_,x){if(this.boxStartIndex=e.length,_){var w=c.top,T=c.bottom,C=c.collisionPadding;C&&(w-=C[1],T+=C[3]);var k=T-w;k>0&&(k=Math.max(10,k),this.circleDiameter=k)}else{var N=c.top*h-m,U=c.bottom*h+m,K=c.left*h-m,W=c.right*h+m,te=c.collisionPadding;if(te&&(K-=te[0]*h,N-=te[1]*h,W+=te[2]*h,U+=te[3]*h),x){var ne=new me(K,N),se=new me(W,N),ce=new me(K,U),ve=new me(W,U),Se=x*Math.PI/180;ne._rotate(Se),se._rotate(Se),ce._rotate(Se),ve._rotate(Se),K=Math.min(ne.x,se.x,ce.x,ve.x),W=Math.max(ne.x,se.x,ce.x,ve.x),N=Math.min(ne.y,se.y,ce.y,ve.y),U=Math.max(ne.y,se.y,ce.y,ve.y)}e.emplaceBack(t.x,t.y,K,N,W,U,r,a,u)}this.boxEndIndex=e.length},Ts=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Lg),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Lg(e,t){return e<t?-1:e>t?1:0}function Rg(e,t,r){r===void 0&&(r=!1);for(var a=1/0,u=1/0,c=-1/0,h=-1/0,m=e[0],_=0;_<m.length;_++){var x=m[_];(!_||x.x<a)&&(a=x.x),(!_||x.y<u)&&(u=x.y),(!_||x.x>c)&&(c=x.x),(!_||x.y>h)&&(h=x.y)}var w=Math.min(c-a,h-u),T=w/2,C=new Ts([],Fg);if(w===0)return new me(a,u);for(var k=a;k<c;k+=w)for(var N=u;N<h;N+=w)C.push(new Is(k+T,N+T,T,e));for(var U=function(te){for(var ne=0,se=0,ce=0,ve=te[0],Se=0,Ae=ve.length,$e=Ae-1;Se<Ae;$e=Se++){var Me=ve[Se],We=ve[$e],Be=Me.x*We.y-We.x*Me.y;se+=(Me.x+We.x)*Be,ce+=(Me.y+We.y)*Be,ne+=3*Be}return new Is(se/ne,ce/ne,0,te)}(e),K=C.length;C.length;){var W=C.pop();(W.d>U.d||!U.d)&&(U=W,r&&console.log("found best %d after %d probes",Math.round(1e4*W.d)/1e4,K)),W.max-U.d<=t||(C.push(new Is(W.p.x-(T=W.h/2),W.p.y-T,T,e)),C.push(new Is(W.p.x+T,W.p.y-T,T,e)),C.push(new Is(W.p.x-T,W.p.y+T,T,e)),C.push(new Is(W.p.x+T,W.p.y+T,T,e)),K+=4)}return r&&(console.log("num probes: "+K),console.log("best distance: "+U.d)),U.p}function Fg(e,t){return t.max-e.max}function Is(e,t,r,a){this.p=new me(e,t),this.h=r,this.d=function(u,c){for(var h=!1,m=1/0,_=0;_<c.length;_++)for(var x=c[_],w=0,T=x.length,C=T-1;w<T;C=w++){var k=x[w],N=x[C];k.y>u.y!=N.y>u.y&&u.x<(N.x-k.x)*(u.y-k.y)/(N.y-k.y)+k.x&&(h=!h),m=Math.min(m,$o(u,k,N))}return(h?1:-1)*Math.sqrt(m)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}Ts.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Ts.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Ts.prototype.peek=function(){return this.data[0]},Ts.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var u=e-1>>1,c=t[u];if(r(a,c)>=0)break;t[e]=c,e=u}t[e]=a},Ts.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,u=t[e];e<a;){var c=1+(e<<1),h=t[c],m=c+1;if(m<this.length&&r(t[m],h)<0&&(c=m,h=t[m]),r(h,u)>=0)break;t[e]=h,e=c}t[e]=u};var cp=Number.POSITIVE_INFINITY;function Gf(e,t){return t[1]!==cp?function(r,a,u){var c=0,h=0;switch(a=Math.abs(a),u=Math.abs(u),r){case"top-right":case"top-left":case"top":h=u-7;break;case"bottom-right":case"bottom-left":case"bottom":h=7-u}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,h]}(e,t[0],t[1]):function(r,a){var u=0,c=0;a<0&&(a=0);var h=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=h-7;break;case"bottom-right":case"bottom-left":c=7-h;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":u=-h;break;case"top-left":case"bottom-left":u=h;break;case"left":u=a;break;case"right":u=-a}return[u,c]}(e,t[0])}function pp(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Wf(e,t,r,a,u,c,h,m,_,x,w,T,C,k,N){var U=function(se,ce,ve,Se,Ae,$e,Me,We){for(var Be=Se.layout.get("text-rotate").evaluate($e,{})*Math.PI/180,lt=[],Qe=0,je=ce.positionedLines;Qe<je.length;Qe+=1)for(var ct=je[Qe],ot=0,_t=ct.positionedGlyphs;ot<_t.length;ot+=1){var Xe=_t[ot];if(Xe.rect){var wt=Xe.rect||{},Xt=4,er=!0,Jt=1,Ht=0,tr=(Ae||We)&&Xe.vertical,wr=Xe.metrics.advance*Xe.scale/2;if(We&&ce.verticalizable&&(Ht=ct.lineOffset/2-(Xe.imageName?-(24-Xe.metrics.width*Xe.scale)/2:24*(Xe.scale-1))),Xe.imageName){var Sr=Me[Xe.imageName];er=Sr.sdf,Xt=1/(Jt=Sr.pixelRatio)}var Wr=Ae?[Xe.x+wr,Xe.y]:[0,0],kr=Ae?[0,0]:[Xe.x+wr+ve[0],Xe.y+ve[1]-Ht],Xr=[0,0];tr&&(Xr=kr,kr=[0,0]);var sr=(Xe.metrics.left-Xt)*Xe.scale-wr+kr[0],Mr=(-Xe.metrics.top-Xt)*Xe.scale+kr[1],ft=sr+wt.w*Xe.scale/Jt,Vt=Mr+wt.h*Xe.scale/Jt,Mt=new me(sr,Mr),bt=new me(ft,Mr),ri=new me(sr,Vt),Fr=new me(ft,Vt);if(tr){var $t=new me(-wr,wr- -17),dr=-Math.PI/2,Or=12-wr,St=new me(22-Or,-(Xe.imageName?Or:0)),Ln=new(Function.prototype.bind.apply(me,[null].concat(Xr)));Mt._rotateAround(dr,$t)._add(St)._add(Ln),bt._rotateAround(dr,$t)._add(St)._add(Ln),ri._rotateAround(dr,$t)._add(St)._add(Ln),Fr._rotateAround(dr,$t)._add(St)._add(Ln)}if(Be){var zi=Math.sin(Be),Rn=Math.cos(Be),lr=[Rn,-zi,zi,Rn];Mt._matMult(lr),bt._matMult(lr),ri._matMult(lr),Fr._matMult(lr)}var Fn=new me(0,0),en=new me(0,0);lt.push({tl:Mt,tr:bt,bl:ri,br:Fr,tex:wt,writingMode:ce.writingMode,glyphOffset:Wr,sectionIndex:Xe.sectionIndex,isSDF:er,pixelOffsetTL:Fn,pixelOffsetBR:en,minFontScaleX:0,minFontScaleY:0})}}return lt}(0,r,m,u,c,h,a,e.allowVerticalPlacement),K=e.textSizeData,W=null;K.kind==="source"?(W=[128*u.layout.get("text-size").evaluate(h,{})])[0]>32640&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):K.kind==="composite"&&((W=[128*k.compositeTextSizes[0].evaluate(h,{},N),128*k.compositeTextSizes[1].evaluate(h,{},N)])[0]>32640||W[1]>32640)&&Lt(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,U,W,m,c,h,x,t,_.lineStartIndex,_.lineLength,C,N);for(var te=0,ne=w;te<ne.length;te+=1)T[ne[te]]=e.text.placedSymbolArray.length-1;return 4*U.length}function Xf(e){for(var t in e)return e[t];return null}function Og(e,t,r,a){var u=e.compareText;if(t in u){for(var c=u[t],h=c.length-1;h>=0;h--)if(a.dist(c[h])<r)return!0}else u[t]=[];return u[t].push(a),!1}var Vg=_s.VectorTileFeature.types,Ng=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function $u(e,t,r,a,u,c,h,m,_,x,w,T,C){var k=m?Math.min(32640,Math.round(m[0])):0,N=m?Math.min(32640,Math.round(m[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*u),c,h,(k<<1)+(_?1:0),N,16*x,16*w,256*T,256*C)}function hp(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Ug(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(ls(r[t].text))return!0;return!1}var Es=function(e){this.layoutVertexArray=new hs,this.indexArray=new Pn,this.programConfigurations=e,this.segments=new D,this.dynamicLayoutVertexArray=new Uo,this.opacityVertexArray=new Ea,this.placedSymbolArray=new s};Es.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Es.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fg.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,dg.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Ng,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},Es.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Ve("SymbolBuffers",Es);var zl=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new D,this.collisionVertexArray=new xl};zl.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,mg.members,!0)},zl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Ve("CollisionBuffers",zl);var Dt=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(c){return c.id}),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=yi([]),this.placementViewportMatrix=yi([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=up(this.zoom,t["text-size"]),this.iconSizeData=up(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),u=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(function(c){return Mi[c]})),this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id}),this.sourceID=e.sourceID};Dt.prototype.createArrays=function(){this.text=new Es(new Je(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new Es(new Je(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new d,this.lineVertexArray=new g,this.symbolInstances=new f},Dt.prototype.calculateGlyphDependencies=function(e,t,r,a,u){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&u){var h=Pl[e.charAt(c)];h&&(t[h.charCodeAt(0)]=!0)}},Dt.prototype.populate=function(e,t,r){var a=this.layers[0],u=a.layout,c=u.get("text-font"),h=u.get("text-field"),m=u.get("icon-image"),_=(h.value.kind!=="constant"||h.value.value instanceof Ir&&!h.value.value.isEmpty()||h.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),x=m.value.kind!=="constant"||!!m.value.value||Object.keys(m.parameters).length>0,w=u.get("symbol-sort-key");if(this.features=[],_||x){for(var T=t.iconDependencies,C=t.glyphDependencies,k=t.availableImages,N=new ht(this.zoom),U=0,K=e;U<K.length;U+=1){var W=K[U],te=W.feature,ne=W.id,se=W.index,ce=W.sourceLayerIndex,ve=a._featureFilter.needGeometry,Se=ar(te,ve);if(a._featureFilter.filter(N,Se,r)){ve||(Se.geometry=Yt(te));var Ae=void 0;if(_){var $e=a.getValueAndResolveTokens("text-field",Se,r,k),Me=Ir.factory($e);Ug(Me)&&(this.hasRTLText=!0),(!this.hasRTLText||yl()==="unavailable"||this.hasRTLText&&mi.isParsed())&&(Ae=vg(Me,a,Se))}var We=void 0;if(x){var Be=a.getValueAndResolveTokens("icon-image",Se,r,k);We=Be instanceof Jr?Be:Jr.fromString(Be)}if(Ae||We){var lt=this.sortFeaturesByKey?w.evaluate(Se,{},r):void 0;if(this.features.push({id:ne,text:Ae,icon:We,index:se,sourceLayerIndex:ce,geometry:Se.geometry,properties:te.properties,type:Vg[te.type],sortKey:lt}),We&&(T[We.name]=!0),Ae){var Qe=c.evaluate(Se,{},r).join(","),je=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Mi.vertical)>=0;for(var ct=0,ot=Ae.sections;ct<ot.length;ct+=1){var _t=ot[ct];if(_t.image)T[_t.image.name]=!0;else{var Xe=fl(Ae.toString()),wt=_t.fontStack||Qe,Xt=C[wt]=C[wt]||{};this.calculateGlyphDependencies(_t.text,Xt,je,this.allowVerticalPlacement,Xe)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(er){var Jt={},Ht={},tr=[],wr=0;function Sr($t){tr.push(er[$t]),wr++}function Wr($t,dr,Or){var St=Ht[$t];return delete Ht[$t],Ht[dr]=St,tr[St].geometry[0].pop(),tr[St].geometry[0]=tr[St].geometry[0].concat(Or[0]),St}function kr($t,dr,Or){var St=Jt[dr];return delete Jt[dr],Jt[$t]=St,tr[St].geometry[0].shift(),tr[St].geometry[0]=Or[0].concat(tr[St].geometry[0]),St}function Xr($t,dr,Or){var St=Or?dr[0][dr[0].length-1]:dr[0][0];return $t+":"+St.x+":"+St.y}for(var sr=0;sr<er.length;sr++){var Mr=er[sr],ft=Mr.geometry,Vt=Mr.text?Mr.text.toString():null;if(Vt){var Mt=Xr(Vt,ft),bt=Xr(Vt,ft,!0);if(Mt in Ht&&bt in Jt&&Ht[Mt]!==Jt[bt]){var ri=kr(Mt,bt,ft),Fr=Wr(Mt,bt,tr[ri].geometry);delete Jt[Mt],delete Ht[bt],Ht[Xr(Vt,tr[Fr].geometry,!0)]=Fr,tr[ri].geometry=null}else Mt in Ht?Wr(Mt,bt,ft):bt in Jt?kr(Mt,bt,ft):(Sr(sr),Jt[Mt]=wr-1,Ht[bt]=wr-1)}else Sr(sr)}return tr.filter(function($t){return $t.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(er,Jt){return er.sortKey-Jt.sortKey})}},Dt.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},Dt.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Dt.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Dt.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Dt.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Dt.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Dt.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),u=e.dist(t[e.segment]),c={},h=e.segment+1;h<t.length;h++)c[h]={x:t[h].x,y:t[h].y,tileUnitDistanceFromAnchor:a},h<t.length-1&&(a+=t[h+1].dist(t[h]));for(var m=e.segment||0;m>=0;m--)c[m]={x:t[m].x,y:t[m].y,tileUnitDistanceFromAnchor:u},m>0&&(u+=t[m-1].dist(t[m]));for(var _=0;_<t.length;_++){var x=c[_];this.lineVertexArray.emplaceBack(x.x,x.y,x.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Dt.prototype.addSymbols=function(e,t,r,a,u,c,h,m,_,x,w,T){for(var C=e.indexArray,k=e.layoutVertexArray,N=e.segments.prepareSegment(4*t.length,k,C,this.canOverlap?c.sortKey:void 0),U=this.glyphOffsetArray.length,K=N.vertexLength,W=this.allowVerticalPlacement&&h===Mi.vertical?Math.PI/2:0,te=c.text&&c.text.sections,ne=0;ne<t.length;ne++){var se=t[ne],ce=se.tl,ve=se.tr,Se=se.bl,Ae=se.br,$e=se.tex,Me=se.pixelOffsetTL,We=se.pixelOffsetBR,Be=se.minFontScaleX,lt=se.minFontScaleY,Qe=se.glyphOffset,je=se.isSDF,ct=se.sectionIndex,ot=N.vertexLength,_t=Qe[1];$u(k,m.x,m.y,ce.x,_t+ce.y,$e.x,$e.y,r,je,Me.x,Me.y,Be,lt),$u(k,m.x,m.y,ve.x,_t+ve.y,$e.x+$e.w,$e.y,r,je,We.x,Me.y,Be,lt),$u(k,m.x,m.y,Se.x,_t+Se.y,$e.x,$e.y+$e.h,r,je,Me.x,We.y,Be,lt),$u(k,m.x,m.y,Ae.x,_t+Ae.y,$e.x+$e.w,$e.y+$e.h,r,je,We.x,We.y,Be,lt),hp(e.dynamicLayoutVertexArray,m,W),C.emplaceBack(ot,ot+1,ot+2),C.emplaceBack(ot+1,ot+2,ot+3),N.vertexLength+=4,N.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Qe[0]),ne!==t.length-1&&ct===t[ne+1].sectionIndex||e.programConfigurations.populatePaintArrays(k.length,c,c.index,{},T,te&&te[ct])}e.placedSymbolArray.emplaceBack(m.x,m.y,U,this.glyphOffsetArray.length-U,K,_,x,m.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],h,0,!1,0,w)},Dt.prototype._addCollisionDebugVertex=function(e,t,r,a,u,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,u,Math.round(c.x),Math.round(c.y))},Dt.prototype.addCollisionDebugVertices=function(e,t,r,a,u,c,h){var m=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),_=m.vertexLength,x=u.layoutVertexArray,w=u.collisionVertexArray,T=h.anchorX,C=h.anchorY;this._addCollisionDebugVertex(x,w,c,T,C,new me(e,t)),this._addCollisionDebugVertex(x,w,c,T,C,new me(r,t)),this._addCollisionDebugVertex(x,w,c,T,C,new me(r,a)),this._addCollisionDebugVertex(x,w,c,T,C,new me(e,a)),m.vertexLength+=4;var k=u.indexArray;k.emplaceBack(_,_+1),k.emplaceBack(_+1,_+2),k.emplaceBack(_+2,_+3),k.emplaceBack(_+3,_),m.primitiveLength+=4},Dt.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var u=e;u<t;u++){var c=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Dt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new zl(qo,Ef.members,Aa),this.iconCollisionBox=new zl(qo,Ef.members,Aa);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},Dt.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,u,c,h,m,_){for(var x={},w=t;w<r;w++){var T=e.get(w);x.textBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},x.textFeatureIndex=T.featureIndex;break}for(var C=a;C<u;C++){var k=e.get(C);x.verticalTextBox={x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,anchorPointX:k.anchorPointX,anchorPointY:k.anchorPointY},x.verticalTextFeatureIndex=k.featureIndex;break}for(var N=c;N<h;N++){var U=e.get(N);x.iconBox={x1:U.x1,y1:U.y1,x2:U.x2,y2:U.y2,anchorPointX:U.anchorPointX,anchorPointY:U.anchorPointY},x.iconFeatureIndex=U.featureIndex;break}for(var K=m;K<_;K++){var W=e.get(K);x.verticalIconBox={x1:W.x1,y1:W.y1,x2:W.x2,y2:W.y2,anchorPointX:W.anchorPointX,anchorPointY:W.anchorPointY},x.verticalIconFeatureIndex=W.featureIndex;break}return x},Dt.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Dt.prototype.hasTextData=function(){return this.text.segments.get().length>0},Dt.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Dt.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Dt.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Dt.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Dt.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,u=r.vertexStartIndex;u<a;u+=4)e.indexArray.emplaceBack(u,u+1,u+2),e.indexArray.emplaceBack(u+1,u+2,u+3)},Dt.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],u=[],c=[],h=0;h<this.symbolInstances.length;++h){c.push(h);var m=this.symbolInstances.get(h);a.push(0|Math.round(t*m.anchorX+r*m.anchorY)),u.push(m.featureIndex)}return c.sort(function(_,x){return a[_]-a[x]||u[x]-u[_]}),c},Dt.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},Dt.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var u=this.symbolInstances.get(a[r]);this.featureSortOrder.push(u.featureIndex),[u.rightJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.leftJustifiedTextSymbolIndex].forEach(function(c,h,m){c>=0&&m.indexOf(c)===h&&t.addIndicesForPlacedSymbol(t.text,c)}),u.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,u.verticalPlacedTextSymbolIndex),u.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.placedIconSymbolIndex),u.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Ve("SymbolBucket",Dt,{omit:["layers","collisionBoxArray","features","compareText"]}),Dt.MAX_GLYPHS=65535,Dt.addDynamicAttributes=hp;var qg=new Lr({"symbol-placement":new Ze(B.layout_symbol["symbol-placement"]),"symbol-spacing":new Ze(B.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ze(B.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qe(B.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ze(B.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ze(B.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ze(B.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ze(B.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ze(B.layout_symbol["icon-rotation-alignment"]),"icon-size":new qe(B.layout_symbol["icon-size"]),"icon-text-fit":new Ze(B.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ze(B.layout_symbol["icon-text-fit-padding"]),"icon-image":new qe(B.layout_symbol["icon-image"]),"icon-rotate":new qe(B.layout_symbol["icon-rotate"]),"icon-padding":new Ze(B.layout_symbol["icon-padding"]),"icon-keep-upright":new Ze(B.layout_symbol["icon-keep-upright"]),"icon-offset":new qe(B.layout_symbol["icon-offset"]),"icon-anchor":new qe(B.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ze(B.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ze(B.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ze(B.layout_symbol["text-rotation-alignment"]),"text-field":new qe(B.layout_symbol["text-field"]),"text-font":new qe(B.layout_symbol["text-font"]),"text-size":new qe(B.layout_symbol["text-size"]),"text-max-width":new qe(B.layout_symbol["text-max-width"]),"text-line-height":new Ze(B.layout_symbol["text-line-height"]),"text-letter-spacing":new qe(B.layout_symbol["text-letter-spacing"]),"text-justify":new qe(B.layout_symbol["text-justify"]),"text-radial-offset":new qe(B.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ze(B.layout_symbol["text-variable-anchor"]),"text-anchor":new qe(B.layout_symbol["text-anchor"]),"text-max-angle":new Ze(B.layout_symbol["text-max-angle"]),"text-writing-mode":new Ze(B.layout_symbol["text-writing-mode"]),"text-rotate":new qe(B.layout_symbol["text-rotate"]),"text-padding":new Ze(B.layout_symbol["text-padding"]),"text-keep-upright":new Ze(B.layout_symbol["text-keep-upright"]),"text-transform":new qe(B.layout_symbol["text-transform"]),"text-offset":new qe(B.layout_symbol["text-offset"]),"text-allow-overlap":new Ze(B.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ze(B.layout_symbol["text-ignore-placement"]),"text-optional":new Ze(B.layout_symbol["text-optional"])}),fp={paint:new Lr({"icon-opacity":new qe(B.paint_symbol["icon-opacity"]),"icon-color":new qe(B.paint_symbol["icon-color"]),"icon-halo-color":new qe(B.paint_symbol["icon-halo-color"]),"icon-halo-width":new qe(B.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qe(B.paint_symbol["icon-halo-blur"]),"icon-translate":new Ze(B.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ze(B.paint_symbol["icon-translate-anchor"]),"text-opacity":new qe(B.paint_symbol["text-opacity"]),"text-color":new qe(B.paint_symbol["text-color"],{runtimeType:ke,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new qe(B.paint_symbol["text-halo-color"]),"text-halo-width":new qe(B.paint_symbol["text-halo-width"]),"text-halo-blur":new qe(B.paint_symbol["text-halo-blur"]),"text-translate":new Ze(B.paint_symbol["text-translate"]),"text-translate-anchor":new Ze(B.paint_symbol["text-translate-anchor"])}),layout:qg},As=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Oe,this.defaultValue=e};As.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},As.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},As.prototype.outputDefined=function(){return!1},As.prototype.serialize=function(){return null},Ve("FormatSectionOverride",As,{omit:["defaultValue"]});var jg=function(e){function t(r){e.call(this,r,fp)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var u=this.layout.get("text-writing-mode");if(u){for(var c=[],h=0,m=u;h<m.length;h+=1){var _=m[h];c.indexOf(_)<0&&c.push(_)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,u,c){var h=this.layout.get(r).evaluate(a,{},u,c),m=this._unevaluatedLayout._values[r];return m.isDataDriven()||ma(m.value)||!h?h:function(_,x){return x.replace(/{([^{}]+)}/g,function(w,T){return T in _?String(_[T]):""})}(a.properties,h)},t.prototype.createBucket=function(r){return new Dt(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=fp.paint.overridableProperties;r<a.length;r+=1){var u=a[r];if(t.hasPaintOverride(this.layout,u)){var c,h=this.paint.get(u),m=new As(h),_=new Lo(m,h.property.specification);c=h.value.kind==="constant"||h.value.kind==="source"?new ya("source",_):new Ro("composite",_,h.value.zoomStops,h.value._interpolationType),this.paint._values[u]=new jr(h.property,c,h.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!(!this.layout||a.isDataDriven()||u.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var u=r.get("text-field"),c=fp.paint.properties[a],h=!1,m=function(w){for(var T=0,C=w;T<C.length;T+=1)if(c.overrides&&c.overrides.hasOverride(C[T]))return void(h=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Ir)m(u.value.value.sections);else if(u.value.kind==="source"){var _=function(w){h||(w instanceof Ur&&or(w.value)===Ft?m(w.value.sections):w instanceof Oi?m(w.sections):w.eachChild(_))},x=u.value;x._styleExpression&&_(x._styleExpression.expression)}return h},t}(Ki),$g={paint:new Lr({"background-color":new Ze(B.paint_background["background-color"]),"background-pattern":new $r(B.paint_background["background-pattern"]),"background-opacity":new Ze(B.paint_background["background-opacity"])})},Zg=function(e){function t(r){e.call(this,r,$g)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Ki),Gg={paint:new Lr({"raster-opacity":new Ze(B.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ze(B.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ze(B.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ze(B.paint_raster["raster-brightness-max"]),"raster-saturation":new Ze(B.paint_raster["raster-saturation"]),"raster-contrast":new Ze(B.paint_raster["raster-contrast"]),"raster-resampling":new Ze(B.paint_raster["raster-resampling"]),"raster-fade-duration":new Ze(B.paint_raster["raster-fade-duration"])})},Wg=function(e){function t(r){e.call(this,r,Gg)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Ki),Xg=function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t}(Ki),Hg={circle:Yc,heatmap:zv,hillshade:Dv,fill:Yv,"fill-extrusion":ag,line:hg,symbol:jg,background:Zg,raster:Wg},Hf=le.HTMLImageElement,Kf=le.HTMLCanvasElement,Yf=le.HTMLVideoElement,Jf=le.ImageData,Zu=le.ImageBitmap,Ba=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};Ba.prototype.update=function(e,t,r){var a=e.width,u=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===u||r),h=this.context,m=h.gl;if(this.useMipmap=!!(t&&t.useMipmap),m.bindTexture(m.TEXTURE_2D,this.texture),h.pixelStoreUnpackFlipY.set(!1),h.pixelStoreUnpack.set(1),h.pixelStoreUnpackPremultiplyAlpha.set(this.format===m.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,u],e instanceof Hf||e instanceof Kf||e instanceof Yf||e instanceof Jf||Zu&&e instanceof Zu?m.texImage2D(m.TEXTURE_2D,0,this.format,this.format,m.UNSIGNED_BYTE,e):m.texImage2D(m.TEXTURE_2D,0,this.format,a,u,0,this.format,m.UNSIGNED_BYTE,e.data);else{var _=r||{x:0,y:0},x=_.x,w=_.y;e instanceof Hf||e instanceof Kf||e instanceof Yf||e instanceof Jf||Zu&&e instanceof Zu?m.texSubImage2D(m.TEXTURE_2D,0,x,w,m.RGBA,m.UNSIGNED_BYTE,e):m.texSubImage2D(m.TEXTURE_2D,0,x,w,a,u,m.RGBA,m.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&m.generateMipmap(m.TEXTURE_2D)},Ba.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},Ba.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Ba.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var dp=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};dp.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){e._triggered=!1,e._callback()},0))},dp.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Cs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Kt(["receive","process"],this),this.invoker=new dp(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ii()?e:le};function Qf(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}Cs.prototype.send=function(e,t,r,a,u){var c=this;u===void 0&&(u=!1);var h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);var m=ja(this.globalScope)?void 0:[];return this.target.postMessage({id:h,type:e,hasCallback:!!r,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:Ni(t,m)},m),{cancel:function(){r&&delete c.callbacks[h],c.target.postMessage({id:h,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},Cs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else ii()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Cs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Cs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(ai(t.error)):a(null,ai(t.data)))}else{var u=!1,c=ja(this.globalScope)?void 0:[],h=t.hasCallback?function(w,T){u=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:w?Ni(w):null,data:Ni(T,c)},c)}:function(w){u=!0},m=null,_=ai(t.data);if(this.parent[t.type])m=this.parent[t.type](t.sourceMapId,_,h);else if(this.parent.getWorkerSource){var x=t.type.split(".");m=this.parent.getWorkerSource(t.sourceMapId,x[0],_.source)[x[1]](_,h)}else h(new Error("Could not find function "+t.type));!u&&m&&m.cancel&&(this.cancelCallbacks[e]=m.cancel)}},Cs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var vr=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};vr.prototype.setNorthEast=function(e){return this._ne=e instanceof Wt?new Wt(e.lng,e.lat):Wt.convert(e),this},vr.prototype.setSouthWest=function(e){return this._sw=e instanceof Wt?new Wt(e.lng,e.lat):Wt.convert(e),this},vr.prototype.extend=function(e){var t,r,a=this._sw,u=this._ne;if(e instanceof Wt)t=e,r=e;else{if(!(e instanceof vr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(vr.convert(e)):this.extend(Wt.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||u?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),u.lng=Math.max(r.lng,u.lng),u.lat=Math.max(r.lat,u.lat)):(this._sw=new Wt(t.lng,t.lat),this._ne=new Wt(r.lng,r.lat)),this},vr.prototype.getCenter=function(){return new Wt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},vr.prototype.getSouthWest=function(){return this._sw},vr.prototype.getNorthEast=function(){return this._ne},vr.prototype.getNorthWest=function(){return new Wt(this.getWest(),this.getNorth())},vr.prototype.getSouthEast=function(){return new Wt(this.getEast(),this.getSouth())},vr.prototype.getWest=function(){return this._sw.lng},vr.prototype.getSouth=function(){return this._sw.lat},vr.prototype.getEast=function(){return this._ne.lng},vr.prototype.getNorth=function(){return this._ne.lat},vr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},vr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},vr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},vr.prototype.contains=function(e){var t=Wt.convert(e),r=t.lng,a=t.lat,u=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u},vr.convert=function(e){return!e||e instanceof vr?e:new vr(e)};var Wt=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Wt.prototype.wrap=function(){return new Wt(Nt(this.lng,-180,180),this.lat)},Wt.prototype.toArray=function(){return[this.lng,this.lat]},Wt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Wt.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,u=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(u,1))},Wt.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new vr(new Wt(this.lng-r,this.lat-t),new Wt(this.lng+r,this.lat+t))},Wt.convert=function(e){if(e instanceof Wt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Wt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Wt(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var ed=2*Math.PI*63710088e-1;function td(e){return ed*Math.cos(e*Math.PI/180)}function rd(e){return(180+e)/360}function id(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function nd(e,t){return e/td(t)}function mp(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var Da=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};Da.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Wt.convert(e);return new Da(rd(r.lng),id(r.lat),nd(t,r.lat))},Da.prototype.toLngLat=function(){return new Wt(360*this.x-180,mp(this.y))},Da.prototype.toAltitude=function(){return this.z*td(mp(this.y))},Da.prototype.meterInMercatorCoordinateUnits=function(){return 1/ed*(e=mp(this.y),1/Math.cos(e*Math.PI/180));var e};var La=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bl(0,e,e,t,r)};La.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},La.prototype.url=function(e,t){var r,a,u,c,h,m=(a=this.y,u=this.z,c=Qf(256*(r=this.x),256*(a=Math.pow(2,u)-a-1),u),h=Qf(256*(r+1),256*(a+1),u),c[0]+","+c[1]+","+h[0]+","+h[1]),_=function(x,w,T){for(var C,k="",N=x;N>0;N--)k+=(w&(C=1<<N-1)?1:0)+(T&C?2:0);return k}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_).replace("{bbox-epsg-3857}",m)},La.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new me(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},La.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var od=function(e,t){this.wrap=e,this.canonical=t,this.key=Bl(e,t.z,t.z,t.x,t.y)},gr=function(e,t,r,a,u){this.overscaledZ=e,this.wrap=t,this.canonical=new La(r,+a,+u),this.key=Bl(t,e,r,a,u)};function Bl(e,t,r,a,u){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*u+a).toString(36)+r.toString(36)+t.toString(36)}gr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},gr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new gr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},gr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Bl(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Bl(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},gr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},gr.prototype.children=function(e){if(this.overscaledZ>=e)return[new gr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new gr(t,this.wrap,t,r,a),new gr(t,this.wrap,t,r+1,a),new gr(t,this.wrap,t,r,a+1),new gr(t,this.wrap,t,r+1,a+1)]},gr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},gr.prototype.wrapped=function(){return new gr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},gr.prototype.unwrapTo=function(e){return new gr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},gr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},gr.prototype.toUnwrapped=function(){return new od(this.wrap,this.canonical)},gr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},gr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Da(e.x-this.wrap,e.y))},Ve("CanonicalTileID",La),Ve("OverscaledTileID",gr,{omit:["posMatrix"]});var yo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return Lt('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var u=0;u<a;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(a,u)]=this.data[this._idx(a-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,a)]=this.data[this._idx(u,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};yo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},yo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},yo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},yo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},yo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},yo.prototype.getPixels=function(){return new pi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},yo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,u=t*this.dim+this.dim,c=r*this.dim,h=r*this.dim+this.dim;switch(t){case-1:a=u-1;break;case 1:u=a+1}switch(r){case-1:c=h-1;break;case 1:h=c+1}for(var m=-t*this.dim,_=-r*this.dim,x=c;x<h;x++)for(var w=a;w<u;w++)this.data[this._idx(w,x)]=e.data[this._idx(w+m,x+_)]},Ve("DEMData",yo);var Gu=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Gu.prototype.encode=function(e){return this._stringToNumber[e]},Gu.prototype.decode=function(e){return this._numberToString[e]};var Wu=function(e,t,r,a,u){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=u},yp={geometry:{configurable:!0}};yp.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},yp.geometry.set=function(e){this._geometry=e},Wu.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Wu.prototype,yp);var Ps=function(){this.state={},this.stateChanges={},this.deletedStates={}};Ps.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},Ye(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var u in this.deletedStates[e]={},this.state[e])u!==a&&(this.deletedStates[e][u]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var h in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][h]===null&&delete this.deletedStates[e][a][h]},Ps.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},Ps.prototype.getState=function(e,t){var r=String(t),a=Ye({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var u=this.deletedStates[e][t];if(u===null)return{};for(var c in u)delete a[c]}return a},Ps.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},Ps.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var u={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),Ye(this.state[a][c],this.stateChanges[a][c]),u[c]=this.state[a][c];r[a]=u}for(var h in this.deletedStates){this.state[h]=this.state[h]||{};var m={};if(this.deletedStates[h]===null)for(var _ in this.state[h])m[_]={},this.state[h][_]={};else for(var x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(var w=0,T=Object.keys(this.deletedStates[h][x]);w<T.length;w+=1)delete this.state[h][x][T[w]];m[x]=this.state[h][x]}r[h]=r[h]||{},Ye(r[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var vo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new sn(8192,16,0),this.grid3D=new sn(8192,16,0),this.featureIndexArray=new E,this.promoteId=t};function ad(e,t,r,a,u){return pr(e,function(c,h){var m=t instanceof Ia?t.get(h):null;return m&&m.evaluate?m.evaluate(r,a,u):m})}function sd(e){for(var t=1/0,r=1/0,a=-1/0,u=-1/0,c=0,h=e;c<h.length;c+=1){var m=h[c];t=Math.min(t,m.x),r=Math.min(r,m.y),a=Math.max(a,m.x),u=Math.max(u,m.y)}return{minX:t,minY:r,maxX:a,maxY:u}}function Kg(e,t){return t-e}vo.prototype.insert=function(e,t,r,a,u,c){var h=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,u);for(var m=c?this.grid3D:this.grid,_=0;_<t.length;_++){for(var x=t[_],w=[1/0,1/0,-1/0,-1/0],T=0;T<x.length;T++){var C=x[T];w[0]=Math.min(w[0],C.x),w[1]=Math.min(w[1],C.y),w[2]=Math.max(w[2],C.x),w[3]=Math.max(w[3],C.y)}w[0]<8192&&w[1]<8192&&w[2]>=0&&w[3]>=0&&m.insert(h,w[0],w[1],w[2],w[3])}},vo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Lu(this.rawTileData)).layers,this.sourceLayerCoder=new Gu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},vo.prototype.query=function(e,t,r,a){var u=this;this.loadVTLayers();for(var c=e.params||{},h=8192/e.tileSize/e.scale,m=rs(c.filter),_=e.queryGeometry,x=e.queryPadding*h,w=sd(_),T=this.grid.query(w.minX-x,w.minY-x,w.maxX+x,w.maxY+x),C=sd(e.cameraQueryGeometry),k=this.grid3D.query(C.minX-x,C.minY-x,C.maxX+x,C.maxY+x,function(se,ce,ve,Se){return function(Ae,$e,Me,We,Be){for(var lt=0,Qe=Ae;lt<Qe.length;lt+=1){var je=Qe[lt];if($e<=je.x&&Me<=je.y&&We>=je.x&&Be>=je.y)return!0}var ct=[new me($e,Me),new me($e,Be),new me(We,Be),new me(We,Me)];if(Ae.length>2){for(var ot=0,_t=ct;ot<_t.length;ot+=1)if(Ji(Ae,_t[ot]))return!0}for(var Xe=0;Xe<Ae.length-1;Xe++)if(ka(Ae[Xe],Ae[Xe+1],ct))return!0;return!1}(e.cameraQueryGeometry,se-x,ce-x,ve+x,Se+x)}),N=0,U=k;N<U.length;N+=1)T.push(U[N]);T.sort(Kg);for(var K,W={},te=function(se){var ce=T[se];if(ce!==K){K=ce;var ve=u.featureIndexArray.get(ce),Se=null;u.loadMatchingFeature(W,ve.bucketIndex,ve.sourceLayerIndex,ve.featureIndex,m,c.layers,c.availableImages,t,r,a,function(Ae,$e,Me){return Se||(Se=Yt(Ae)),$e.queryIntersectsFeature(_,Ae,Me,Se,u.z,e.transform,h,e.pixelPosMatrix)})}},ne=0;ne<T.length;ne++)te(ne);return W},vo.prototype.loadMatchingFeature=function(e,t,r,a,u,c,h,m,_,x,w){var T=this.bucketLayerIDs[t];if(!c||function(Ae,$e){for(var Me=0;Me<Ae.length;Me++)if($e.indexOf(Ae[Me])>=0)return!0;return!1}(c,T)){var C=this.sourceLayerCoder.decode(r),k=this.vtLayers[C].feature(a);if(u.needGeometry){var N=ar(k,!0);if(!u.filter(new ht(this.tileID.overscaledZ),N,this.tileID.canonical))return}else if(!u.filter(new ht(this.tileID.overscaledZ),k))return;for(var U=this.getId(k,C),K=0;K<T.length;K++){var W=T[K];if(!(c&&c.indexOf(W)<0)){var te=m[W];if(te){var ne={};U!==void 0&&x&&(ne=x.getState(te.sourceLayer||"_geojsonTileLayer",U));var se=Ye({},_[W]);se.paint=ad(se.paint,te.paint,k,ne,h),se.layout=ad(se.layout,te.layout,k,ne,h);var ce=!w||w(k,te,ne);if(ce){var ve=new Wu(k,this.z,this.x,this.y,U);ve.layer=se;var Se=e[W];Se===void 0&&(Se=e[W]=[]),Se.push({featureIndex:a,feature:ve,intersectionZ:ce})}}}}}},vo.prototype.lookupSymbolFeatures=function(e,t,r,a,u,c,h,m){var _={};this.loadVTLayers();for(var x=rs(u),w=0,T=e;w<T.length;w+=1)this.loadMatchingFeature(_,r,a,T[w],x,c,h,m,t);return _},vo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,u=r[t];a<u.length;a+=1)if(e===u[a])return!0;return!1},vo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Ve("FeatureIndex",vo,{omit:["rawTileData","sourceLayerCoder"]});var Pr=function(e,t){this.tileID=e,this.uid=zt(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Pr.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<rn.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Pr.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Pr.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(x,w){var T={};if(!w)return T;for(var C=function(){var U=N[k],K=U.layerIds.map(function(ne){return w.getLayer(ne)}).filter(Boolean);if(K.length!==0){U.layers=K,U.stateDependentLayerIds&&(U.stateDependentLayers=U.stateDependentLayerIds.map(function(ne){return K.filter(function(se){return se.id===ne})[0]}));for(var W=0,te=K;W<te.length;W+=1)T[te[W].id]=U}},k=0,N=x;k<N.length;k+=1)C();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[a];if(u instanceof Dt){if(this.hasSymbolBuckets=!0,!r)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var h=this.buckets[c];if(h instanceof Dt&&h.hasRTLText){this.hasRTLText=!0,mi.isLoading()||mi.isLoaded()||yl()!=="deferred"||Ui();break}}for(var m in this.queryPadding=0,this.buckets){var _=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(m).queryRadius(_))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},Pr.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Pr.prototype.getBucket=function(e){return this.buckets[e.id]},Pr.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ba(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ba(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},Pr.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Pr.prototype.queryRenderedFeatures=function(e,t,r,a,u,c,h,m,_,x){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:u,scale:c,tileSize:this.tileSize,pixelPosMatrix:x,transform:m,params:h,queryPadding:this.queryPadding*_},e,t,r):{}},Pr.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),u=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[u];if(c)for(var h=rs(t&&t.filter),m=this.tileID.canonical,_=m.z,x=m.x,w=m.y,T={z:_,x,y:w},C=0;C<c.length;C++){var k=c.feature(C);if(h.needGeometry){var N=ar(k,!0);if(!h.filter(new ht(this.tileID.overscaledZ),N,this.tileID.canonical))continue}else if(!h.filter(new ht(this.tileID.overscaledZ),k))continue;var U=r.getId(k,u),K=new Wu(k,_,x,w,U);K.tile=T,e.push(K)}}},Pr.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Pr.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Pr.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=Io(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),u=!1;if(this.expirationTime>a)u=!1;else if(t)if(this.expirationTime<t)u=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):u=!0}else u=!0;u?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Pr.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},Pr.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var u=this.buckets[a],c=u.layers[0].sourceLayer||"_geojsonTileLayer",h=r[c],m=e[c];if(h&&m&&Object.keys(m).length!==0){u.update(m,h,this.imageAtlas&&this.imageAtlas.patternPositions||{});var _=t&&t.style&&t.style.getLayer(a);_&&(this.queryPadding=Math.max(this.queryPadding,_.queryRadius(u)))}}}},Pr.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Pr.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<rn.now()},Pr.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Pr.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=rn.now()+e},Pr.prototype.setDependencies=function(e,t){for(var r={},a=0,u=t;a<u.length;a+=1)r[u[a]]=!0;this.dependencies[e]=r},Pr.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var u=this.dependencies[a[r]];if(u){for(var c=0,h=t;c<h.length;c+=1)if(u[h[c]])return!0}}return!1};var Wo=le.performance,ld=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Wo.mark(this._marks.start)};ld.prototype.finish=function(){Wo.mark(this._marks.end);var e=Wo.getEntriesByName(this._marks.measure);return e.length===0&&(Wo.measure(this._marks.measure,this._marks.start,this._marks.end),e=Wo.getEntriesByName(this._marks.measure),Wo.clearMarks(this._marks.start),Wo.clearMarks(this._marks.end),Wo.clearMeasures(this._marks.measure)),e},l.Actor=Cs,l.AlphaImage=za,l.CanonicalTileID=La,l.CollisionBoxArray=o,l.Color=It,l.DEMData=yo,l.DataConstantProperty=Ze,l.DictionaryCoder=Gu,l.EXTENT=8192,l.ErrorEvent=J,l.EvaluationParameters=ht,l.Event=j,l.Evented=ee,l.FeatureIndex=vo,l.FillBucket=pn,l.FillExtrusionBucket=hn,l.ImageAtlas=Ml,l.ImagePosition=Fu,l.LineBucket=ti,l.LngLat=Wt,l.LngLatBounds=vr,l.MercatorCoordinate=Da,l.ONE_EM=24,l.OverscaledTileID=gr,l.Point=me,l.Point$1=me,l.Properties=Lr,l.Protobuf=Lu,l.RGBAImage=pi,l.RequestManager=Kr,l.RequestPerformance=ld,l.ResourceType=Wa,l.SegmentVector=D,l.SourceFeatureState=Ps,l.StructArrayLayout1ui2=wl,l.StructArrayLayout2f1f2i16=po,l.StructArrayLayout2i4=co,l.StructArrayLayout3ui6=Pn,l.StructArrayLayout4i8=gl,l.SymbolBucket=Dt,l.Texture=Ba,l.Tile=Pr,l.Transitionable=Dr,l.Uniform1f=Ie,l.Uniform1i=_e,l.Uniform2f=Te,l.Uniform3f=Le,l.Uniform4f=Ge,l.UniformColor=Ke,l.UniformMatrix4f=xt,l.UnwrappedTileID=od,l.ValidationError=G,l.WritingMode=Mi,l.ZoomHistory=hl,l.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},l.addDynamicAttributes=hp,l.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,u=new Array(e.length),c=null;e.forEach(function(h,m){t(h,function(_,x){_&&(c=_),u[m]=x,--a==0&&r(c,u)})})},l.bezier=Fe,l.bindAll=Kt,l.browser=rn,l.cacheEntryPossiblyAdded=function(e){++oa>Ga&&(e.getActor().send("enforceCacheSizeLimit",Po),oa=0)},l.clamp=Ne,l.clearTileCache=function(e){var t=le.caches.delete("mapbox-tiles");e&&t.catch(e).then(function(){return e()})},l.clipLine=jf,l.clone=function(e){var t=new Et(16);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},l.clone$1=_r,l.clone$2=function(e){var t=new Et(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},l.collisionCircleLayout=yg,l.config=Rt,l.create=function(){var e=new Et(16);return Et!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},l.create$1=function(){var e=new Et(9);return Et!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},l.create$2=function(){var e=new Et(4);return Et!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},l.createCommonjsModule=ae,l.createExpression=es,l.createLayout=Ar,l.createStyleLayer=function(e){return e.type==="custom"?new Xg(e):new Hg[e.type](e)},l.cross=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=r[0],m=r[1],_=r[2];return e[0]=u*_-c*m,e[1]=c*h-a*_,e[2]=a*m-u*h,e},l.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var u in t)if(!e(t[u],r[u]))return!1;return!0}return t===r},l.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},l.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},l.ease=tt,l.emitValidationErrors=wa,l.endsWith=cr,l.enforceCacheSizeLimit=function(e){ko(),Si&&Si.then(function(t){t.keys().then(function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])})})},l.evaluateSizeForFeature=Ff,l.evaluateSizeForZoom=Of,l.evaluateVariableOffset=Gf,l.evented=ml,l.extend=Ye,l.featureFilter=rs,l.filterObject=Hr,l.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.getAnchorAlignment=lp,l.getAnchorJustification=pp,l.getArrayBuffer=sa,l.getImage=A,l.getJSON=function(e,t){return Mo(Ye(e,{type:"json"}),t)},l.getRTLTextPluginStatus=yl,l.getReferrer=Xn,l.getVideo=function(e,t){var r,a,u=le.document.createElement("video");u.muted=!0,u.onloadstart=function(){t(null,u)};for(var c=0;c<e.length;c++){var h=le.document.createElement("source");r=e[c],a=void 0,(a=le.document.createElement("a")).href=r,(a.protocol!==le.document.location.protocol||a.host!==le.document.location.host)&&(u.crossOrigin="Anonymous"),h.src=e[c],u.appendChild(h)}return{cancel:function(){}}},l.identity=yi,l.invert=function(e,t){var r=t[0],a=t[1],u=t[2],c=t[3],h=t[4],m=t[5],_=t[6],x=t[7],w=t[8],T=t[9],C=t[10],k=t[11],N=t[12],U=t[13],K=t[14],W=t[15],te=r*m-a*h,ne=r*_-u*h,se=r*x-c*h,ce=a*_-u*m,ve=a*x-c*m,Se=u*x-c*_,Ae=w*U-T*N,$e=w*K-C*N,Me=w*W-k*N,We=T*K-C*U,Be=T*W-k*U,lt=C*W-k*K,Qe=te*lt-ne*Be+se*We+ce*Me-ve*$e+Se*Ae;return Qe?(e[0]=(m*lt-_*Be+x*We)*(Qe=1/Qe),e[1]=(u*Be-a*lt-c*We)*Qe,e[2]=(U*Se-K*ve+W*ce)*Qe,e[3]=(C*ve-T*Se-k*ce)*Qe,e[4]=(_*Me-h*lt-x*$e)*Qe,e[5]=(r*lt-u*Me+c*$e)*Qe,e[6]=(K*se-N*Se-W*ne)*Qe,e[7]=(w*Se-C*se+k*ne)*Qe,e[8]=(h*Be-m*Me+x*Ae)*Qe,e[9]=(a*Me-r*Be-c*Ae)*Qe,e[10]=(N*ve-U*se+W*te)*Qe,e[11]=(T*se-w*ve-k*te)*Qe,e[12]=(m*$e-h*We-_*Ae)*Qe,e[13]=(r*We-a*$e+u*Ae)*Qe,e[14]=(U*ne-N*ce-K*te)*Qe,e[15]=(w*ce-T*ne+C*te)*Qe,e):null},l.isChar=Pe,l.isMapboxURL=xi,l.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},l.makeRequest=Mo,l.mapObject=pr,l.mercatorXfromLng=rd,l.mercatorYfromLat=id,l.mercatorZfromAltitude=nd,l.mul=Kc,l.multiply=ei,l.mvt=_s,l.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},l.normalize=function(e,t){var r=t[0],a=t[1],u=t[2],c=r*r+a*a+u*u;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},l.number=hr,l.offscreenCanvasSupported=aa,l.ortho=function(e,t,r,a,u,c,h){var m=1/(t-r),_=1/(a-u),x=1/(c-h);return e[0]=-2*m,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*_,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*x,e[11]=0,e[12]=(t+r)*m,e[13]=(u+a)*_,e[14]=(h+c)*x,e[15]=1,e},l.parseGlyphPBF=function(e){return new Lu(e).readFields(Ag,[])},l.pbf=Lu,l.performSymbolLayout=function(e,t,r,a,u,c,h){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var m=e.layers[0].layout,_=e.layers[0]._unevaluatedLayout._values,x={};if(e.textSizeData.kind==="composite"){var w=e.textSizeData,T=w.maxZoom;x.compositeTextSizes=[_["text-size"].possiblyEvaluate(new ht(w.minZoom),h),_["text-size"].possiblyEvaluate(new ht(T),h)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,k=C.maxZoom;x.compositeIconSizes=[_["icon-size"].possiblyEvaluate(new ht(C.minZoom),h),_["icon-size"].possiblyEvaluate(new ht(k),h)]}x.layoutTextSize=_["text-size"].possiblyEvaluate(new ht(e.zoom+1),h),x.layoutIconSize=_["icon-size"].possiblyEvaluate(new ht(e.zoom+1),h),x.textMaxSize=_["text-size"].possiblyEvaluate(new ht(18));for(var N=24*m.get("text-line-height"),U=m.get("text-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",K=m.get("text-keep-upright"),W=m.get("text-size"),te=function(){var ce=se[ne],ve=m.get("text-font").evaluate(ce,{},h).join(","),Se=W.evaluate(ce,{},h),Ae=x.layoutTextSize.evaluate(ce,{},h),$e=x.layoutIconSize.evaluate(ce,{},h),Me={horizontal:{},vertical:void 0},We=ce.text,Be=[0,0];if(We){var lt=We.toString(),Qe=24*m.get("text-letter-spacing").evaluate(ce,{},h),je=function(ft){for(var Vt=0,Mt=ft;Vt<Mt.length;Vt+=1)if(bt=Mt[Vt].charCodeAt(0),Pe.Arabic(bt)||Pe["Arabic Supplement"](bt)||Pe["Arabic Extended-A"](bt)||Pe["Arabic Presentation Forms-A"](bt)||Pe["Arabic Presentation Forms-B"](bt))return!1;var bt;return!0}(lt)?Qe:0,ct=m.get("text-anchor").evaluate(ce,{},h),ot=m.get("text-variable-anchor");if(!ot){var _t=m.get("text-radial-offset").evaluate(ce,{},h);Be=_t?Gf(ct,[24*_t,cp]):m.get("text-offset").evaluate(ce,{},h).map(function(ft){return 24*ft})}var Xe=U?"center":m.get("text-justify").evaluate(ce,{},h),wt=m.get("symbol-placement"),Xt=wt==="point"?24*m.get("text-max-width").evaluate(ce,{},h):0,er=function(){e.allowVerticalPlacement&&fl(lt)&&(Me.vertical=Ou(We,t,r,u,ve,Xt,N,ct,"left",je,Be,Mi.vertical,!0,wt,Ae,Se))};if(!U&&ot){for(var Jt=Xe==="auto"?ot.map(function(ft){return pp(ft)}):[Xe],Ht=!1,tr=0;tr<Jt.length;tr++){var wr=Jt[tr];if(!Me.horizontal[wr])if(Ht)Me.horizontal[wr]=Me.horizontal[0];else{var Sr=Ou(We,t,r,u,ve,Xt,N,"center",wr,je,Be,Mi.horizontal,!1,wt,Ae,Se);Sr&&(Me.horizontal[wr]=Sr,Ht=Sr.positionedLines.length===1)}}er()}else{Xe==="auto"&&(Xe=pp(ct));var Wr=Ou(We,t,r,u,ve,Xt,N,ct,Xe,je,Be,Mi.horizontal,!1,wt,Ae,Se);Wr&&(Me.horizontal[Xe]=Wr),er(),fl(lt)&&U&&K&&(Me.vertical=Ou(We,t,r,u,ve,Xt,N,ct,Xe,je,Be,Mi.vertical,!1,wt,Ae,Se))}}var kr=void 0,Xr=!1;if(ce.icon&&ce.icon.name){var sr=a[ce.icon.name];sr&&(kr=function(ft,Vt,Mt){var bt=lp(Mt),ri=Vt[0]-ft.displaySize[0]*bt.horizontalAlign,Fr=Vt[1]-ft.displaySize[1]*bt.verticalAlign;return{image:ft,top:Fr,bottom:Fr+ft.displaySize[1],left:ri,right:ri+ft.displaySize[0]}}(u[ce.icon.name],m.get("icon-offset").evaluate(ce,{},h),m.get("icon-anchor").evaluate(ce,{},h)),Xr=sr.sdf,e.sdfIcons===void 0?e.sdfIcons=sr.sdf:e.sdfIcons!==sr.sdf&&Lt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(sr.pixelRatio!==e.pixelRatio||m.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Mr=Xf(Me.horizontal)||Me.vertical;e.iconsInText=!!Mr&&Mr.iconsInText,(Mr||kr)&&function(ft,Vt,Mt,bt,ri,Fr,$t,dr,Or,St,Ln){var zi=Fr.textMaxSize.evaluate(Vt,{});zi===void 0&&(zi=$t);var Rn,lr=ft.layers[0].layout,Fn=lr.get("icon-offset").evaluate(Vt,{},Ln),en=Xf(Mt.horizontal),ks=$t/24,Ra=ft.tilePixelRatio*ks,Ms=ft.tilePixelRatio*zi/24,go=ft.tilePixelRatio*dr,zs=ft.tilePixelRatio*lr.get("symbol-spacing"),Xu=lr.get("text-padding")*ft.tilePixelRatio,Bs=lr.get("icon-padding")*ft.tilePixelRatio,Dl=lr.get("text-max-angle")/180*Math.PI,Hu=lr.get("text-rotation-alignment")==="map"&&lr.get("symbol-placement")!=="point",Ku=lr.get("icon-rotation-alignment")==="map"&&lr.get("symbol-placement")!=="point",_o=lr.get("symbol-placement"),Ll=zs/2,Ds=lr.get("icon-text-fit");bt&&Ds!=="none"&&(ft.allowVerticalPlacement&&Mt.vertical&&(Rn=Rf(bt,Mt.vertical,Ds,lr.get("icon-text-fit-padding"),Fn,ks)),en&&(bt=Rf(bt,en,Ds,lr.get("icon-text-fit-padding"),Fn,ks)));var Xo=function(Yg,jl){jl.x<0||jl.x>=8192||jl.y<0||jl.y>=8192||function(ur,fn,Jg,Ho,xp,pd,rc,On,ic,$l,nc,oc,bp,hd,Zl,fd,dd,md,yd,vd,Bi,ac,gd,Vn,Qg){var _d,Oa,Vs,Ns,Us,qs=ur.addToLineVertexArray(fn,Jg),xd=0,bd=0,wd=0,Sd=0,wp=-1,Sp=-1,xo={},Td=V(""),Tp=0,Ip=0;if(On._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Tp=(_d=On.layout.get("text-offset").evaluate(Bi,{},Vn).map(function(Wl){return 24*Wl}))[0],Ip=_d[1]):(Tp=24*On.layout.get("text-radial-offset").evaluate(Bi,{},Vn),Ip=cp),ur.allowVerticalPlacement&&Ho.vertical){var Id=On.layout.get("text-rotate").evaluate(Bi,{},Vn)+90;Ns=new ju(ic,fn,$l,nc,oc,Ho.vertical,bp,hd,Zl,Id),rc&&(Us=new ju(ic,fn,$l,nc,oc,rc,dd,md,Zl,Id))}if(xp){var Ep=On.layout.get("icon-rotate").evaluate(Bi,{}),Ed=On.layout.get("icon-text-fit")!=="none",Ad=$f(xp,Ep,gd,Ed),Ap=rc?$f(rc,Ep,gd,Ed):void 0;Vs=new ju(ic,fn,$l,nc,oc,xp,dd,md,!1,Ep),xd=4*Ad.length;var Cd=ur.iconSizeData,Gl=null;Cd.kind==="source"?(Gl=[128*On.layout.get("icon-size").evaluate(Bi,{})])[0]>32640&&Lt(ur.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):Cd.kind==="composite"&&((Gl=[128*ac.compositeIconSizes[0].evaluate(Bi,{},Vn),128*ac.compositeIconSizes[1].evaluate(Bi,{},Vn)])[0]>32640||Gl[1]>32640)&&Lt(ur.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),ur.addSymbols(ur.icon,Ad,Gl,vd,yd,Bi,!1,fn,qs.lineStartIndex,qs.lineLength,-1,Vn),wp=ur.icon.placedSymbolArray.length-1,Ap&&(bd=4*Ap.length,ur.addSymbols(ur.icon,Ap,Gl,vd,yd,Bi,Mi.vertical,fn,qs.lineStartIndex,qs.lineLength,-1,Vn),Sp=ur.icon.placedSymbolArray.length-1)}for(var Pd in Ho.horizontal){var sc=Ho.horizontal[Pd];if(!Oa){Td=V(sc.text);var e_=On.layout.get("text-rotate").evaluate(Bi,{},Vn);Oa=new ju(ic,fn,$l,nc,oc,sc,bp,hd,Zl,e_)}var kd=sc.positionedLines.length===1;if(wd+=Wf(ur,fn,sc,pd,On,Zl,Bi,fd,qs,Ho.vertical?Mi.horizontal:Mi.horizontalOnly,kd?Object.keys(Ho.horizontal):[Pd],xo,wp,ac,Vn),kd)break}Ho.vertical&&(Sd+=Wf(ur,fn,Ho.vertical,pd,On,Zl,Bi,fd,qs,Mi.vertical,["vertical"],xo,Sp,ac,Vn));var t_=Oa?Oa.boxStartIndex:ur.collisionBoxArray.length,r_=Oa?Oa.boxEndIndex:ur.collisionBoxArray.length,i_=Ns?Ns.boxStartIndex:ur.collisionBoxArray.length,n_=Ns?Ns.boxEndIndex:ur.collisionBoxArray.length,o_=Vs?Vs.boxStartIndex:ur.collisionBoxArray.length,a_=Vs?Vs.boxEndIndex:ur.collisionBoxArray.length,s_=Us?Us.boxStartIndex:ur.collisionBoxArray.length,l_=Us?Us.boxEndIndex:ur.collisionBoxArray.length,Nn=-1,lc=function(Wl,zd){return Wl&&Wl.circleDiameter?Math.max(Wl.circleDiameter,zd):zd};Nn=lc(Oa,Nn),Nn=lc(Ns,Nn),Nn=lc(Vs,Nn);var Md=(Nn=lc(Us,Nn))>-1?1:0;Md&&(Nn*=Qg/24),ur.glyphOffsetArray.length>=Dt.MAX_GLYPHS&&Lt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Bi.sortKey!==void 0&&ur.addToSortKeyRanges(ur.symbolInstances.length,Bi.sortKey),ur.symbolInstances.emplaceBack(fn.x,fn.y,xo.right>=0?xo.right:-1,xo.center>=0?xo.center:-1,xo.left>=0?xo.left:-1,xo.vertical||-1,wp,Sp,Td,t_,r_,i_,n_,o_,a_,s_,l_,$l,wd,Sd,xd,bd,Md,0,bp,Tp,Ip,Nn)}(ft,jl,Yg,Mt,bt,ri,Rn,ft.layers[0],ft.collisionBoxArray,Vt.index,Vt.sourceLayerIndex,ft.index,Ra,Xu,Hu,Or,go,Bs,Ku,Fn,Vt,Fr,St,Ln,$t)};if(_o==="line")for(var Ls=0,Yu=jf(Vt.geometry,0,0,8192,8192);Ls<Yu.length;Ls+=1)for(var Ju=Yu[Ls],Rl=0,Fl=Dg(Ju,zs,Dl,Mt.vertical||en,bt,24,Ms,ft.overscaling,8192);Rl<Fl.length;Rl+=1){var Qu=Fl[Rl];en&&Og(ft,en.text,Ll,Qu)||Xo(Ju,Qu)}else if(_o==="line-center")for(var Ol=0,Vl=Vt.geometry;Ol<Vl.length;Ol+=1){var Nl=Vl[Ol];if(Nl.length>1){var ec=Bg(Nl,Dl,Mt.vertical||en,bt,24,Ms);ec&&Xo(Nl,ec)}}else if(Vt.type==="Polygon")for(var Rs=0,tc=ip(Vt.geometry,0);Rs<tc.length;Rs+=1){var Fs=tc[Rs],Ul=Rg(Fs,16);Xo(Fs[0],new Ss(Ul.x,Ul.y,0))}else if(Vt.type==="LineString")for(var Fa=0,ql=Vt.geometry;Fa<ql.length;Fa+=1){var Os=ql[Fa];Xo(Os,new Ss(Os[0].x,Os[0].y,0))}else if(Vt.type==="Point")for(var vp=0,ud=Vt.geometry;vp<ud.length;vp+=1)for(var gp=0,cd=ud[vp];gp<cd.length;gp+=1){var _p=cd[gp];Xo([_p],new Ss(_p.x,_p.y,0))}}(e,ce,Me,kr,a,x,Ae,$e,Be,Xr,h)},ne=0,se=e.features;ne<se.length;ne+=1)te();c&&e.generateCollisionDebugBuffers()},l.perspective=function(e,t,r,a,u){var c,h=1/Math.tan(t/2);return e[0]=h/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,u!=null&&u!==1/0?(e[10]=(u+a)*(c=1/(a-u)),e[14]=2*u*a*c):(e[10]=-1,e[14]=-2*a),e},l.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var u=t[a];u in e&&(r[u]=e[u])}return r},l.plugin=mi,l.polygonIntersectsPolygon=zn,l.postMapLoadEvent=ia,l.postTurnstileEvent=Za,l.potpack=zf,l.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],l.register=Ve,l.registerForPluginStateChange=function(e){return e({pluginStatus:li,pluginURL:ln}),ml.on("pluginStateChange",e),e},l.renderColorRamp=ff,l.rotate=function(e,t,r){var a=t[0],u=t[1],c=t[2],h=t[3],m=Math.sin(r),_=Math.cos(r);return e[0]=a*_+c*m,e[1]=u*_+h*m,e[2]=a*-m+c*_,e[3]=u*-m+h*_,e},l.rotateX=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[4],h=t[5],m=t[6],_=t[7],x=t[8],w=t[9],T=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*u+x*a,e[5]=h*u+w*a,e[6]=m*u+T*a,e[7]=_*u+C*a,e[8]=x*u-c*a,e[9]=w*u-h*a,e[10]=T*u-m*a,e[11]=C*u-_*a,e},l.rotateZ=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[0],h=t[1],m=t[2],_=t[3],x=t[4],w=t[5],T=t[6],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*u+x*a,e[1]=h*u+w*a,e[2]=m*u+T*a,e[3]=_*u+C*a,e[4]=x*u-c*a,e[5]=w*u-h*a,e[6]=T*u-m*a,e[7]=C*u-_*a,e},l.scale=function(e,t,r){var a=r[0],u=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*u,e[5]=t[5]*u,e[6]=t[6]*u,e[7]=t[7]*u,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},l.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},l.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},l.setCacheLimits=function(e,t){Po=e,Ga=t},l.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),li==="deferred"||li==="loading"||li==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");ln=rn.resolveURL(e),li="deferred",us=t,Ta(),r||Ui()},l.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},l.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},l.styleSpec=B,l.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},l.symbolSize=zg,l.transformMat3=function(e,t,r){var a=t[0],u=t[1],c=t[2];return e[0]=a*r[0]+u*r[3]+c*r[6],e[1]=a*r[1]+u*r[4]+c*r[7],e[2]=a*r[2]+u*r[5]+c*r[8],e},l.transformMat4=ms,l.translate=function(e,t,r){var a,u,c,h,m,_,x,w,T,C,k,N,U=r[0],K=r[1],W=r[2];return t===e?(e[12]=t[0]*U+t[4]*K+t[8]*W+t[12],e[13]=t[1]*U+t[5]*K+t[9]*W+t[13],e[14]=t[2]*U+t[6]*K+t[10]*W+t[14],e[15]=t[3]*U+t[7]*K+t[11]*W+t[15]):(u=t[1],c=t[2],h=t[3],m=t[4],_=t[5],x=t[6],w=t[7],T=t[8],C=t[9],k=t[10],N=t[11],e[0]=a=t[0],e[1]=u,e[2]=c,e[3]=h,e[4]=m,e[5]=_,e[6]=x,e[7]=w,e[8]=T,e[9]=C,e[10]=k,e[11]=N,e[12]=a*U+m*K+T*W+t[12],e[13]=u*U+_*K+C*W+t[13],e[14]=c*U+x*K+k*W+t[14],e[15]=h*U+w*K+N*W+t[15]),e},l.triggerPluginCompletionEvent=Cu,l.uniqueId=zt,l.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},l.validateLight=Xc,l.validateStyle=xa,l.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},l.vectorTile=_s,l.version="1.13.3",l.warnOnce=Lt,l.webpSupported=Wi,l.window=le,l.wrap=Nt}),Z(["./shared"],function(l){function ae(I){var A=typeof I;if(A==="number"||A==="boolean"||A==="string"||I==null)return JSON.stringify(I);if(Array.isArray(I)){for(var P="[",F=0,j=I;F<j.length;F+=1)P+=ae(j[F])+",";return P+"]"}for(var J=Object.keys(I).sort(),ee="{",B=0;B<J.length;B++)ee+=JSON.stringify(J[B])+":"+ae(I[J[B]])+",";return ee+"}"}function Y(I){for(var A="",P=0,F=l.refProperties;P<F.length;P+=1)A+="/"+ae(I[F[P]]);return A}var ye=function(I){this.keyCache={},I&&this.replace(I)};ye.prototype.replace=function(I){this._layerConfigs={},this._layers={},this.update(I,[])},ye.prototype.update=function(I,A){for(var P=this,F=0,j=I;F<j.length;F+=1){var J=j[F];this._layerConfigs[J.id]=J;var ee=this._layers[J.id]=l.createStyleLayer(J);ee._featureFilter=l.featureFilter(ee.filter),this.keyCache[J.id]&&delete this.keyCache[J.id]}for(var B=0,G=A;B<G.length;B+=1){var ie=G[B];delete this.keyCache[ie],delete this._layerConfigs[ie],delete this._layers[ie]}this.familiesBySource={};for(var xe=0,we=function(Ce,ke){for(var ut={},ze=0;ze<Ce.length;ze++){var yt=ke&&ke[Ce[ze].id]||Y(Ce[ze]);ke&&(ke[Ce[ze].id]=yt);var Ft=ut[yt];Ft||(Ft=ut[yt]=[]),Ft.push(Ce[ze])}var pt=[];for(var Tt in ut)pt.push(ut[Tt]);return pt}(l.values(this._layerConfigs),this.keyCache);xe<we.length;xe+=1){var fe=we[xe].map(function(Ce){return P._layers[Ce.id]}),be=fe[0];if(be.visibility!=="none"){var Ue=be.source||"",Oe=this.familiesBySource[Ue];Oe||(Oe=this.familiesBySource[Ue]={});var de=be.sourceLayer||"_geojsonTileLayer",De=Oe[de];De||(De=Oe[de]=[]),De.push(fe)}}};var me=function(I){var A={},P=[];for(var F in I){var j=I[F],J=A[F]={};for(var ee in j){var B=j[+ee];if(B&&B.bitmap.width!==0&&B.bitmap.height!==0){var G={x:0,y:0,w:B.bitmap.width+2,h:B.bitmap.height+2};P.push(G),J[ee]={rect:G,metrics:B.metrics}}}}var ie=l.potpack(P),xe=new l.AlphaImage({width:ie.w||1,height:ie.h||1});for(var we in I){var fe=I[we];for(var be in fe){var Ue=fe[+be];if(Ue&&Ue.bitmap.width!==0&&Ue.bitmap.height!==0){var Oe=A[we][be].rect;l.AlphaImage.copy(Ue.bitmap,xe,{x:0,y:0},{x:Oe.x+1,y:Oe.y+1},Ue.bitmap)}}}this.image=xe,this.positions=A};l.register("GlyphAtlas",me);var Ee=function(I){this.tileID=new l.OverscaledTileID(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId};function le(I,A,P){for(var F=new l.EvaluationParameters(A),j=0,J=I;j<J.length;j+=1)J[j].recalculate(F,P)}function ge(I,A){var P=l.getArrayBuffer(I.request,function(F,j,J,ee){F?A(F):j&&A(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(j)),rawData:j,cacheControl:J,expires:ee})});return function(){P.cancel(),A()}}Ee.prototype.parse=function(I,A,P,F,j){var J=this;this.status="parsing",this.data=I,this.collisionBoxArray=new l.CollisionBoxArray;var ee=new l.DictionaryCoder(Object.keys(I.layers).sort()),B=new l.FeatureIndex(this.tileID,this.promoteId);B.bucketLayerIDs=[];var G,ie,xe,we,fe={},be={featureIndex:B,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:P},Ue=A.familiesBySource[this.source];for(var Oe in Ue){var de=I.layers[Oe];if(de){de.version===1&&l.warnOnce('Vector tile source "'+this.source+'" layer "'+Oe+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var De=ee.encode(Oe),Ce=[],ke=0;ke<de.length;ke++){var ut=de.feature(ke),ze=B.getId(ut,Oe);Ce.push({feature:ut,id:ze,index:ke,sourceLayerIndex:De})}for(var yt=0,Ft=Ue[Oe];yt<Ft.length;yt+=1){var pt=Ft[yt],Tt=pt[0];Tt.minzoom&&this.zoom<Math.floor(Tt.minzoom)||Tt.maxzoom&&this.zoom>=Tt.maxzoom||Tt.visibility!=="none"&&(le(pt,this.zoom,P),(fe[Tt.id]=Tt.createBucket({index:B.bucketLayerIDs.length,layers:pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source})).populate(Ce,be,this.tileID.canonical),B.bucketLayerIDs.push(pt.map(function(Bt){return Bt.id})))}}}var gt=l.mapObject(be.glyphDependencies,function(Bt){return Object.keys(Bt).map(Number)});Object.keys(gt).length?F.send("getGlyphs",{uid:this.uid,stacks:gt},function(Bt,dt){G||(G=Bt,ie=dt,nr.call(J))}):ie={};var Nr=Object.keys(be.iconDependencies);Nr.length?F.send("getImages",{icons:Nr,source:this.source,tileID:this.tileID,type:"icons"},function(Bt,dt){G||(G=Bt,xe=dt,nr.call(J))}):xe={};var Pt=Object.keys(be.patternDependencies);function nr(){if(G)return j(G);if(ie&&xe&&we){var Bt=new me(ie),dt=new l.ImageAtlas(xe,we);for(var It in fe){var Yr=fe[It];Yr instanceof l.SymbolBucket?(le(Yr.layers,this.zoom,P),l.performSymbolLayout(Yr,ie,Bt.positions,xe,dt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Yr.hasPattern&&(Yr instanceof l.LineBucket||Yr instanceof l.FillBucket||Yr instanceof l.FillExtrusionBucket)&&(le(Yr.layers,this.zoom,P),Yr.addFeatures(be,this.tileID.canonical,dt.patternPositions))}this.status="done",j(null,{buckets:l.values(fe).filter(function(la){return!la.isEmpty()}),featureIndex:B,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Bt.image,imageAtlas:dt,glyphMap:this.returnDependencies?ie:null,iconMap:this.returnDependencies?xe:null,glyphPositions:this.returnDependencies?Bt.positions:null})}}Pt.length?F.send("getImages",{icons:Pt,source:this.source,tileID:this.tileID,type:"patterns"},function(Bt,dt){G||(G=Bt,we=dt,nr.call(J))}):we={},nr.call(this)};var Fe=function(I,A,P,F){this.actor=I,this.layerIndex=A,this.availableImages=P,this.loadVectorData=F||ge,this.loading={},this.loaded={}};Fe.prototype.loadTile=function(I,A){var P=this,F=I.uid;this.loading||(this.loading={});var j=!!(I&&I.request&&I.request.collectResourceTiming)&&new l.RequestPerformance(I.request),J=this.loading[F]=new Ee(I);J.abort=this.loadVectorData(I,function(ee,B){if(delete P.loading[F],ee||!B)return J.status="done",P.loaded[F]=J,A(ee);var G=B.rawData,ie={};B.expires&&(ie.expires=B.expires),B.cacheControl&&(ie.cacheControl=B.cacheControl);var xe={};if(j){var we=j.finish();we&&(xe.resourceTiming=JSON.parse(JSON.stringify(we)))}J.vectorTile=B.vectorTile,J.parse(B.vectorTile,P.layerIndex,P.availableImages,P.actor,function(fe,be){if(fe||!be)return A(fe);A(null,l.extend({rawTileData:G.slice(0)},be,ie,xe))}),P.loaded=P.loaded||{},P.loaded[F]=J})},Fe.prototype.reloadTile=function(I,A){var P=this,F=this.loaded,j=I.uid,J=this;if(F&&F[j]){var ee=F[j];ee.showCollisionBoxes=I.showCollisionBoxes;var B=function(G,ie){var xe=ee.reloadCallback;xe&&(delete ee.reloadCallback,ee.parse(ee.vectorTile,J.layerIndex,P.availableImages,J.actor,xe)),A(G,ie)};ee.status==="parsing"?ee.reloadCallback=B:ee.status==="done"&&(ee.vectorTile?ee.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,B):B())}},Fe.prototype.abortTile=function(I,A){var P=this.loading,F=I.uid;P&&P[F]&&P[F].abort&&(P[F].abort(),delete P[F]),A()},Fe.prototype.removeTile=function(I,A){var P=this.loaded,F=I.uid;P&&P[F]&&delete P[F],A()};var tt=l.window.ImageBitmap,Ne=function(){this.loaded={}};function Nt(I,A){if(I.length!==0){Ye(I[0],A);for(var P=1;P<I.length;P++)Ye(I[P],!A)}}function Ye(I,A){for(var P=0,F=0,j=0,J=I.length,ee=J-1;j<J;ee=j++){var B=(I[j][0]-I[ee][0])*(I[ee][1]+I[j][1]),G=P+B;F+=Math.abs(P)>=Math.abs(B)?P-G+B:B-G+P,P=G}P+F>=0!=!!A&&I.reverse()}Ne.prototype.loadTile=function(I,A){var P=I.uid,F=I.encoding,j=I.rawImageData,J=tt&&j instanceof tt?this.getImageData(j):j,ee=new l.DEMData(P,J,F);this.loaded=this.loaded||{},this.loaded[P]=ee,A(null,ee)},Ne.prototype.getImageData=function(I){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(I.width,I.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=I.width,this.offscreenCanvas.height=I.height,this.offscreenCanvasContext.drawImage(I,0,0,I.width,I.height);var A=this.offscreenCanvasContext.getImageData(-1,-1,I.width+2,I.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new l.RGBAImage({width:A.width,height:A.height},A.data)},Ne.prototype.removeTile=function(I){var A=this.loaded,P=I.uid;A&&A[P]&&delete A[P]};var Ct=l.vectorTile.VectorTileFeature.prototype.toGeoJSON,zt=function(I){this._feature=I,this.extent=l.EXTENT,this.type=I.type,this.properties=I.tags,"id"in I&&!isNaN(I.id)&&(this.id=parseInt(I.id,10))};zt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var I=[],A=0,P=this._feature.geometry;A<P.length;A+=1){var F=P[A];I.push([new l.Point$1(F[0],F[1])])}return I}for(var j=[],J=0,ee=this._feature.geometry;J<ee.length;J+=1){for(var B=[],G=0,ie=ee[J];G<ie.length;G+=1){var xe=ie[G];B.push(new l.Point$1(xe[0],xe[1]))}j.push(B)}return j},zt.prototype.toGeoJSON=function(I,A,P){return Ct.call(this,I,A,P)};var At=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};At.prototype.feature=function(I){return new zt(this._features[I])};var rr=l.vectorTile.VectorTileFeature,Kt=cr;function cr(I,A){this.options=A||{},this.features=I,this.length=I.length}function pr(I,A){this.id=typeof I.id=="number"?I.id:void 0,this.type=I.type,this.rawGeometry=I.type===1?[I.geometry]:I.geometry,this.properties=I.tags,this.extent=A||4096}cr.prototype.feature=function(I){return new pr(this.features[I],this.options.extent)},pr.prototype.loadGeometry=function(){var I=this.rawGeometry;this.geometry=[];for(var A=0;A<I.length;A++){for(var P=I[A],F=[],j=0;j<P.length;j++)F.push(new l.Point$1(P[j][0],P[j][1]));this.geometry.push(F)}return this.geometry},pr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var I=this.geometry,A=1/0,P=-1/0,F=1/0,j=-1/0,J=0;J<I.length;J++)for(var ee=I[J],B=0;B<ee.length;B++){var G=ee[B];A=Math.min(A,G.x),P=Math.max(P,G.x),F=Math.min(F,G.y),j=Math.max(j,G.y)}return[A,F,P,j]},pr.prototype.toGeoJSON=rr.prototype.toGeoJSON;var Hr=_i,_r=Kt;function _i(I){var A=new l.pbf;return function(P,F){for(var j in P.layers)F.writeMessage(3,Lt,P.layers[j])}(I,A),A.finish()}function Lt(I,A){var P;A.writeVarintField(15,I.version||1),A.writeStringField(1,I.name||""),A.writeVarintField(5,I.extent||4096);var F={keys:[],values:[],keycache:{},valuecache:{}};for(P=0;P<I.length;P++)F.feature=I.feature(P),A.writeMessage(2,Tr,F);var j=F.keys;for(P=0;P<j.length;P++)A.writeStringField(3,j[P]);var J=F.values;for(P=0;P<J.length;P++)A.writeMessage(4,ja,J[P])}function Tr(I,A){var P=I.feature;P.id!==void 0&&A.writeVarintField(1,P.id),A.writeMessage(2,To,I),A.writeVarintField(3,P.type),A.writeMessage(4,Eo,P)}function To(I,A){var P=I.feature,F=I.keys,j=I.values,J=I.keycache,ee=I.valuecache;for(var B in P.properties){var G=J[B];G===void 0&&(F.push(B),J[B]=G=F.length-1),A.writeVarint(G);var ie=P.properties[B],xe=typeof ie;xe!=="string"&&xe!=="boolean"&&xe!=="number"&&(ie=JSON.stringify(ie));var we=xe+":"+ie,fe=ee[we];fe===void 0&&(j.push(ie),ee[we]=fe=j.length-1),A.writeVarint(fe)}}function ii(I,A){return(A<<3)+(7&I)}function Io(I){return I<<1^I>>31}function Eo(I,A){for(var P=I.loadGeometry(),F=I.type,j=0,J=0,ee=P.length,B=0;B<ee;B++){var G=P[B],ie=1;F===1&&(ie=G.length),A.writeVarint(ii(1,ie));for(var xe=F===3?G.length-1:G.length,we=0;we<xe;we++){we===1&&F!==1&&A.writeVarint(ii(2,xe-1));var fe=G[we].x-j,be=G[we].y-J;A.writeVarint(Io(fe)),A.writeVarint(Io(be)),j+=fe,J+=be}F===3&&A.writeVarint(ii(7,1))}}function ja(I,A){var P=typeof I;P==="string"?A.writeStringField(1,I):P==="boolean"?A.writeBooleanField(7,I):P==="number"&&(I%1!=0?A.writeDoubleField(3,I):I<0?A.writeSVarintField(6,I):A.writeVarintField(5,I))}function mn(I,A,P,F){Di(I,P,F),Di(A,2*P,2*F),Di(A,2*P+1,2*F+1)}function Di(I,A,P){var F=I[A];I[A]=I[P],I[P]=F}function Gi(I,A,P,F){var j=I-P,J=A-F;return j*j+J*J}Hr.fromVectorTileJs=_i,Hr.fromGeojsonVt=function(I,A){A=A||{};var P={};for(var F in I)P[F]=new Kt(I[F].features,A),P[F].name=F,P[F].version=A.version,P[F].extent=A.extent;return _i({layers:P})},Hr.GeoJSONWrapper=_r;var jn=function(I){return I[0]},$n=function(I){return I[1]},yn=function(I,A,P,F,j){A===void 0&&(A=jn),P===void 0&&(P=$n),F===void 0&&(F=64),j===void 0&&(j=Float64Array),this.nodeSize=F,this.points=I;for(var J=I.length<65536?Uint16Array:Uint32Array,ee=this.ids=new J(I.length),B=this.coords=new j(2*I.length),G=0;G<I.length;G++)ee[G]=G,B[2*G]=A(I[G]),B[2*G+1]=P(I[G]);(function ie(xe,we,fe,be,Ue,Oe){if(!(Ue-be<=fe)){var de=be+Ue>>1;(function De(Ce,ke,ut,ze,yt,Ft){for(;yt>ze;){if(yt-ze>600){var pt=yt-ze+1,Tt=ut-ze+1,gt=Math.log(pt),Nr=.5*Math.exp(2*gt/3),Pt=.5*Math.sqrt(gt*Nr*(pt-Nr)/pt)*(Tt-pt/2<0?-1:1);De(Ce,ke,ut,Math.max(ze,Math.floor(ut-Tt*Nr/pt+Pt)),Math.min(yt,Math.floor(ut+(pt-Tt)*Nr/pt+Pt)),Ft)}var nr=ke[2*ut+Ft],Bt=ze,dt=yt;for(mn(Ce,ke,ze,ut),ke[2*yt+Ft]>nr&&mn(Ce,ke,ze,yt);Bt<dt;){for(mn(Ce,ke,Bt,dt),Bt++,dt--;ke[2*Bt+Ft]<nr;)Bt++;for(;ke[2*dt+Ft]>nr;)dt--}ke[2*ze+Ft]===nr?mn(Ce,ke,ze,dt):mn(Ce,ke,++dt,yt),dt<=ut&&(ze=dt+1),ut<=dt&&(yt=dt-1)}})(xe,we,de,be,Ue,Oe%2),ie(xe,we,fe,be,de-1,Oe+1),ie(xe,we,fe,de+1,Ue,Oe+1)}})(ee,B,F,0,ee.length-1,0)};yn.prototype.range=function(I,A,P,F){return function(j,J,ee,B,G,ie,xe){for(var we,fe,be=[0,j.length-1,0],Ue=[];be.length;){var Oe=be.pop(),de=be.pop(),De=be.pop();if(de-De<=xe)for(var Ce=De;Ce<=de;Ce++)fe=J[2*Ce+1],(we=J[2*Ce])>=ee&&we<=G&&fe>=B&&fe<=ie&&Ue.push(j[Ce]);else{var ke=Math.floor((De+de)/2);fe=J[2*ke+1],(we=J[2*ke])>=ee&&we<=G&&fe>=B&&fe<=ie&&Ue.push(j[ke]);var ut=(Oe+1)%2;(Oe===0?ee<=we:B<=fe)&&(be.push(De),be.push(ke-1),be.push(ut)),(Oe===0?G>=we:ie>=fe)&&(be.push(ke+1),be.push(de),be.push(ut))}}return Ue}(this.ids,this.coords,I,A,P,F,this.nodeSize)},yn.prototype.within=function(I,A,P){return function(F,j,J,ee,B,G){for(var ie=[0,F.length-1,0],xe=[],we=B*B;ie.length;){var fe=ie.pop(),be=ie.pop(),Ue=ie.pop();if(be-Ue<=G)for(var Oe=Ue;Oe<=be;Oe++)Gi(j[2*Oe],j[2*Oe+1],J,ee)<=we&&xe.push(F[Oe]);else{var de=Math.floor((Ue+be)/2),De=j[2*de],Ce=j[2*de+1];Gi(De,Ce,J,ee)<=we&&xe.push(F[de]);var ke=(fe+1)%2;(fe===0?J-B<=De:ee-B<=Ce)&&(ie.push(Ue),ie.push(de-1),ie.push(ke)),(fe===0?J+B>=De:ee+B>=Ce)&&(ie.push(de+1),ie.push(be),ie.push(ke))}}return xe}(this.ids,this.coords,I,A,P,this.nodeSize)};var Ks={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(I){return I}},Vr=function(I){this.options=vn(Object.create(Ks),I),this.trees=new Array(this.options.maxZoom+1)};function rn(I,A,P,F,j){return{x:I,y:A,zoom:1/0,id:P,parentId:-1,numPoints:F,properties:j}}function Rt(I,A){var P=I.geometry.coordinates,F=P[1];return{x:Li(P[0]),y:mt(F),zoom:1/0,index:A,parentId:-1}}function Wi(I){return{type:"Feature",id:I.id,properties:Ao(I),geometry:{type:"Point",coordinates:[(F=I.x,360*(F-.5)),(A=I.y,P=(180-360*A)*Math.PI/180,360*Math.atan(Math.exp(P))/Math.PI-90)]}};var A,P,F}function Ao(I){var A=I.numPoints,P=A>=1e4?Math.round(A/1e3)+"k":A>=1e3?Math.round(A/100)/10+"k":A;return vn(vn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:A,point_count_abbreviated:P})}function Li(I){return I/360+.5}function mt(I){var A=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return P<0?0:P>1?1:P}function vn(I,A){for(var P in A)I[P]=A[P];return I}function Kr(I){return I.x}function xi(I){return I.y}function Ys(I,A,P,F,j,J){var ee=j-P,B=J-F;if(ee!==0||B!==0){var G=((I-P)*ee+(A-F)*B)/(ee*ee+B*B);G>1?(P=j,F=J):G>0&&(P+=ee*G,F+=B*G)}return(ee=I-P)*ee+(B=A-F)*B}function Ri(I,A,P,F){var j={id:I===void 0?null:I,type:A,geometry:P,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(J){var ee=J.geometry,B=J.type;if(B==="Point"||B==="MultiPoint"||B==="LineString")ta(J,ee);else if(B==="Polygon"||B==="MultiLineString")for(var G=0;G<ee.length;G++)ta(J,ee[G]);else if(B==="MultiPolygon")for(G=0;G<ee.length;G++)for(var ie=0;ie<ee[G].length;ie++)ta(J,ee[G][ie])}(j),j}function ta(I,A){for(var P=0;P<A.length;P+=3)I.minX=Math.min(I.minX,A[P]),I.minY=Math.min(I.minY,A[P+1]),I.maxX=Math.max(I.maxX,A[P]),I.maxY=Math.max(I.maxY,A[P+1])}function bi(I,A,P,F){if(A.geometry){var j=A.geometry.coordinates,J=A.geometry.type,ee=Math.pow(P.tolerance/((1<<P.maxZoom)*P.extent),2),B=[],G=A.id;if(P.promoteId?G=A.properties[P.promoteId]:P.generateId&&(G=F||0),J==="Point")Zn(j,B);else if(J==="MultiPoint")for(var ie=0;ie<j.length;ie++)Zn(j[ie],B);else if(J==="LineString")Co(j,B,ee,!1);else if(J==="MultiLineString"){if(P.lineMetrics){for(ie=0;ie<j.length;ie++)Co(j[ie],B=[],ee,!1),I.push(Ri(G,"LineString",B,A.properties));return}wi(j,B,ee,!1)}else if(J==="Polygon")wi(j,B,ee,!0);else{if(J!=="MultiPolygon"){if(J==="GeometryCollection"){for(ie=0;ie<A.geometry.geometries.length;ie++)bi(I,{id:G,geometry:A.geometry.geometries[ie],properties:A.properties},P,F);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ie=0;ie<j.length;ie++){var xe=[];wi(j[ie],xe,ee,!0),B.push(xe)}}I.push(Ri(G,J,B,A.properties))}}function Zn(I,A){A.push(Si(I[0])),A.push(Gn(I[1])),A.push(0)}function Co(I,A,P,F){for(var j,J,ee=0,B=0;B<I.length;B++){var G=Si(I[B][0]),ie=Gn(I[B][1]);A.push(G),A.push(ie),A.push(0),B>0&&(ee+=F?(j*ie-G*J)/2:Math.sqrt(Math.pow(G-j,2)+Math.pow(ie-J,2))),j=G,J=ie}var xe=A.length-3;A[2]=1,function we(fe,be,Ue,Oe){for(var de,De=Oe,Ce=Ue-be>>1,ke=Ue-be,ut=fe[be],ze=fe[be+1],yt=fe[Ue],Ft=fe[Ue+1],pt=be+3;pt<Ue;pt+=3){var Tt=Ys(fe[pt],fe[pt+1],ut,ze,yt,Ft);if(Tt>De)de=pt,De=Tt;else if(Tt===De){var gt=Math.abs(pt-Ce);gt<ke&&(de=pt,ke=gt)}}De>Oe&&(de-be>3&&we(fe,be,de,Oe),fe[de+2]=De,Ue-de>3&&we(fe,de,Ue,Oe))}(A,0,xe,P),A[xe+2]=1,A.size=Math.abs(ee),A.start=0,A.end=A.size}function wi(I,A,P,F){for(var j=0;j<I.length;j++){var J=[];Co(I[j],J,P,F),A.push(J)}}function Si(I){return I/360+.5}function Gn(I){var A=Math.sin(I*Math.PI/180),P=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return P<0?0:P>1?1:P}function Fi(I,A,P,F,j,J,ee,B){if(F/=A,J>=(P/=A)&&ee<F)return I;if(ee<P||J>=F)return null;for(var G=[],ie=0;ie<I.length;ie++){var xe=I[ie],we=xe.geometry,fe=xe.type,be=j===0?xe.minX:xe.minY,Ue=j===0?xe.maxX:xe.maxY;if(be>=P&&Ue<F)G.push(xe);else if(!(Ue<P||be>=F)){var Oe=[];if(fe==="Point"||fe==="MultiPoint")$a(we,Oe,P,F,j);else if(fe==="LineString")Za(we,Oe,P,F,j,!1,B.lineMetrics);else if(fe==="MultiLineString")ia(we,Oe,P,F,j,!1);else if(fe==="Polygon")ia(we,Oe,P,F,j,!0);else if(fe==="MultiPolygon")for(var de=0;de<we.length;de++){var De=[];ia(we[de],De,P,F,j,!0),De.length&&Oe.push(De)}if(Oe.length){if(B.lineMetrics&&fe==="LineString"){for(de=0;de<Oe.length;de++)G.push(Ri(xe.id,fe,Oe[de],xe.tags));continue}fe!=="LineString"&&fe!=="MultiLineString"||(Oe.length===1?(fe="LineString",Oe=Oe[0]):fe="MultiLineString"),fe!=="Point"&&fe!=="MultiPoint"||(fe=Oe.length===3?"Point":"MultiPoint"),G.push(Ri(xe.id,fe,Oe,xe.tags))}}}return G.length?G:null}function $a(I,A,P,F,j){for(var J=0;J<I.length;J+=3){var ee=I[J+j];ee>=P&&ee<=F&&(A.push(I[J]),A.push(I[J+1]),A.push(I[J+2]))}}function Za(I,A,P,F,j,J,ee){for(var B,G,ie=ra(I),xe=j===0?Ga:ko,we=I.start,fe=0;fe<I.length-3;fe+=3){var be=I[fe],Ue=I[fe+1],Oe=I[fe+2],de=I[fe+3],De=I[fe+4],Ce=j===0?be:Ue,ke=j===0?de:De,ut=!1;ee&&(B=Math.sqrt(Math.pow(be-de,2)+Math.pow(Ue-De,2))),Ce<P?ke>P&&(G=xe(ie,be,Ue,de,De,P),ee&&(ie.start=we+B*G)):Ce>F?ke<F&&(G=xe(ie,be,Ue,de,De,F),ee&&(ie.start=we+B*G)):Po(ie,be,Ue,Oe),ke<P&&Ce>=P&&(G=xe(ie,be,Ue,de,De,P),ut=!0),ke>F&&Ce<=F&&(G=xe(ie,be,Ue,de,De,F),ut=!0),!J&&ut&&(ee&&(ie.end=we+B*G),A.push(ie),ie=ra(I)),ee&&(we+=B)}var ze=I.length-3;be=I[ze],Ue=I[ze+1],Oe=I[ze+2],(Ce=j===0?be:Ue)>=P&&Ce<=F&&Po(ie,be,Ue,Oe),ze=ie.length-3,J&&ze>=3&&(ie[ze]!==ie[0]||ie[ze+1]!==ie[1])&&Po(ie,ie[0],ie[1],ie[2]),ie.length&&A.push(ie)}function ra(I){var A=[];return A.size=I.size,A.start=I.start,A.end=I.end,A}function ia(I,A,P,F,j,J){for(var ee=0;ee<I.length;ee++)Za(I[ee],A,P,F,j,J,!1)}function Po(I,A,P,F){I.push(A),I.push(P),I.push(F)}function Ga(I,A,P,F,j,J){var ee=(J-A)/(F-A);return I.push(J),I.push(P+(j-P)*ee),I.push(1),ee}function ko(I,A,P,F,j,J){var ee=(J-P)/(j-P);return I.push(A+(F-A)*ee),I.push(J),I.push(1),ee}function na(I,A){for(var P=[],F=0;F<I.length;F++){var j,J=I[F],ee=J.type;if(ee==="Point"||ee==="MultiPoint"||ee==="LineString")j=Wn(J.geometry,A);else if(ee==="MultiLineString"||ee==="Polygon"){j=[];for(var B=0;B<J.geometry.length;B++)j.push(Wn(J.geometry[B],A))}else if(ee==="MultiPolygon")for(j=[],B=0;B<J.geometry.length;B++){for(var G=[],ie=0;ie<J.geometry[B].length;ie++)G.push(Wn(J.geometry[B][ie],A));j.push(G)}P.push(Ri(J.id,ee,j,J.tags))}return P}function Wn(I,A){var P=[];P.size=I.size,I.start!==void 0&&(P.start=I.start,P.end=I.end);for(var F=0;F<I.length;F+=3)P.push(I[F]+A,I[F+1],I[F+2]);return P}function oa(I,A){if(I.transformed)return I;var P,F,j,J=1<<I.z,ee=I.x,B=I.y;for(P=0;P<I.features.length;P++){var G=I.features[P],ie=G.geometry,xe=G.type;if(G.geometry=[],xe===1)for(F=0;F<ie.length;F+=2)G.geometry.push(aa(ie[F],ie[F+1],A,J,ee,B));else for(F=0;F<ie.length;F++){var we=[];for(j=0;j<ie[F].length;j+=2)we.push(aa(ie[F][j],ie[F][j+1],A,J,ee,B));G.geometry.push(we)}}return I.transformed=!0,I}function aa(I,A,P,F,j,J){return[Math.round(P*(I*F-j)),Math.round(P*(A*F-J))]}function Wa(I,A,P,F,j){for(var J=A===j.maxZoom?0:j.tolerance/((1<<A)*j.extent),ee={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:P,y:F,z:A,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},B=0;B<I.length;B++){ee.numFeatures++,Xa(ee,I[B],J,j);var G=I[B].minX,ie=I[B].minY,xe=I[B].maxX,we=I[B].maxY;G<ee.minX&&(ee.minX=G),ie<ee.minY&&(ee.minY=ie),xe>ee.maxX&&(ee.maxX=xe),we>ee.maxY&&(ee.maxY=we)}return ee}function Xa(I,A,P,F){var j=A.geometry,J=A.type,ee=[];if(J==="Point"||J==="MultiPoint")for(var B=0;B<j.length;B+=3)ee.push(j[B]),ee.push(j[B+1]),I.numPoints++,I.numSimplified++;else if(J==="LineString")Xn(ee,j,I,P,!1,!1);else if(J==="MultiLineString"||J==="Polygon")for(B=0;B<j.length;B++)Xn(ee,j[B],I,P,J==="Polygon",B===0);else if(J==="MultiPolygon")for(var G=0;G<j.length;G++){var ie=j[G];for(B=0;B<ie.length;B++)Xn(ee,ie[B],I,P,!0,B===0)}if(ee.length){var xe=A.tags||null;if(J==="LineString"&&F.lineMetrics){for(var we in xe={},A.tags)xe[we]=A.tags[we];xe.mapbox_clip_start=j.start/j.size,xe.mapbox_clip_end=j.end/j.size}var fe={geometry:ee,type:J==="Polygon"||J==="MultiPolygon"?3:J==="LineString"||J==="MultiLineString"?2:1,tags:xe};A.id!==null&&(fe.id=A.id),I.features.push(fe)}}function Xn(I,A,P,F,j,J){var ee=F*F;if(F>0&&A.size<(j?ee:F))P.numPoints+=A.length/3;else{for(var B=[],G=0;G<A.length;G+=3)(F===0||A[G+2]>ee)&&(P.numSimplified++,B.push(A[G]),B.push(A[G+1])),P.numPoints++;j&&function(ie,xe){for(var we=0,fe=0,be=ie.length,Ue=be-2;fe<be;Ue=fe,fe+=2)we+=(ie[fe]-ie[Ue])*(ie[fe+1]+ie[Ue+1]);if(we>0===xe)for(fe=0,be=ie.length;fe<be/2;fe+=2){var Oe=ie[fe],de=ie[fe+1];ie[fe]=ie[be-2-fe],ie[fe+1]=ie[be-1-fe],ie[be-2-fe]=Oe,ie[be-1-fe]=de}}(B,J),I.push(B)}}function nn(I,A){var P=(A=this.options=function(j,J){for(var ee in J)j[ee]=J[ee];return j}(Object.create(this.options),A)).debug;if(P&&console.time("preprocess data"),A.maxZoom<0||A.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(A.promoteId&&A.generateId)throw new Error("promoteId and generateId cannot be used together.");var F=function(j,J){var ee=[];if(j.type==="FeatureCollection")for(var B=0;B<j.features.length;B++)bi(ee,j.features[B],J,B);else bi(ee,j.type==="Feature"?j:{geometry:j},J);return ee}(I,A);this.tiles={},this.tileCoords=[],P&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",A.indexMaxZoom,A.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(F=function(j,J){var ee=J.buffer/J.extent,B=j,G=Fi(j,1,-1-ee,ee,0,-1,2,J),ie=Fi(j,1,1-ee,2+ee,0,-1,2,J);return(G||ie)&&(B=Fi(j,1,-ee,1+ee,0,-1,2,J)||[],G&&(B=na(G,1).concat(B)),ie&&(B=B.concat(na(ie,-1)))),B}(F,A)).length&&this.splitTile(F,0,0,0),P&&(F.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function on(I,A,P){return 32*((1<<I)*P+A)+I}function Mo(I,A){var P=I.tileID.canonical;if(!this._geoJSONIndex)return A(null,null);var F=this._geoJSONIndex.getTile(P.z,P.x,P.y);if(!F)return A(null,null);var j=new At(F.features),J=Hr(j);J.byteOffset===0&&J.byteLength===J.buffer.byteLength||(J=new Uint8Array(J)),A(null,{vectorTile:j,rawData:J.buffer})}Vr.prototype.load=function(I){var A=this.options,P=A.log,F=A.minZoom,j=A.maxZoom,J=A.nodeSize;P&&console.time("total time");var ee="prepare "+I.length+" points";P&&console.time(ee),this.points=I;for(var B=[],G=0;G<I.length;G++)I[G].geometry&&B.push(Rt(I[G],G));this.trees[j+1]=new yn(B,Kr,xi,J,Float32Array),P&&console.timeEnd(ee);for(var ie=j;ie>=F;ie--){var xe=+Date.now();B=this._cluster(B,ie),this.trees[ie]=new yn(B,Kr,xi,J,Float32Array),P&&console.log("z%d: %d clusters in %dms",ie,B.length,+Date.now()-xe)}return P&&console.timeEnd("total time"),this},Vr.prototype.getClusters=function(I,A){var P=((I[0]+180)%360+360)%360-180,F=Math.max(-90,Math.min(90,I[1])),j=I[2]===180?180:((I[2]+180)%360+360)%360-180,J=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)P=-180,j=180;else if(P>j){var ee=this.getClusters([P,F,180,J],A),B=this.getClusters([-180,F,j,J],A);return ee.concat(B)}for(var G=this.trees[this._limitZoom(A)],ie=[],xe=0,we=G.range(Li(P),mt(J),Li(j),mt(F));xe<we.length;xe+=1){var fe=G.points[we[xe]];ie.push(fe.numPoints?Wi(fe):this.points[fe.index])}return ie},Vr.prototype.getChildren=function(I){var A=this._getOriginId(I),P=this._getOriginZoom(I),F="No cluster with the specified id.",j=this.trees[P];if(!j)throw new Error(F);var J=j.points[A];if(!J)throw new Error(F);for(var ee=this.options.radius/(this.options.extent*Math.pow(2,P-1)),B=[],G=0,ie=j.within(J.x,J.y,ee);G<ie.length;G+=1){var xe=j.points[ie[G]];xe.parentId===I&&B.push(xe.numPoints?Wi(xe):this.points[xe.index])}if(B.length===0)throw new Error(F);return B},Vr.prototype.getLeaves=function(I,A,P){var F=[];return this._appendLeaves(F,I,A=A||10,P=P||0,0),F},Vr.prototype.getTile=function(I,A,P){var F=this.trees[this._limitZoom(I)],j=Math.pow(2,I),J=this.options,ee=J.radius/J.extent,B=(P-ee)/j,G=(P+1+ee)/j,ie={features:[]};return this._addTileFeatures(F.range((A-ee)/j,B,(A+1+ee)/j,G),F.points,A,P,j,ie),A===0&&this._addTileFeatures(F.range(1-ee/j,B,1,G),F.points,j,P,j,ie),A===j-1&&this._addTileFeatures(F.range(0,B,ee/j,G),F.points,-1,P,j,ie),ie.features.length?ie:null},Vr.prototype.getClusterExpansionZoom=function(I){for(var A=this._getOriginZoom(I)-1;A<=this.options.maxZoom;){var P=this.getChildren(I);if(A++,P.length!==1)break;I=P[0].properties.cluster_id}return A},Vr.prototype._appendLeaves=function(I,A,P,F,j){for(var J=0,ee=this.getChildren(A);J<ee.length;J+=1){var B=ee[J],G=B.properties;if(G&&G.cluster?j+G.point_count<=F?j+=G.point_count:j=this._appendLeaves(I,G.cluster_id,P,F,j):j<F?j++:I.push(B),I.length===P)break}return j},Vr.prototype._addTileFeatures=function(I,A,P,F,j,J){for(var ee=0,B=I;ee<B.length;ee+=1){var G=A[B[ee]],ie=G.numPoints,xe={type:1,geometry:[[Math.round(this.options.extent*(G.x*j-P)),Math.round(this.options.extent*(G.y*j-F))]],tags:ie?Ao(G):this.points[G.index].properties},we=void 0;ie?we=G.id:this.options.generateId?we=G.index:this.points[G.index].id&&(we=this.points[G.index].id),we!==void 0&&(xe.id=we),J.features.push(xe)}},Vr.prototype._limitZoom=function(I){return Math.max(this.options.minZoom,Math.min(+I,this.options.maxZoom+1))},Vr.prototype._cluster=function(I,A){for(var P=[],F=this.options,j=F.reduce,J=F.minPoints,ee=F.radius/(F.extent*Math.pow(2,A)),B=0;B<I.length;B++){var G=I[B];if(!(G.zoom<=A)){G.zoom=A;for(var ie=this.trees[A+1],xe=ie.within(G.x,G.y,ee),we=G.numPoints||1,fe=we,be=0,Ue=xe;be<Ue.length;be+=1){var Oe=ie.points[Ue[be]];Oe.zoom>A&&(fe+=Oe.numPoints||1)}if(fe>=J){for(var de=G.x*we,De=G.y*we,Ce=j&&we>1?this._map(G,!0):null,ke=(B<<5)+(A+1)+this.points.length,ut=0,ze=xe;ut<ze.length;ut+=1){var yt=ie.points[ze[ut]];if(!(yt.zoom<=A)){yt.zoom=A;var Ft=yt.numPoints||1;de+=yt.x*Ft,De+=yt.y*Ft,yt.parentId=ke,j&&(Ce||(Ce=this._map(G,!0)),j(Ce,this._map(yt)))}}G.parentId=ke,P.push(rn(de/fe,De/fe,ke,fe,Ce))}else if(P.push(G),fe>1)for(var pt=0,Tt=xe;pt<Tt.length;pt+=1){var gt=ie.points[Tt[pt]];gt.zoom<=A||(gt.zoom=A,P.push(gt))}}}return P},Vr.prototype._getOriginId=function(I){return I-this.points.length>>5},Vr.prototype._getOriginZoom=function(I){return(I-this.points.length)%32},Vr.prototype._map=function(I,A){if(I.numPoints)return A?vn({},I.properties):I.properties;var P=this.points[I.index].properties,F=this.options.map(P);return A&&F===P?vn({},F):F},nn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},nn.prototype.splitTile=function(I,A,P,F,j,J,ee){for(var B=[I,A,P,F],G=this.options,ie=G.debug;B.length;){F=B.pop(),P=B.pop(),A=B.pop(),I=B.pop();var xe=1<<A,we=on(A,P,F),fe=this.tiles[we];if(!fe&&(ie>1&&console.time("creation"),fe=this.tiles[we]=Wa(I,A,P,F,G),this.tileCoords.push({z:A,x:P,y:F}),ie)){ie>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",A,P,F,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var be="z"+A;this.stats[be]=(this.stats[be]||0)+1,this.total++}if(fe.source=I,j){if(A===G.maxZoom||A===j)continue;var Ue=1<<j-A;if(P!==Math.floor(J/Ue)||F!==Math.floor(ee/Ue))continue}else if(A===G.indexMaxZoom||fe.numPoints<=G.indexMaxPoints)continue;if(fe.source=null,I.length!==0){ie>1&&console.time("clipping");var Oe,de,De,Ce,ke,ut,ze=.5*G.buffer/G.extent,yt=.5-ze,Ft=.5+ze,pt=1+ze;Oe=de=De=Ce=null,ke=Fi(I,xe,P-ze,P+Ft,0,fe.minX,fe.maxX,G),ut=Fi(I,xe,P+yt,P+pt,0,fe.minX,fe.maxX,G),I=null,ke&&(Oe=Fi(ke,xe,F-ze,F+Ft,1,fe.minY,fe.maxY,G),de=Fi(ke,xe,F+yt,F+pt,1,fe.minY,fe.maxY,G),ke=null),ut&&(De=Fi(ut,xe,F-ze,F+Ft,1,fe.minY,fe.maxY,G),Ce=Fi(ut,xe,F+yt,F+pt,1,fe.minY,fe.maxY,G),ut=null),ie>1&&console.timeEnd("clipping"),B.push(Oe||[],A+1,2*P,2*F),B.push(de||[],A+1,2*P,2*F+1),B.push(De||[],A+1,2*P+1,2*F),B.push(Ce||[],A+1,2*P+1,2*F+1)}}},nn.prototype.getTile=function(I,A,P){var F=this.options,j=F.extent,J=F.debug;if(I<0||I>24)return null;var ee=1<<I,B=on(I,A=(A%ee+ee)%ee,P);if(this.tiles[B])return oa(this.tiles[B],j);J>1&&console.log("drilling down to z%d-%d-%d",I,A,P);for(var G,ie=I,xe=A,we=P;!G&&ie>0;)ie--,xe=Math.floor(xe/2),we=Math.floor(we/2),G=this.tiles[on(ie,xe,we)];return G&&G.source?(J>1&&console.log("found parent tile z%d-%d-%d",ie,xe,we),J>1&&console.time("drilling down"),this.splitTile(G.source,ie,xe,we,I,A,P),J>1&&console.timeEnd("drilling down"),this.tiles[B]?oa(this.tiles[B],j):null):null};var sa=function(I){function A(P,F,j,J){I.call(this,P,F,j,Mo),J&&(this.loadGeoJSON=J)}return I&&(A.__proto__=I),(A.prototype=Object.create(I&&I.prototype)).constructor=A,A.prototype.loadData=function(P,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=F,this._pendingLoadDataParams=P,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},A.prototype._loadData=function(){var P=this;if(this._pendingCallback&&this._pendingLoadDataParams){var F=this._pendingCallback,j=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var J=!!(j&&j.request&&j.request.collectResourceTiming)&&new l.RequestPerformance(j.request);this.loadGeoJSON(j,function(ee,B){if(ee||!B)return F(ee);if(typeof B!="object")return F(new Error("Input data given to '"+j.source+"' is not a valid GeoJSON object."));(function fe(be,Ue){var Oe,de=be&&be.type;if(de==="FeatureCollection")for(Oe=0;Oe<be.features.length;Oe++)fe(be.features[Oe],Ue);else if(de==="GeometryCollection")for(Oe=0;Oe<be.geometries.length;Oe++)fe(be.geometries[Oe],Ue);else if(de==="Feature")fe(be.geometry,Ue);else if(de==="Polygon")Nt(be.coordinates,Ue);else if(de==="MultiPolygon")for(Oe=0;Oe<be.coordinates.length;Oe++)Nt(be.coordinates[Oe],Ue);return be})(B,!0);try{if(j.filter){var G=l.createExpression(j.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(G.result==="error")throw new Error(G.value.map(function(fe){return fe.key+": "+fe.message}).join(", "));var ie=B.features.filter(function(fe){return G.value.evaluate({zoom:0},fe)});B={type:"FeatureCollection",features:ie}}P._geoJSONIndex=j.cluster?new Vr(function(fe){var be=fe.superclusterOptions,Ue=fe.clusterProperties;if(!Ue||!be)return be;for(var Oe={},de={},De={accumulated:null,zoom:0},Ce={properties:null},ke=Object.keys(Ue),ut=0,ze=ke;ut<ze.length;ut+=1){var yt=ze[ut],Ft=Ue[yt],pt=Ft[0],Tt=l.createExpression(Ft[1]),gt=l.createExpression(typeof pt=="string"?[pt,["accumulated"],["get",yt]]:pt);Oe[yt]=Tt.value,de[yt]=gt.value}return be.map=function(Nr){Ce.properties=Nr;for(var Pt={},nr=0,Bt=ke;nr<Bt.length;nr+=1){var dt=Bt[nr];Pt[dt]=Oe[dt].evaluate(De,Ce)}return Pt},be.reduce=function(Nr,Pt){Ce.properties=Pt;for(var nr=0,Bt=ke;nr<Bt.length;nr+=1){var dt=Bt[nr];De.accumulated=Nr[dt],Nr[dt]=de[dt].evaluate(De,Ce)}},be}(j)).load(B.features):function(fe,be){return new nn(fe,be)}(B,j.geojsonVtOptions)}catch(fe){return F(fe)}P.loaded={};var xe={};if(J){var we=J.finish();we&&(xe.resourceTiming={},xe.resourceTiming[j.source]=JSON.parse(JSON.stringify(we)))}F(null,xe)})}},A.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},A.prototype.reloadTile=function(P,F){var j=this.loaded;return j&&j[P.uid]?I.prototype.reloadTile.call(this,P,F):this.loadTile(P,F)},A.prototype.loadGeoJSON=function(P,F){if(P.request)l.getJSON(P.request,F);else{if(typeof P.data!="string")return F(new Error("Input data given to '"+P.source+"' is not a valid GeoJSON object."));try{return F(null,JSON.parse(P.data))}catch{return F(new Error("Input data given to '"+P.source+"' is not a valid GeoJSON object."))}}},A.prototype.removeSource=function(P,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),F()},A.prototype.getClusterExpansionZoom=function(P,F){try{F(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(j){F(j)}},A.prototype.getClusterChildren=function(P,F){try{F(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(j){F(j)}},A.prototype.getClusterLeaves=function(P,F){try{F(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(j){F(j)}},A}(Fe),ir=function(I){var A=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Fe,geojson:sa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(P,F){if(A.workerSourceTypes[P])throw new Error('Worker source with name "'+P+'" already registered.');A.workerSourceTypes[P]=F},this.self.registerRTLTextPlugin=function(P){if(l.plugin.isParsed())throw new Error("RTL text plugin already registered.");l.plugin.applyArabicShaping=P.applyArabicShaping,l.plugin.processBidirectionalText=P.processBidirectionalText,l.plugin.processStyledBidirectionalText=P.processStyledBidirectionalText}};return ir.prototype.setReferrer=function(I,A){this.referrer=A},ir.prototype.setImages=function(I,A,P){for(var F in this.availableImages[I]=A,this.workerSources[I]){var j=this.workerSources[I][F];for(var J in j)j[J].availableImages=A}P()},ir.prototype.setLayers=function(I,A,P){this.getLayerIndex(I).replace(A),P()},ir.prototype.updateLayers=function(I,A,P){this.getLayerIndex(I).update(A.layers,A.removedIds),P()},ir.prototype.loadTile=function(I,A,P){this.getWorkerSource(I,A.type,A.source).loadTile(A,P)},ir.prototype.loadDEMTile=function(I,A,P){this.getDEMWorkerSource(I,A.source).loadTile(A,P)},ir.prototype.reloadTile=function(I,A,P){this.getWorkerSource(I,A.type,A.source).reloadTile(A,P)},ir.prototype.abortTile=function(I,A,P){this.getWorkerSource(I,A.type,A.source).abortTile(A,P)},ir.prototype.removeTile=function(I,A,P){this.getWorkerSource(I,A.type,A.source).removeTile(A,P)},ir.prototype.removeDEMTile=function(I,A){this.getDEMWorkerSource(I,A.source).removeTile(A)},ir.prototype.removeSource=function(I,A,P){if(this.workerSources[I]&&this.workerSources[I][A.type]&&this.workerSources[I][A.type][A.source]){var F=this.workerSources[I][A.type][A.source];delete this.workerSources[I][A.type][A.source],F.removeSource!==void 0?F.removeSource(A,P):P()}},ir.prototype.loadWorkerSource=function(I,A,P){try{this.self.importScripts(A.url),P()}catch(F){P(F.toString())}},ir.prototype.syncRTLPluginState=function(I,A,P){try{l.plugin.setState(A);var F=l.plugin.getPluginURL();if(l.plugin.isLoaded()&&!l.plugin.isParsed()&&F!=null){this.self.importScripts(F);var j=l.plugin.isParsed();P(j?void 0:new Error("RTL Text Plugin failed to import scripts from "+F),j)}}catch(J){P(J.toString())}},ir.prototype.getAvailableImages=function(I){var A=this.availableImages[I];return A||(A=[]),A},ir.prototype.getLayerIndex=function(I){var A=this.layerIndexes[I];return A||(A=this.layerIndexes[I]=new ye),A},ir.prototype.getWorkerSource=function(I,A,P){var F=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][A]||(this.workerSources[I][A]={}),this.workerSources[I][A][P]||(this.workerSources[I][A][P]=new this.workerSourceTypes[A]({send:function(j,J,ee){F.actor.send(j,J,ee,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][A][P]},ir.prototype.getDEMWorkerSource=function(I,A){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][A]||(this.demWorkerSources[I][A]=new Ne),this.demWorkerSources[I][A]},ir.prototype.enforceCacheSizeLimit=function(I,A){l.enforceCacheSizeLimit(A)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new ir(self)),ir}),Z(["./shared"],function(l){var ae=l.createCommonjsModule(function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var d,g,b=new Blob([""],{type:"text/javascript"}),E=URL.createObjectURL(b);try{g=new Worker(E),d=!0}catch{d=!1}return g&&g.terminate(),URL.revokeObjectURL(E),d}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var d=document.createElement("canvas");d.width=d.height=1;var g=d.getContext("2d");if(!g)return!1;var b=g.getImageData(0,0,1,1);return b&&b.width===d.width}()?(s[f=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[f]=function(d){var g=function(E){var z=document.createElement("canvas"),D=Object.create(o.webGLContextAttributes);return D.failIfMajorPerformanceCaveat=E,z.probablySupportsContext?z.probablySupportsContext("webgl",D)||z.probablySupportsContext("experimental-webgl",D):z.supportsContext?z.supportsContext("webgl",D)||z.supportsContext("experimental-webgl",D):z.getContext("webgl",D)||z.getContext("experimental-webgl",D)}(d);if(!g)return!1;var b=g.createShader(g.VERTEX_SHADER);return!(!b||g.isContextLost())&&(g.shaderSource(b,"void main() {}"),g.compileShader(b),g.getShaderParameter(b,g.COMPILE_STATUS)===!0)}(f)),s[f]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var f}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),Y={create:function(i,o,n){var s=l.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return l.window.document.createElementNS(i,o)}},ye=l.window.document&&l.window.document.documentElement.style;function me(i){if(!ye)return i[0];for(var o=0;o<i.length;o++)if(i[o]in ye)return i[o];return i[0]}var Ee,le=me(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);Y.disableDrag=function(){ye&&le&&(Ee=ye[le],ye[le]="none")},Y.enableDrag=function(){ye&&le&&(ye[le]=Ee)};var ge=me(["transform","WebkitTransform"]);Y.setTransform=function(i,o){i.style[ge]=o};var Fe=!1;try{var tt=Object.defineProperty({},"passive",{get:function(){Fe=!0}});l.window.addEventListener("test",tt,tt),l.window.removeEventListener("test",tt,tt)}catch{Fe=!1}Y.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&Fe?s:s.capture)},Y.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&Fe?s:s.capture)};var Ne=function(i){i.preventDefault(),i.stopPropagation(),l.window.removeEventListener("click",Ne,!0)};function Nt(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}Y.suppressClick=function(){l.window.addEventListener("click",Ne,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",Ne,!0)},0)},Y.mousePos=function(i,o){var n=i.getBoundingClientRect();return new l.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},Y.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new l.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},Y.mouseButton=function(i){return l.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&l.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},Y.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var Ye=function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var f=p[s];this._notify(f.ids,f.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,f=0,d=n;f<d.length;f+=1){var g=d[f];if(g[0]<p||g[1]<g[0]||s<g[1])return!1;p=g[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var f=0,d=n;f<d.length;f+=1)this.images[d[f]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},f=0,d=n;f<d.length;f+=1){var g=d[f];this.images[g]||this.fire(new l.Event("styleimagemissing",{id:g}));var b=this.images[g];b?p[g]={data:b.data.clone(),pixelRatio:b.pixelRatio,sdf:b.sdf,version:b.version,stretchX:b.stretchX,stretchY:b.stretchY,content:b.content,hasRenderCallback:!!(b.userImage&&b.userImage.render)}:l.warnOnce('Image "'+g+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var f={w:p.data.width+2,h:p.data.height+2,x:0,y:0},d=new l.ImagePosition(f,p);this.patterns[n]={bin:f,position:d}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new l.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=l.potpack(n),f=p.w,d=p.h,g=this.atlasImage;for(var b in g.resize({width:f||1,height:d||1}),this.patterns){var E=this.patterns[b].bin,z=E.x+1,D=E.y+1,L=this.images[b].data,$=L.width,q=L.height;l.RGBAImage.copy(L,g,{x:0,y:0},{x:z,y:D},{width:$,height:q}),l.RGBAImage.copy(L,g,{x:0,y:q-1},{x:z,y:D-1},{width:$,height:1}),l.RGBAImage.copy(L,g,{x:0,y:0},{x:z,y:D+q},{width:$,height:1}),l.RGBAImage.copy(L,g,{x:$-1,y:0},{x:z-1,y:D},{width:1,height:q}),l.RGBAImage.copy(L,g,{x:0,y:0},{x:z+$,y:D},{width:1,height:q})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var f=p[s];if(!this.callbackDispatchedThisFrame[f]){this.callbackDispatchedThisFrame[f]=!0;var d=this.images[f];Nt(d)&&this.updateImage(f,d)}}},o}(l.Evented),Ct=rr,zt=rr,At=1e20;function rr(i,o,n,s,p,f){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=f||"normal",this.radius=n||8;var d=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=d,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(d*d),this.gridInner=new Float64Array(d*d),this.f=new Float64Array(d),this.d=new Float64Array(d),this.z=new Float64Array(d+1),this.v=new Int16Array(d),this.middle=Math.round(d/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Kt(i,o,n,s,p,f,d){for(var g=0;g<o;g++){for(var b=0;b<n;b++)s[b]=i[b*o+g];for(cr(s,p,f,d,n),b=0;b<n;b++)i[b*o+g]=p[b]}for(b=0;b<n;b++){for(g=0;g<o;g++)s[g]=i[b*o+g];for(cr(s,p,f,d,o),g=0;g<o;g++)i[b*o+g]=Math.sqrt(p[g])}}function cr(i,o,n,s,p){n[0]=0,s[0]=-At,s[1]=+At;for(var f=1,d=0;f<p;f++){for(var g=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);g<=s[d];)d--,g=(i[f]+f*f-(i[n[d]]+n[d]*n[d]))/(2*f-2*n[d]);n[++d]=f,s[d]=g,s[d+1]=+At}for(f=0,d=0;f<p;f++){for(;s[d+1]<f;)d++;o[f]=(f-n[d])*(f-n[d])+i[n[d]]}}rr.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?At:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?At:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(Kt(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Kt(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},Ct.default=zt;var pr=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};pr.prototype.setURL=function(i){this.url=i},pr.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var f=0,d=i[p];f<d.length;f+=1)s.push({stack:p,id:d[f]});l.asyncAll(s,function(g,b){var E=g.stack,z=g.id,D=n.entries[E];D||(D=n.entries[E]={glyphs:{},requests:{},ranges:{}});var L=D.glyphs[z];if(L===void 0){if(L=n._tinySDF(D,E,z))return D.glyphs[z]=L,void b(null,{stack:E,id:z,glyph:L});var $=Math.floor(z/256);if(256*$>65535)b(new Error("glyphs > 65535 not supported"));else if(D.ranges[$])b(null,{stack:E,id:z,glyph:L});else{var q=D.requests[$];q||(q=D.requests[$]=[],pr.loadGlyphRange(E,$,n.url,n.requestManager,function(H,V){if(V){for(var X in V)n._doesCharSupportLocalGlyph(+X)||(D.glyphs[+X]=V[+X]);D.ranges[$]=!0}for(var Q=0,re=q;Q<re.length;Q+=1)(0,re[Q])(H,V);delete D.requests[$]})),q.push(function(H,V){H?b(H):V&&b(null,{stack:E,id:z,glyph:V[z]||null})})}}else b(null,{stack:E,id:z,glyph:L})},function(g,b){if(g)o(g);else if(b){for(var E={},z=0,D=b;z<D.length;z+=1){var L=D[z],$=L.stack,q=L.id,H=L.glyph;(E[$]||(E[$]={}))[q]=H&&{id:H.id,bitmap:H.bitmap.clone(),metrics:H.metrics}}o(null,E)}})},pr.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(l.isChar["CJK Unified Ideographs"](i)||l.isChar["Hangul Syllables"](i)||l.isChar.Hiragana(i)||l.isChar.Katakana(i))},pr.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var f="400";/bold/i.test(o)?f="900":/medium/i.test(o)?f="500":/light/i.test(o)&&(f="200"),p=i.tinySDF=new pr.TinySDF(24,3,8,.25,s,f)}return{id:n,bitmap:new l.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},pr.loadGlyphRange=function(i,o,n,s,p){var f=256*o,d=f+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",f+"-"+d),l.ResourceType.Glyphs);l.getArrayBuffer(g,function(b,E){if(b)p(b);else if(E){for(var z={},D=0,L=l.parseGlyphPBF(E);D<L.length;D+=1){var $=L[D];z[$.id]=$}p(null,z)}})},pr.TinySDF=Ct;var Hr=function(){this.specification=l.styleSpec.light.position};Hr.prototype.possiblyEvaluate=function(i,o){return l.sphericalToCartesian(i.expression.evaluate(o))},Hr.prototype.interpolate=function(i,o,n){return{x:l.number(i.x,o.x,n),y:l.number(i.y,o.y,n),z:l.number(i.z,o.z,n)}};var _r=new l.Properties({anchor:new l.DataConstantProperty(l.styleSpec.light.anchor),position:new Hr,color:new l.DataConstantProperty(l.styleSpec.light.color),intensity:new l.DataConstantProperty(l.styleSpec.light.intensity)}),_i=function(i){function o(n){i.call(this),this._transitionable=new l.Transitionable(_r),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(l.validateLight,n,s))for(var p in n){var f=n[p];l.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),f):this._transitionable.setValue(p,f)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&l.emitValidationErrors(this,n.call(l.validateStyle,l.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:l.styleSpec})))},o}(l.Evented),Lt=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Lt.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},Lt.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,f=i[0]*n,d=!0;s.push({left:p,right:f,isDash:d,zeroLength:i[0]===0});for(var g=i[0],b=1;b<i.length;b++){var E=i[b];s.push({left:p=g*n,right:f=(g+=E)*n,isDash:d=!d,zeroLength:E===0})}return s},Lt.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var f=this.width*(this.nextRow+n+p),d=0,g=i[d],b=0;b<this.width;b++){b/g.right>1&&(g=i[++d]);var E=Math.abs(b-g.left),z=Math.abs(b-g.right),D=Math.min(E,z),L=void 0,$=p/n*(s+1);if(g.isDash){var q=s-Math.abs($);L=Math.sqrt(D*D+q*q)}else L=s-Math.sqrt(D*D+$*$);this.data[f+b]=Math.max(0,Math.min(255,L+128))}},Lt.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],f=i[i.length-1];p.isDash===f.isDash&&(p.left=f.left-this.width,f.right=p.right+this.width);for(var d=this.width*this.nextRow,g=0,b=i[g],E=0;E<this.width;E++){E/b.right>1&&(b=i[++g]);var z=Math.abs(E-b.left),D=Math.abs(E-b.right),L=Math.min(z,D);this.data[d+E]=Math.max(0,Math.min(255,(b.isDash?L:-L)+128))}},Lt.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return l.warnOnce("LineAtlas out of space"),null;for(var p=0,f=0;f<i.length;f++)p+=i[f];if(p!==0){var d=this.width/p,g=this.getDashRanges(i,this.width,d);o?this.addRoundDash(g,d,n):this.addRegularDash(g)}var b={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,b},Lt.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Tr=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=l.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var f=new i.Actor(s[p],n,this.id);f.name="Worker "+p,this.actors.push(f)}};function To(i,o,n){var s=function(p,f){if(p)return n(p);if(f){var d=l.pick(l.extend(f,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);f.vector_layers&&(d.vectorLayers=f.vector_layers,d.vectorLayerIds=d.vectorLayers.map(function(g){return g.id})),d.tiles=o.canonicalizeTileset(d,i.url),n(null,d)}};return i.url?l.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),l.ResourceType.Source),s):l.browser.frame(function(){return s(null,i)})}Tr.prototype.broadcast=function(i,o,n){l.asyncAll(this.actors,function(s,p){s.send(i,o,p)},n=n||function(){})},Tr.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Tr.prototype.remove=function(){this.actors.forEach(function(i){i.remove()}),this.actors=[],this.workerPool.release(this.id)},Tr.Actor=l.Actor;var ii=function(i,o,n){this.bounds=l.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};ii.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},ii.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(l.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*o),f=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<f};var Io=function(i){function o(n,s,p,f){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.extend(this,l.pick(s,["url","scheme","tileSize","promoteId"])),this._options=l.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=To(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new ii(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty(function(){s._options.tiles=n}),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty(function(){s.url=n,s._options.url=n}),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),f={request:this.map._requestManager.transformRequest(p,l.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(g,b){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(b&&b.resourceTiming&&(n.resourceTiming=b.resourceTiming),this.map._refreshExpiredTiles&&b&&n.setExpiryData(b),n.loadVectorData(b,this.map.painter),l.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}f.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",f,d.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",f,d.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Eo=function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(f),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.extend({type:"raster"},s),l.extend(this,l.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=To(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new ii(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,f=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=l.getImage(this.map._requestManager.transformRequest(f,l.ResourceType.Tile),function(d,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(g){p.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var b=p.map.painter.context,E=b.gl;n.texture=p.map.painter.getTileTexture(g.width),n.texture?n.texture.update(g,{useMipmap:!0}):(n.texture=new l.Texture(b,g,E.RGBA,{useMipmap:!0}),n.texture.bind(E.LINEAR,E.CLAMP_TO_EDGE,E.LINEAR_MIPMAP_NEAREST),b.extTextureFilterAnisotropic&&E.texParameterf(E.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax)),n.state="loaded",l.cacheEntryPossiblyAdded(p.dispatcher),s(null)}})},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o}(l.Evented),ja=function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.type="raster-dem",this.maxzoom=22,this._options=l.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function f(d,g){d&&(n.state="errored",s(d)),g&&(n.dem=g,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=l.getImage(this.map._requestManager.transformRequest(p,l.ResourceType.Tile),(function(d,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(d)n.state="errored",s(d);else if(g){this.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var b=l.window.ImageBitmap&&g instanceof l.window.ImageBitmap&&l.offscreenCanvasSupported()?g:l.browser.getImageData(g,1),E={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:b,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",E,f.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),f=(s.x-1+p)%p,d=s.x===0?n.wrap-1:n.wrap,g=(s.x+1+p)%p,b=s.x+1===p?n.wrap+1:n.wrap,E={};return E[new l.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y).key]={backfilled:!1},E[new l.OverscaledTileID(n.overscaledZ,b,s.z,g,s.y).key]={backfilled:!1},s.y>0&&(E[new l.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y-1).key]={backfilled:!1},E[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},E[new l.OverscaledTileID(n.overscaledZ,b,s.z,g,s.y-1).key]={backfilled:!1}),s.y+1<p&&(E[new l.OverscaledTileID(n.overscaledZ,d,s.z,f,s.y+1).key]={backfilled:!1},E[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},E[new l.OverscaledTileID(n.overscaledZ,b,s.z,g,s.y+1).key]={backfilled:!1}),E},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o}(Eo),mn=function(i){function o(n,s,p,f){i.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=p.getActor(),this.setEventedParent(f),this._data=s.data,this._options=l.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var d=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*d,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*d,extent:l.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:l.EXTENT,radius:(s.clusterRadius||50)*d,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(s){if(s)n.fire(new l.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new l.Event("data",p))}})},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(p){if(p)s.fire(new l.ErrorEvent(p));else{var f={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(f.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new l.Event("data",f))}}),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,f){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},f),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=l.extend({},this.workerOptions),f=this._data;typeof f=="string"?(p.request=this.map._requestManager.transformRequest(l.browser.resolveURL(f),l.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(f),this.actor.send(this.type+".loadData",p,function(d,g){s._removed||g&&g.abandoned||(s._loaded=!0,g&&g.resourceTiming&&g.resourceTiming[s.id]&&(s._resourceTiming=g.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(d))})},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,f=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(f,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(d,g){return delete n.request,n.unloadVectorData(),n.aborted?s(null):d?s(d):(n.loadVectorData(g,p.map.painter,f==="reloadTile"),s(null))})},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return l.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Di=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Gi=function(i){function o(n,s,p,f){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(f),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this.url=this.options.url,l.getImage(this.map._requestManager.transformRequest(this.url,l.ResourceType.Image),function(f,d){p._loaded=!0,f?p.fire(new l.ErrorEvent(f)):d&&(p.image=d,n&&(p.coordinates=n),s&&s(),p._finishLoading())})},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,function(){s.texture=null}),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(l.MercatorCoordinate.fromLngLat);this.tileID=function(d){for(var g=1/0,b=1/0,E=-1/0,z=-1/0,D=0,L=d;D<L.length;D+=1){var $=L[D];g=Math.min(g,$.x),b=Math.min(b,$.y),E=Math.max(E,$.x),z=Math.max(z,$.y)}var q=Math.max(E-g,z-b),H=Math.max(0,Math.floor(-Math.log(q)/Math.LN2)),V=Math.pow(2,H);return new l.CanonicalTileID(H,Math.floor((g+E)/2*V),Math.floor((b+z)/2*V))}(p),this.minzoom=this.maxzoom=this.tileID.z;var f=p.map(function(d){return s.tileID.getTilePoint(d)._round()});return this._boundsArray=new l.StructArrayLayout4i8,this._boundsArray.emplaceBack(f[0].x,f[0].y,0,0),this._boundsArray.emplaceBack(f[1].x,f[1].y,l.EXTENT,0),this._boundsArray.emplaceBack(f[3].x,f[3].y,0,l.EXTENT),this._boundsArray.emplaceBack(f[2].x,f[2].y,l.EXTENT,l.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Di.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new l.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o}(l.Evented),jn=function(i){function o(n,s,p,f){i.call(this,n,s,p,f),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,f=s.urls;p<f.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(f[p],l.ResourceType.Source).url);l.getVideo(this.urls,function(d,g){n._loaded=!0,d?n.fire(new l.ErrorEvent(d)):g&&(n.video=g,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",function(){n.map.triggerRepaint()}),n.map&&n.video.play(),n._finishLoading())})},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new l.ErrorEvent(new l.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Di.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new l.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var f=this.tiles[p];f.state!=="loaded"&&(f.state="loaded",f.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o}(Gi),$n=function(i){function o(n,s,p,f){i.call(this,n,s,p,f),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(function(d){return!Array.isArray(d)||d.length!==2||d.some(function(g){return typeof g!="number"})})||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof l.window.HTMLCanvasElement||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof l.window.HTMLCanvasElement?this.options.canvas:l.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new l.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var f in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Di.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new l.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var d=this.tiles[f];d.state!=="loaded"&&(d.state="loaded",d.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o}(Gi),yn={vector:Io,raster:Eo,"raster-dem":ja,geojson:mn,video:jn,image:Gi,canvas:$n};function Ks(i,o){var n=l.identity([]);return l.translate(n,n,[1,1,0]),l.scale(n,n,[.5*i.width,.5*i.height,1]),l.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function Vr(i,o,n,s,p,f){var d=function(H,V,X){if(H)for(var Q=0,re=H;Q<re.length;Q+=1){var pe=V[re[Q]];if(pe&&pe.source===X&&pe.type==="fill-extrusion")return!0}else for(var ue in V){var he=V[ue];if(he.source===X&&he.type==="fill-extrusion")return!0}return!1}(p&&p.layers,o,i.id),g=f.maxPitchScaleFactor(),b=i.tilesIn(s,g,d);b.sort(rn);for(var E=[],z=0,D=b;z<D.length;z+=1){var L=D[z];E.push({wrappedTileID:L.tileID.wrapped().key,queryResults:L.tile.queryRenderedFeatures(o,n,i._state,L.queryGeometry,L.cameraQueryGeometry,L.scale,p,f,g,Ks(i.transform,L.tileID))})}var $=function(H){for(var V={},X={},Q=0,re=H;Q<re.length;Q+=1){var pe=re[Q],ue=pe.queryResults,he=pe.wrappedTileID,_e=X[he]=X[he]||{};for(var Ie in ue)for(var Te=ue[Ie],Le=_e[Ie]=_e[Ie]||{},Ge=V[Ie]=V[Ie]||[],Ke=0,He=Te;Ke<He.length;Ke+=1){var xt=He[Ke];Le[xt.featureIndex]||(Le[xt.featureIndex]=!0,Ge.push(xt))}}return V}(E);for(var q in $)$[q].forEach(function(H){var V=H.feature,X=i.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=X});return $}function rn(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Rt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Rt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Rt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var f={value:o,timeout:void 0};if(n!==void 0&&(f.timeout=setTimeout(function(){s.remove(i,f)},n)),this.data[p].push(f),this.order.push(p),this.order.length>this.max){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Rt.prototype.has=function(i){return i.wrapped().key in this.data},Rt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Rt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Rt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Rt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Rt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Rt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Rt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var f=p[s];i(f.value)||o.push(f)}for(var d=0,g=o;d<g.length;d+=1){var b=g[d];this.remove(b.value.tileID,b)}};var Wi=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Wi.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Wi.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Wi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Ao={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Li=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Li.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Li.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},Li.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},Li.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],f=o.attributes[p.name];f!==void 0&&i.vertexAttribPointer(f,p.components,i[Ao[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},Li.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var mt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};mt.prototype.get=function(){return this.current},mt.prototype.set=function(i){},mt.prototype.getDefault=function(){return this.default},mt.prototype.setDefault=function(){this.set(this.default)};var vn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(mt),Kr=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o}(mt),xi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o}(mt),Ys=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(mt),Ri=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o}(mt),ta=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o}(mt),bi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o}(mt),Zn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o}(mt),Co=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o}(mt),wi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o}(mt),Si=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o}(mt),Gn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o}(mt),Fi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o}(mt),$a=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o}(mt),Za=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(mt),ra=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o}(mt),ia=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o}(mt),Po=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o}(mt),Ga=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o}(mt),ko=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o}(mt),na=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o}(mt),Wn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(mt),oa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o}(mt),aa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(mt),Wa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o}(mt),Xa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o}(mt),Xn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o}(mt),nn=function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o}(mt),on=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o}(mt),Mo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o}(mt),sa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o}(mt),ir=function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o}(mt),I=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o}(ir),A=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(ir),P=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new I(i,p),s&&(this.depthAttachment=new A(i,p))};P.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var F=function(i,o,n){this.func=i,this.mask=o,this.range=n};F.ReadOnly=!1,F.ReadWrite=!0,F.disabled=new F(519,F.ReadOnly,[0,1]);var j=function(i,o,n,s,p,f){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=f};j.disabled=new j({func:519,mask:0},0,0,7680,7680,7680);var J=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};J.disabled=new J(J.Replace=[1,0],l.Color.transparent,[!1,!1,!1,!1]),J.unblended=new J(J.Replace,l.Color.transparent,[!0,!0,!0,!0]),J.alphaBlended=new J([1,771],l.Color.transparent,[!0,!0,!0,!0]);var ee=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ee.disabled=new ee(!1,1029,2305),ee.backCCW=new ee(!0,1029,2305);var B=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new vn(this),this.clearDepth=new Kr(this),this.clearStencil=new xi(this),this.colorMask=new Ys(this),this.depthMask=new Ri(this),this.stencilMask=new ta(this),this.stencilFunc=new bi(this),this.stencilOp=new Zn(this),this.stencilTest=new Co(this),this.depthRange=new wi(this),this.depthTest=new Si(this),this.depthFunc=new Gn(this),this.blend=new Fi(this),this.blendFunc=new $a(this),this.blendColor=new Za(this),this.blendEquation=new ra(this),this.cullFace=new ia(this),this.cullFaceSide=new Po(this),this.frontFace=new Ga(this),this.program=new ko(this),this.activeTexture=new na(this),this.viewport=new Wn(this),this.bindFramebuffer=new oa(this),this.bindRenderbuffer=new aa(this),this.bindTexture=new Wa(this),this.bindVertexBuffer=new Xa(this),this.bindElementBuffer=new Xn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new nn(this),this.pixelStoreUnpack=new on(this),this.pixelStoreUnpackPremultiplyAlpha=new Mo(this),this.pixelStoreUnpackFlipY=new sa(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};B.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},B.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},B.prototype.createIndexBuffer=function(i,o){return new Wi(this,i,o)},B.prototype.createVertexBuffer=function(i,o,n){return new Li(this,i,o,n)},B.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},B.prototype.createFramebuffer=function(i,o,n){return new P(this,i,o,n)},B.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},B.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},B.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},B.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},B.prototype.setColorMode=function(i){l.deepEqual(i.blendFunction,J.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},B.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var G=function(i){function o(n,s,p){var f=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(d){d.dataType==="source"&&d.sourceDataType==="metadata"&&(f._sourceLoaded=!0),f._sourceLoaded&&!f._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(f.reload(),f.transform&&f.update(f.transform))}),this.on("error",function(){f._sourceErrored=!0}),this._source=function(d,g,b,E){var z=new yn[g.type](d,g,b,E);if(z.id!==d)throw new Error("Expected Source id to be "+d+" instead of "+z.id);return l.bindAll(["load","abort","unload","serialize","prepare"],z),z}(n,s,p,this),this._tiles={},this._cache=new Rt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new l.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,function(){})},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,function(){})},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return l.values(this._tiles).map(function(n){return n.tileID}).sort(ie).map(function(n){return n.key})},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var f in this._tiles)this._isIdRenderable(f,n)&&p.push(this._tiles[f]);return n?p.sort(function(d,g){var b=d.tileID,E=g.tileID,z=new l.Point(b.canonical.x,b.canonical.y)._rotate(s.transform.angle),D=new l.Point(E.canonical.x,E.canonical.y)._rotate(s.transform.angle);return b.overscaledZ-E.overscaledZ||D.y-z.y||D.x-z.x}).map(function(d){return d.tileID.key}):p.map(function(d){return d.tileID}).sort(ie).map(function(d){return d.key})},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,f){if(f)return n.state="errored",void(f.status!==404?this._source.fire(new l.ErrorEvent(f,{tile:n})):this.update(this.transform));n.timeAdded=l.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new l.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var f=s[p];if(n.neighboringTiles&&n.neighboringTiles[f]){var d=this.getTileByID(f);g(n,d),g(d,n)}}function g(b,E){b.needsHillshadePrepare=!0;var z=E.tileID.canonical.x-b.tileID.canonical.x,D=E.tileID.canonical.y-b.tileID.canonical.y,L=Math.pow(2,b.tileID.canonical.z),$=E.tileID.key;z===0&&D===0||Math.abs(D)>1||(Math.abs(z)>1&&(Math.abs(z+L)===1?z+=L:Math.abs(z-L)===1&&(z-=L)),E.dem&&b.dem&&(b.dem.backfillBorder(E.dem,z,D),b.neighboringTiles&&b.neighboringTiles[$]&&(b.neighboringTiles[$].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,f){for(var d in this._tiles){var g=this._tiles[d];if(!(f[d]||!g.hasData()||g.tileID.overscaledZ<=s||g.tileID.overscaledZ>p)){for(var b=g.tileID;g&&g.tileID.overscaledZ>s+1;){var E=g.tileID.scaledTo(g.tileID.overscaledZ-1);(g=this._tiles[E.key])&&g.hasData()&&(b=E)}for(var z=b;z.overscaledZ>s;)if(n[(z=z.scaledTo(z.overscaledZ-1)).key]){f[b.key]=b;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var f=n.overscaledZ-1;f>=s;f--){var d=n.scaledTo(f),g=this._getLoadedTile(d);if(g)return g}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,f=Math.floor(s*p*5),d=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,f):f;this._cache.setMaxSize(d)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var f in this._tiles){var d=this._tiles[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+s),p[d.tileID.key]=d}for(var g in this._tiles=p,this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(var b in this._tiles)this._setTileReloadTimer(b,this._tiles[b])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(_e){return new l.OverscaledTileID(_e.canonical.z,_e.wrap,_e.canonical.z,_e.canonical.x,_e.canonical.y)}):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter(function(_e){return s._source.hasTile(_e)}))):p=[];var f=n.coveringZoomLevel(this._source),d=Math.max(f-o.maxOverzooming,this._source.minzoom),g=Math.max(f+o.maxUnderzooming,this._source.minzoom),b=this._updateRetainedTiles(p,f);if(xe(this._source.type)){for(var E={},z={},D=0,L=Object.keys(b);D<L.length;D+=1){var $=L[D],q=b[$],H=this._tiles[$];if(H&&!(H.fadeEndTime&&H.fadeEndTime<=l.browser.now())){var V=this.findLoadedParent(q,d);V&&(this._addTile(V.tileID),E[V.tileID.key]=V.tileID),z[$]=q}}for(var X in this._retainLoadedChildren(z,f,g,b),E)b[X]||(this._coveredTiles[X]=!0,b[X]=E[X])}for(var Q in b)this._tiles[Q].clearFadeHold();for(var re=0,pe=l.keysDifference(this._tiles,b);re<pe.length;re+=1){var ue=pe[re],he=this._tiles[ue];he.hasSymbolBuckets&&!he.holdingForFade()?he.setHoldDuration(this.map._fadeDuration):he.hasSymbolBuckets&&!he.symbolFadeFinished()||this._removeTile(ue)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},f={},d=Math.max(s-o.maxOverzooming,this._source.minzoom),g=Math.max(s+o.maxUnderzooming,this._source.minzoom),b={},E=0,z=n;E<z.length;E+=1){var D=z[E],L=this._addTile(D);p[D.key]=D,L.hasData()||s<this._source.maxzoom&&(b[D.key]=D)}this._retainLoadedChildren(b,s,g,p);for(var $=0,q=n;$<q.length;$+=1){var H=q[$],V=this._tiles[H.key];if(!V.hasData()){if(s+1>this._source.maxzoom){var X=H.children(this._source.maxzoom)[0],Q=this.getTile(X);if(Q&&Q.hasData()){p[X.key]=X;continue}}else{var re=H.children(this._source.maxzoom);if(p[re[0].key]&&p[re[1].key]&&p[re[2].key]&&p[re[3].key])continue}for(var pe=V.wasRequested(),ue=H.overscaledZ-1;ue>=d;--ue){var he=H.scaledTo(ue);if(f[he.key]||(f[he.key]=!0,!(V=this.getTile(he))&&pe&&(V=this._addTile(he)),V&&(p[he.key]=he,pe=V.wasRequested(),V.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,f=this._tiles[n].tileID;f.overscaledZ>0;){if(f.key in this._loadedParentTiles){p=this._loadedParentTiles[f.key];break}s.push(f.key);var d=f.scaledTo(f.overscaledZ-1);if(p=this._getLoadedTile(d))break;f=d}for(var g=0,b=s;g<b.length;g+=1)this._loadedParentTiles[b[g]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new l.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new l.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var f=s.getExpiryTimeout();f&&(this._timers[n]=setTimeout(function(){p._reloadTile(n,"expired"),delete p._timers[n]},f))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var f=this,d=[],g=this.transform;if(!g)return d;for(var b=p?g.getCameraQueryGeometry(n):n,E=n.map(function(ue){return g.pointCoordinate(ue)}),z=b.map(function(ue){return g.pointCoordinate(ue)}),D=this.getIds(),L=1/0,$=1/0,q=-1/0,H=-1/0,V=0,X=z;V<X.length;V+=1){var Q=X[V];L=Math.min(L,Q.x),$=Math.min($,Q.y),q=Math.max(q,Q.x),H=Math.max(H,Q.y)}for(var re=function(ue){var he=f._tiles[D[ue]];if(!he.holdingForFade()){var _e=he.tileID,Ie=Math.pow(2,g.zoom-he.tileID.overscaledZ),Te=s*he.queryPadding*l.EXTENT/he.tileSize/Ie,Le=[_e.getTilePoint(new l.MercatorCoordinate(L,$)),_e.getTilePoint(new l.MercatorCoordinate(q,H))];if(Le[0].x-Te<l.EXTENT&&Le[0].y-Te<l.EXTENT&&Le[1].x+Te>=0&&Le[1].y+Te>=0){var Ge=E.map(function(He){return _e.getTilePoint(He)}),Ke=z.map(function(He){return _e.getTilePoint(He)});d.push({tile:he,tileID:_e,queryGeometry:Ge,cameraQueryGeometry:Ke,scale:Ie})}}},pe=0;pe<D.length;pe++)re(pe);return d},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(b){return s._tiles[b].tileID}),f=0,d=p;f<d.length;f+=1){var g=d[f];g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(xe(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=l.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var f=this._tiles[n];f&&f.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter(function(f){return!f.hasDependency(n,s)})},o}(l.Evented);function ie(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function xe(i){return i==="raster"||i==="image"||i==="video"}function we(){return new l.window.Worker(ds.workerUrl)}G.maxOverzooming=10,G.maxUnderzooming=3;var fe="mapboxgl_preloaded_worker_pool",be=function(){this.active={}};be.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<be.workerCount;)this.workers.push(new we);return this.active[i]=!0,this.workers.slice()},be.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach(function(o){o.terminate()}),this.workers=null)},be.prototype.isPreloaded=function(){return!!this.active[fe]},be.prototype.numActive=function(){return Object.keys(this.active).length};var Ue,Oe=Math.floor(l.browser.hardwareConcurrency/2);function de(){return Ue||(Ue=new be),Ue}function De(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return l.refProperties.forEach(function(p){p in o&&(n[p]=o[p])}),n}function Ce(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=De(i[s],o[i[s].ref]));return i}be.workerCount=Math.max(Math.min(Oe,6),1);var ke={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function ut(i,o,n){n.push({command:ke.addSource,args:[i,o[i]]})}function ze(i,o,n){o.push({command:ke.removeSource,args:[i]}),n[i]=!0}function yt(i,o,n,s){ze(i,n,s),ut(i,o,n)}function Ft(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;return!0}function pt(i,o,n,s,p,f){var d;for(d in o=o||{},i=i||{})i.hasOwnProperty(d)&&(l.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}));for(d in o)o.hasOwnProperty(d)&&!i.hasOwnProperty(d)&&(l.deepEqual(i[d],o[d])||n.push({command:f,args:[s,d,o[d],p]}))}function Tt(i){return i.id}function gt(i,o){return i[o.id]=o,i}var Nr=function(i,o){this.reset(i,o)};Nr.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Nr.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=l.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,f=this._distances[p],d=n-f,g=d>0?(s-f)/d:0;return this.points[p].mult(1-g).add(this.points[o].mult(g))};var Pt=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var f=0;f<this.xCellCount*this.yCellCount;f++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function nr(i,o,n,s,p){var f=l.create();return o?(l.scale(f,f,[1/p,1/p,1]),n||l.rotateZ(f,f,s.angle)):l.multiply(f,s.labelPlaneMatrix,i),f}function Bt(i,o,n,s,p){if(o){var f=l.clone(i);return l.scale(f,f,[p,p,1]),n||l.rotateZ(f,f,-s.angle),f}return s.glCoordMatrix}function dt(i,o){var n=[i.x,i.y,0,1];Er(n,n,o);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function It(i,o){return .5+i/o*.5}function Yr(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function la(i,o,n,s,p,f,d,g){var b=s?i.textSizeData:i.iconSizeData,E=l.evaluateSizeForZoom(b,n.transform.zoom),z=[256/n.width*2+1,256/n.height*2+1],D=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;D.clear();for(var L=i.lineVertexArray,$=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,q=n.transform.width/n.transform.height,H=!1,V=0;V<$.length;V++){var X=$.get(V);if(X.hidden||X.writingMode===l.WritingMode.vertical&&!H)Ur(X.numGlyphs,D);else{H=!1;var Q=[X.anchorX,X.anchorY,0,1];if(l.transformMat4(Q,Q,o),Yr(Q,z)){var re=It(n.transform.cameraToCenterDistance,Q[3]),pe=l.evaluateSizeForFeature(b,E,X),ue=d?pe/re:pe*re,he=new l.Point(X.anchorX,X.anchorY),_e=dt(he,p).point,Ie={},Te=Js(X,ue,!1,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q);H=Te.useVertical,(Te.notEnoughRoom||H||Te.needsFlipping&&Js(X,ue,!0,g,o,p,f,i.glyphOffsetArray,L,D,_e,he,Ie,q).notEnoughRoom)&&Ur(X.numGlyphs,D)}else Ur(X.numGlyphs,D)}}s?i.text.dynamicLayoutVertexBuffer.updateData(D):i.icon.dynamicLayoutVertexBuffer.updateData(D)}function Ir(i,o,n,s,p,f,d,g,b,E,z){var D=g.glyphStartIndex+g.numGlyphs,L=g.lineStartIndex,$=g.lineStartIndex+g.lineLength,q=o.getoffsetX(g.glyphStartIndex),H=o.getoffsetX(D-1),V=or(i*q,n,s,p,f,d,g.segment,L,$,b,E,z);if(!V)return null;var X=or(i*H,n,s,p,f,d,g.segment,L,$,b,E,z);return X?{first:V,last:X}:null}function Jr(i,o,n,s){return i===l.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===l.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function Js(i,o,n,s,p,f,d,g,b,E,z,D,L,$){var q,H=o/24,V=i.lineOffsetX*H,X=i.lineOffsetY*H;if(i.numGlyphs>1){var Q=i.glyphStartIndex+i.numGlyphs,re=i.lineStartIndex,pe=i.lineStartIndex+i.lineLength,ue=Ir(H,g,V,X,n,z,D,i,b,f,L);if(!ue)return{notEnoughRoom:!0};var he=dt(ue.first.point,d).point,_e=dt(ue.last.point,d).point;if(s&&!n){var Ie=Jr(i.writingMode,he,_e,$);if(Ie)return Ie}q=[ue.first];for(var Te=i.glyphStartIndex+1;Te<Q-1;Te++)q.push(or(H*g.getoffsetX(Te),V,X,n,z,D,i.segment,re,pe,b,f,L));q.push(ue.last)}else{if(s&&!n){var Le=dt(D,p).point,Ge=i.lineStartIndex+i.segment+1,Ke=new l.Point(b.getx(Ge),b.gety(Ge)),He=dt(Ke,p),xt=He.signedDistanceFromCamera>0?He.point:ua(D,Ke,Le,1,p),Re=Jr(i.writingMode,Le,xt,$);if(Re)return Re}var nt=or(H*g.getoffsetX(i.glyphStartIndex),V,X,n,z,D,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,b,f,L);if(!nt)return{notEnoughRoom:!0};q=[nt]}for(var st=0,it=q;st<it.length;st+=1){var rt=it[st];l.addDynamicAttributes(E,rt.point,rt.angle)}return{}}function ua(i,o,n,s,p){var f=dt(i.add(i.sub(o)._unit()),p).point,d=n.sub(f);return n.add(d._mult(s/d.mag()))}function or(i,o,n,s,p,f,d,g,b,E,z,D){var L=s?i-o:i+o,$=L>0?1:-1,q=0;s&&($*=-1,q=Math.PI),$<0&&(q+=Math.PI);for(var H=$>0?g+d:g+d+1,V=p,X=p,Q=0,re=0,pe=Math.abs(L),ue=[];Q+re<=pe;){if((H+=$)<g||H>=b)return null;if(X=V,ue.push(V),(V=D[H])===void 0){var he=new l.Point(E.getx(H),E.gety(H)),_e=dt(he,z);if(_e.signedDistanceFromCamera>0)V=D[H]=_e.point;else{var Ie=H-$;V=ua(Q===0?f:new l.Point(E.getx(Ie),E.gety(Ie)),he,X,pe-Q+1,z)}}Q+=re,re=X.dist(V)}var Te=(pe-Q)/re,Le=V.sub(X),Ge=Le.mult(Te)._add(X);Ge._add(Le._unit()._perp()._mult(n*$));var Ke=q+Math.atan2(V.y-X.y,V.x-X.x);return ue.push(Ge),{point:Ge,angle:Ke,path:ue}}Pt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Pt.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Pt.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Pt.prototype._insertBoxCell=function(i,o,n,s,p,f){this.boxCells[p].push(f)},Pt.prototype._insertCircleCell=function(i,o,n,s,p,f){this.circleCells[p].push(f)},Pt.prototype._query=function(i,o,n,s,p,f){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var d=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var g=0;g<this.boxKeys.length;g++)d.push({key:this.boxKeys[g],x1:this.bboxes[4*g],y1:this.bboxes[4*g+1],x2:this.bboxes[4*g+2],y2:this.bboxes[4*g+3]});for(var b=0;b<this.circleKeys.length;b++){var E=this.circles[3*b],z=this.circles[3*b+1],D=this.circles[3*b+2];d.push({key:this.circleKeys[b],x1:E-D,y1:z-D,x2:E+D,y2:z+D})}return f?d.filter(f):d}return this._forEachCell(i,o,n,s,this._queryCell,d,{hitTest:p,seenUids:{box:{},circle:{}}},f),p?d.length>0:d},Pt.prototype._queryCircle=function(i,o,n,s,p){var f=i-n,d=i+n,g=o-n,b=o+n;if(d<0||f>this.width||b<0||g>this.height)return!s&&[];var E=[];return this._forEachCell(f,g,d,b,this._queryCellCircle,E,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?E.length>0:E},Pt.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Pt.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Pt.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Pt.prototype._queryCell=function(i,o,n,s,p,f,d,g){var b=d.seenUids,E=this.boxCells[p];if(E!==null)for(var z=this.bboxes,D=0,L=E;D<L.length;D+=1){var $=L[D];if(!b.box[$]){b.box[$]=!0;var q=4*$;if(i<=z[q+2]&&o<=z[q+3]&&n>=z[q+0]&&s>=z[q+1]&&(!g||g(this.boxKeys[$]))){if(d.hitTest)return f.push(!0),!0;f.push({key:this.boxKeys[$],x1:z[q],y1:z[q+1],x2:z[q+2],y2:z[q+3]})}}}var H=this.circleCells[p];if(H!==null)for(var V=this.circles,X=0,Q=H;X<Q.length;X+=1){var re=Q[X];if(!b.circle[re]){b.circle[re]=!0;var pe=3*re;if(this._circleAndRectCollide(V[pe],V[pe+1],V[pe+2],i,o,n,s)&&(!g||g(this.circleKeys[re]))){if(d.hitTest)return f.push(!0),!0;var ue=V[pe],he=V[pe+1],_e=V[pe+2];f.push({key:this.circleKeys[re],x1:ue-_e,y1:he-_e,x2:ue+_e,y2:he+_e})}}}},Pt.prototype._queryCellCircle=function(i,o,n,s,p,f,d,g){var b=d.circle,E=d.seenUids,z=this.boxCells[p];if(z!==null)for(var D=this.bboxes,L=0,$=z;L<$.length;L+=1){var q=$[L];if(!E.box[q]){E.box[q]=!0;var H=4*q;if(this._circleAndRectCollide(b.x,b.y,b.radius,D[H+0],D[H+1],D[H+2],D[H+3])&&(!g||g(this.boxKeys[q])))return f.push(!0),!0}}var V=this.circleCells[p];if(V!==null)for(var X=this.circles,Q=0,re=V;Q<re.length;Q+=1){var pe=re[Q];if(!E.circle[pe]){E.circle[pe]=!0;var ue=3*pe;if(this._circlesCollide(X[ue],X[ue+1],X[ue+2],b.x,b.y,b.radius)&&(!g||g(this.circleKeys[pe])))return f.push(!0),!0}}},Pt.prototype._forEachCell=function(i,o,n,s,p,f,d,g){for(var b=this._convertToXCellCoord(i),E=this._convertToYCellCoord(o),z=this._convertToXCellCoord(n),D=this._convertToYCellCoord(s),L=b;L<=z;L++)for(var $=E;$<=D;$++)if(p.call(this,i,o,n,s,this.xCellCount*$+L,f,d,g))return},Pt.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Pt.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Pt.prototype._circlesCollide=function(i,o,n,s,p,f){var d=s-i,g=p-o,b=n+f;return b*b>d*d+g*g},Pt.prototype._circleAndRectCollide=function(i,o,n,s,p,f,d){var g=(f-s)/2,b=Math.abs(i-(s+g));if(b>g+n)return!1;var E=(d-p)/2,z=Math.abs(o-(p+E));if(z>E+n)return!1;if(b<=g||z<=E)return!0;var D=b-g,L=z-E;return D*D+L*L<=n*n};var ca=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ur(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(ca,3*s)}}function Er(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var Ti=function(i,o,n){o===void 0&&(o=new Pt(i.width+200,i.height+200,25)),n===void 0&&(n=new Pt(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function Zt(i,o,n){return o*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Ti.prototype.placeCollisionBox=function(i,o,n,s,p){var f=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),d=n*f.perspectiveRatio,g=i.x1*d+f.point.x,b=i.y1*d+f.point.y,E=i.x2*d+f.point.x,z=i.y2*d+f.point.y;return!this.isInsideGrid(g,b,E,z)||!o&&this.grid.hitTest(g,b,E,z,p)?{box:[],offscreen:!1}:{box:[g,b,E,z],offscreen:this.isOffscreen(g,b,E,z)}},Ti.prototype.placeCollisionCircles=function(i,o,n,s,p,f,d,g,b,E,z,D,L){var $=[],q=new l.Point(o.anchorX,o.anchorY),H=dt(q,f),V=It(this.transform.cameraToCenterDistance,H.signedDistanceFromCamera),X=(E?p/V:p*V)/l.ONE_EM,Q=dt(q,d).point,re=Ir(X,s,o.lineOffsetX*X,o.lineOffsetY*X,!1,Q,q,o,n,d,{}),pe=!1,ue=!1,he=!0;if(re){for(var _e=.5*D*V+L,Ie=new l.Point(-100,-100),Te=new l.Point(this.screenRightBoundary,this.screenBottomBoundary),Le=new Nr,Ge=re.first,Ke=re.last,He=[],xt=Ge.path.length-1;xt>=1;xt--)He.push(Ge.path[xt]);for(var Re=1;Re<Ke.path.length;Re++)He.push(Ke.path[Re]);var nt=2.5*_e;if(g){var st=He.map(function(ki){return dt(ki,g)});He=st.some(function(ki){return ki.signedDistanceFromCamera<=0})?[]:st.map(function(ki){return ki.point})}var it=[];if(He.length>0){for(var rt=He[0].clone(),at=He[0].clone(),et=1;et<He.length;et++)rt.x=Math.min(rt.x,He[et].x),rt.y=Math.min(rt.y,He[et].y),at.x=Math.max(at.x,He[et].x),at.y=Math.max(at.y,He[et].y);it=rt.x>=Ie.x&&at.x<=Te.x&&rt.y>=Ie.y&&at.y<=Te.y?[He]:at.x<Ie.x||rt.x>Te.x||at.y<Ie.y||rt.y>Te.y?[]:l.clipLine([He],Ie.x,Ie.y,Te.x,Te.y)}for(var Je=0,xr=it;Je<xr.length;Je+=1){var Qt;Le.reset(xr[Je],.25*_e),Qt=Le.length<=.5*_e?1:Math.ceil(Le.paddedLength/nt)+1;for(var Rr=0;Rr<Qt;Rr++){var Cr=Rr/Math.max(Qt-1,1),Yt=Le.lerp(Cr),ar=Yt.x+100,ci=Yt.y+100;$.push(ar,ci,_e,0);var Zr=ar-_e,zn=ci-_e,Qr=ar+_e,$i=ci+_e;if(he=he&&this.isOffscreen(Zr,zn,Qr,$i),ue=ue||this.isInsideGrid(Zr,zn,Qr,$i),!i&&this.grid.hitTestCircle(ar,ci,_e,z)&&(pe=!0,!b))return{circles:[],offscreen:!1,collisionDetected:pe}}}}return{circles:!b&&pe||!ue?[]:$,offscreen:he,collisionDetected:pe}},Ti.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,f=-1/0,d=0,g=i;d<g.length;d+=1){var b=g[d],E=new l.Point(b.x+100,b.y+100);n=Math.min(n,E.x),s=Math.min(s,E.y),p=Math.max(p,E.x),f=Math.max(f,E.y),o.push(E)}for(var z={},D={},L=0,$=this.grid.query(n,s,p,f).concat(this.ignoredGrid.query(n,s,p,f));L<$.length;L+=1){var q=$[L],H=q.key;if(z[H.bucketInstanceId]===void 0&&(z[H.bucketInstanceId]={}),!z[H.bucketInstanceId][H.featureIndex]){var V=[new l.Point(q.x1,q.y1),new l.Point(q.x2,q.y1),new l.Point(q.x2,q.y2),new l.Point(q.x1,q.y2)];l.polygonIntersectsPolygon(o,V)&&(z[H.bucketInstanceId][H.featureIndex]=!0,D[H.bucketInstanceId]===void 0&&(D[H.bucketInstanceId]=[]),D[H.bucketInstanceId].push(H.featureIndex))}}return D},Ti.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Ti.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var f=o?this.ignoredGrid:this.grid,d={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)f.insertCircle(d,i[g],i[g+1],i[g+2])},Ti.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return Er(s,s,i),{point:new l.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},Ti.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Ti.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Ti.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var Oi=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};Oi.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var fi=function(i,o,n,s,p){this.text=new Oi(i?i.text:null,o,n,p),this.icon=new Oi(i?i.icon:null,o,s,p)};fi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ql=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Ii=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},Rc=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},an=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function zr(i,o,n,s,p){var f=l.getAnchorAlignment(i),d=-(f.horizontalAlign-.5)*o,g=-(f.verticalAlign-.5)*n,b=l.evaluateVariableOffset(i,s);return new l.Point(d+b[0]*p,g+b[1]*p)}function Xi(i,o,n,s,p,f){var d=i.x1,g=i.x2,b=i.y1,E=i.y2,z=i.anchorPointX,D=i.anchorPointY,L=new l.Point(o,n);return s&&L._rotate(p?f:-f),{x1:d+L.x,y1:b+L.y,x2:g+L.x,y2:E+L.y,anchorPointX:z,anchorPointY:D}}an.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var qr=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new Ti(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new an(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function Hn(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}qr.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),f=n.latestFeatureIndex;if(p&&f&&o.id===p.layerIds[0]){var d=n.collisionBoxArray,g=p.layers[0].layout,b=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),E=n.tileSize/l.EXTENT,z=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),D=g.get("text-pitch-alignment")==="map",L=g.get("text-rotation-alignment")==="map",$=Zt(n,1,this.transform.zoom),q=nr(z,D,L,this.transform,$),H=null;if(D){var V=Bt(z,D,L,this.transform,$);H=l.multiply([],this.transform.labelPlaneMatrix,V)}this.retainedQueryData[p.bucketInstanceId]=new Rc(p.bucketInstanceId,f,p.sourceLayerIndex,p.index,n.tileID);var X={bucket:p,layout:g,posMatrix:z,textLabelPlaneMatrix:q,labelToScreenMatrix:H,scale:b,textPixelRatio:E,holdingForFade:n.holdingForFade(),collisionBoxArray:d,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var Q=0,re=p.sortKeyRanges;Q<re.length;Q+=1){var pe=re[Q];i.push({sortKey:pe.sortKey,symbolInstanceStart:pe.symbolInstanceStart,symbolInstanceEnd:pe.symbolInstanceEnd,parameters:X})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:X})}},qr.prototype.attemptAnchorPlacement=function(i,o,n,s,p,f,d,g,b,E,z,D,L,$,q){var H,V=[D.textOffset0,D.textOffset1],X=zr(i,n,s,V,p),Q=this.collisionIndex.placeCollisionBox(Xi(o,X.x,X.y,f,d,this.transform.angle),z,g,b,E.predicate);if(!q||this.collisionIndex.placeCollisionBox(Xi(q,X.x,X.y,f,d,this.transform.angle),z,g,b,E.predicate).box.length!==0)return Q.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(H=this.prevPlacement.variableOffsets[D.crossTileID].anchor),this.variableOffsets[D.crossTileID]={textOffset:V,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:H},this.markUsedJustification(L,i,D,$),L.allowVerticalPlacement&&(this.markUsedOrientation(L,$,D),this.placedOrientations[D.crossTileID]=$),{shift:X,placedGlyphBoxes:Q}):void 0},qr.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,f=p.bucket,d=p.layout,g=p.posMatrix,b=p.textLabelPlaneMatrix,E=p.labelToScreenMatrix,z=p.textPixelRatio,D=p.holdingForFade,L=p.collisionBoxArray,$=p.partiallyEvaluatedTextSize,q=p.collisionGroup,H=d.get("text-optional"),V=d.get("icon-optional"),X=d.get("text-allow-overlap"),Q=d.get("icon-allow-overlap"),re=d.get("text-rotation-alignment")==="map",pe=d.get("text-pitch-alignment")==="map",ue=d.get("icon-text-fit")!=="none",he=d.get("symbol-z-order")==="viewport-y",_e=X&&(Q||!f.hasIconData()||V),Ie=Q&&(X||!f.hasTextData()||H);!f.collisionArrays&&L&&f.deserializeCollisionBoxes(L);var Te=function(Re,nt){if(!o[Re.crossTileID])if(D)s.placements[Re.crossTileID]=new Ql(!1,!1,!1);else{var st,it=!1,rt=!1,at=!0,et=null,Je={box:null,offscreen:null},xr={box:null,offscreen:null},Qt=null,Rr=null,Cr=0,Yt=0,ar=0;nt.textFeatureIndex?Cr=nt.textFeatureIndex:Re.useRuntimeCollisionCircles&&(Cr=Re.featureIndex),nt.verticalTextFeatureIndex&&(Yt=nt.verticalTextFeatureIndex);var ci=nt.textBox;if(ci){var Zr=function(Et){var yi=l.WritingMode.horizontal;if(f.allowVerticalPlacement&&!Et&&s.prevPlacement){var ei=s.prevPlacement.placedOrientations[Re.crossTileID];ei&&(s.placedOrientations[Re.crossTileID]=ei,s.markUsedOrientation(f,yi=ei,Re))}return yi},zn=function(Et,yi){if(f.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&nt.verticalTextBox)for(var ei=0,fo=f.writingModes;ei<fo.length&&(fo[ei]===l.WritingMode.vertical?(Je=yi(),xr=Je):Je=Et(),!(Je&&Je.box&&Je.box.length));ei+=1);else Je=Et()};if(d.get("text-variable-anchor")){var Qr=d.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[Re.crossTileID]){var $i=s.prevPlacement.variableOffsets[Re.crossTileID];Qr.indexOf($i.anchor)>0&&(Qr=Qr.filter(function(Et){return Et!==$i.anchor})).unshift($i.anchor)}var ki=function(Et,yi,ei){for(var fo=Et.x2-Et.x1,Kc=Et.y2-Et.y1,ms=Re.textBoxScale,Yc=ue&&!Q?yi:null,Ma={box:[],offscreen:!1},ku=X?2*Qr.length:Qr.length,Zo=0;Zo<ku;++Zo){var ys=s.attemptAnchorPlacement(Qr[Zo%Qr.length],Et,fo,Kc,ms,re,pe,z,g,q,Zo>=Qr.length,Re,f,ei,Yc);if(ys&&(Ma=ys.placedGlyphBoxes)&&Ma.box&&Ma.box.length){it=!0,et=ys.shift;break}}return Ma};zn(function(){return ki(ci,nt.iconBox,l.WritingMode.horizontal)},function(){var Et=nt.verticalTextBox;return f.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Re.numVerticalGlyphVertices>0&&Et?ki(Et,nt.verticalIconBox,l.WritingMode.vertical):{box:null,offscreen:null}}),Je&&(it=Je.box,at=Je.offscreen);var Ca=Zr(Je&&Je.box);if(!it&&s.prevPlacement){var jo=s.prevPlacement.variableOffsets[Re.crossTileID];jo&&(s.variableOffsets[Re.crossTileID]=jo,s.markUsedJustification(f,jo.anchor,Re,Ca))}}else{var Bn=function(Et,yi){var ei=s.collisionIndex.placeCollisionBox(Et,X,z,g,q.predicate);return ei&&ei.box&&ei.box.length&&(s.markUsedOrientation(f,yi,Re),s.placedOrientations[Re.crossTileID]=yi),ei};zn(function(){return Bn(ci,l.WritingMode.horizontal)},function(){var Et=nt.verticalTextBox;return f.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&Et?Bn(Et,l.WritingMode.vertical):{box:null,offscreen:null}}),Zr(Je&&Je.box&&Je.box.length)}}if(it=(st=Je)&&st.box&&st.box.length>0,at=st&&st.offscreen,Re.useRuntimeCollisionCircles){var $o=f.text.placedSymbolArray.get(Re.centerJustifiedTextSymbolIndex),Pa=l.evaluateSizeForFeature(f.textSizeData,$,$o),Ji=d.get("text-padding");Qt=s.collisionIndex.placeCollisionCircles(X,$o,f.lineVertexArray,f.glyphOffsetArray,Pa,g,b,E,n,pe,q.predicate,Re.collisionCircleDiameter,Ji),it=X||Qt.circles.length>0&&!Qt.collisionDetected,at=at&&Qt.offscreen}if(nt.iconFeatureIndex&&(ar=nt.iconFeatureIndex),nt.iconBox){var ka=function(Et){var yi=ue&&et?Xi(Et,et.x,et.y,re,pe,s.transform.angle):Et;return s.collisionIndex.placeCollisionBox(yi,Q,z,g,q.predicate)};rt=xr&&xr.box&&xr.box.length&&nt.verticalIconBox?(Rr=ka(nt.verticalIconBox)).box.length>0:(Rr=ka(nt.iconBox)).box.length>0,at=at&&Rr.offscreen}var Qi=H||Re.numHorizontalGlyphVertices===0&&Re.numVerticalGlyphVertices===0,br=V||Re.numIconVertices===0;if(Qi||br?br?Qi||(rt=rt&&it):it=rt&&it:rt=it=rt&&it,it&&st&&st.box&&s.collisionIndex.insertCollisionBox(st.box,d.get("text-ignore-placement"),f.bucketInstanceId,xr&&xr.box&&Yt?Yt:Cr,q.ID),rt&&Rr&&s.collisionIndex.insertCollisionBox(Rr.box,d.get("icon-ignore-placement"),f.bucketInstanceId,ar,q.ID),Qt&&(it&&s.collisionIndex.insertCollisionCircles(Qt.circles,d.get("text-ignore-placement"),f.bucketInstanceId,Cr,q.ID),n)){var cn=f.bucketInstanceId,Dn=s.collisionCircleArrays[cn];Dn===void 0&&(Dn=s.collisionCircleArrays[cn]=new Ii);for(var ho=0;ho<Qt.circles.length;ho+=4)Dn.circles.push(Qt.circles[ho+0]),Dn.circles.push(Qt.circles[ho+1]),Dn.circles.push(Qt.circles[ho+2]),Dn.circles.push(Qt.collisionDetected?1:0)}s.placements[Re.crossTileID]=new Ql(it||_e,rt||Ie,at||f.justReloaded),o[Re.crossTileID]=!0}};if(he)for(var Le=f.getSortedSymbolIndexes(this.transform.angle),Ge=Le.length-1;Ge>=0;--Ge){var Ke=Le[Ge];Te(f.symbolInstances.get(Ke),f.collisionArrays[Ke])}else for(var He=i.symbolInstanceStart;He<i.symbolInstanceEnd;He++)Te(f.symbolInstances.get(He),f.collisionArrays[He]);if(n&&f.bucketInstanceId in this.collisionCircleArrays){var xt=this.collisionCircleArrays[f.bucketInstanceId];l.invert(xt.invProjMatrix,g),xt.viewportMatrix=this.collisionIndex.getViewportMatrix()}f.justReloaded=!1},qr.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===l.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(o)];for(var f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];f<d.length;f+=1){var g=d[f];g>=0&&(i.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:n.crossTileID)}},qr.prototype.markUsedOrientation=function(i,o,n){for(var s=o===l.WritingMode.horizontal||o===l.WritingMode.horizontalOnly?o:0,p=o===l.WritingMode.vertical?o:0,f=0,d=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];f<d.length;f+=1)i.text.placedSymbolArray.get(d[f]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},qr.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},f=o?o.variableOffsets:{},d=o?o.placedOrientations:{};for(var g in this.placements){var b=this.placements[g],E=p[g];E?(this.opacities[g]=new fi(E,s,b.text,b.icon),n=n||b.text!==E.text.placed||b.icon!==E.icon.placed):(this.opacities[g]=new fi(null,s,b.text,b.icon,b.skipFade),n=n||b.text||b.icon)}for(var z in p){var D=p[z];if(!this.opacities[z]){var L=new fi(D,s,!1,!1);L.isHidden()||(this.opacities[z]=L,n=n||D.text.placed||D.icon.placed)}}for(var $ in f)this.variableOffsets[$]||!this.opacities[$]||this.opacities[$].isHidden()||(this.variableOffsets[$]=f[$]);for(var q in d)this.placedOrientations[q]||!this.opacities[q]||this.opacities[q].isHidden()||(this.placedOrientations[q]=d[q]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},qr.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var f=p[s],d=f.getBucket(i);d&&f.latestFeatureIndex&&i.id===d.layerIds[0]&&this.updateBucketOpacities(d,n,f.collisionBoxArray)}},qr.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,f=new fi(null,0,!1,!1,!0),d=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),b=p.get("text-variable-anchor"),E=p.get("text-rotation-alignment")==="map",z=p.get("text-pitch-alignment")==="map",D=p.get("icon-text-fit")!=="none",L=new fi(null,0,d&&(g||!i.hasIconData()||p.get("icon-optional")),g&&(d||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var $=function(X,Q,re){for(var pe=0;pe<Q/4;pe++)X.opacityVertexArray.emplaceBack(re)},q=function(X){var Q=i.symbolInstances.get(X),re=Q.numHorizontalGlyphVertices,pe=Q.numVerticalGlyphVertices,ue=Q.crossTileID,he=s.opacities[ue];o[ue]?he=f:he||(s.opacities[ue]=he=L),o[ue]=!0;var _e=Q.numIconVertices>0,Ie=s.placedOrientations[Q.crossTileID],Te=Ie===l.WritingMode.vertical,Le=Ie===l.WritingMode.horizontal||Ie===l.WritingMode.horizontalOnly;if(re>0||pe>0){var Ge=ru(he.text);$(i.text,re,Te?zo:Ge),$(i.text,pe,Le?zo:Ge);var Ke=he.text.isHidden();[Q.rightJustifiedTextSymbolIndex,Q.centerJustifiedTextSymbolIndex,Q.leftJustifiedTextSymbolIndex].forEach(function(Je){Je>=0&&(i.text.placedSymbolArray.get(Je).hidden=Ke||Te?1:0)}),Q.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(Q.verticalPlacedTextSymbolIndex).hidden=Ke||Le?1:0);var He=s.variableOffsets[Q.crossTileID];He&&s.markUsedJustification(i,He.anchor,Q,Ie);var xt=s.placedOrientations[Q.crossTileID];xt&&(s.markUsedJustification(i,"left",Q,xt),s.markUsedOrientation(i,xt,Q))}if(_e){var Re=ru(he.icon),nt=!(D&&Q.verticalPlacedIconSymbolIndex&&Te);Q.placedIconSymbolIndex>=0&&($(i.icon,Q.numIconVertices,nt?Re:zo),i.icon.placedSymbolArray.get(Q.placedIconSymbolIndex).hidden=he.icon.isHidden()),Q.verticalPlacedIconSymbolIndex>=0&&($(i.icon,Q.numVerticalIconVertices,nt?zo:Re),i.icon.placedSymbolArray.get(Q.verticalPlacedIconSymbolIndex).hidden=he.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var st=i.collisionArrays[X];if(st){var it=new l.Point(0,0);if(st.textBox||st.verticalTextBox){var rt=!0;if(b){var at=s.variableOffsets[ue];at?(it=zr(at.anchor,at.width,at.height,at.textOffset,at.textBoxScale),E&&it._rotate(z?s.transform.angle:-s.transform.angle)):rt=!1}st.textBox&&Hn(i.textCollisionBox.collisionVertexArray,he.text.placed,!rt||Te,it.x,it.y),st.verticalTextBox&&Hn(i.textCollisionBox.collisionVertexArray,he.text.placed,!rt||Le,it.x,it.y)}var et=!!(!Le&&st.verticalIconBox);st.iconBox&&Hn(i.iconCollisionBox.collisionVertexArray,he.icon.placed,et,D?it.x:0,D?it.y:0),st.verticalIconBox&&Hn(i.iconCollisionBox.collisionVertexArray,he.icon.placed,!et,D?it.x:0,D?it.y:0)}}},H=0;H<i.symbolInstances.length;H++)q(H);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var V=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=V.invProjMatrix,i.placementViewportMatrix=V.viewportMatrix,i.collisionCircleArray=V.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},qr.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},qr.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},qr.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},qr.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},qr.prototype.setStale=function(){this.stale=!0};var Fc=Math.pow(2,25),Oc=Math.pow(2,24),Qs=Math.pow(2,17),Vc=Math.pow(2,16),eu=Math.pow(2,9),Nc=Math.pow(2,8),tu=Math.pow(2,1);function ru(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Fc+o*Oc+n*Qs+o*Vc+n*eu+o*Nc+n*tu+o}var zo=0,el=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};el.prototype.continuePlacement=function(i,o,n,s,p){for(var f=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(f,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,f.sort(function(d,g){return d.sortKey-g.sortKey}));this._currentPartIndex<f.length;)if(o.placeLayerBucketPart(f[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var pa=function(i,o,n,s,p,f,d){this.placement=new qr(i,p,f,d),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};pa.prototype.isDone=function(){return this._done},pa.prototype.continuePlacement=function(i,o,n){for(var s=this,p=l.browser.now(),f=function(){var b=l.browser.now()-p;return!s._forceFullPlacement&&b>2};this._currentPlacementIndex>=0;){var d=o[i[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(d.type==="symbol"&&(!d.minzoom||d.minzoom<=g)&&(!d.maxzoom||d.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new el(d)),this._inProgressLayer.continuePlacement(n[d.source],this.placement,this._showCollisionBoxes,d,f))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},pa.prototype.commit=function(i){return this.placement.commit(i),this.placement};var iu=512/l.EXTENT/2,Ha=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),f=p.key;this.indexedSymbolInstances[f]||(this.indexedSymbolInstances[f]=[]),this.indexedSymbolInstances[f].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};Ha.prototype.getScaledCoordinates=function(i,o){var n=iu/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*l.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*l.EXTENT+i.anchorY)*n)}},Ha.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var f=i.get(p);if(!f.crossTileID){var d=this.indexedSymbolInstances[f.key];if(d)for(var g=this.getScaledCoordinates(f,o),b=0,E=d;b<E.length;b+=1){var z=E[b];if(Math.abs(z.coord.x-g.x)<=s&&Math.abs(z.coord.y-g.y)<=s&&!n[z.crossTileID]){n[z.crossTileID]=!0,f.crossTileID=z.crossTileID;break}}}}};var Ei=function(){this.maxCrossTileID=0};Ei.prototype.generate=function(){return++this.maxCrossTileID};var gn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};gn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var f in s){var d=s[f];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+o),p[d.tileID.key]=d}this.indexes[n]=p}this.lng=i},gn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var f in this.indexes){var d=this.indexes[f];if(Number(f)>i.overscaledZ)for(var g in d){var b=d[g];b.tileID.isChildOf(i)&&b.findMatches(o.symbolInstances,i,p)}else{var E=d[i.scaledTo(Number(f)).key];E&&E.findMatches(o.symbolInstances,i,p)}}for(var z=0;z<o.symbolInstances.length;z++){var D=o.symbolInstances.get(z);D.crossTileID||(D.crossTileID=n.generate(),p[D.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new Ha(i,o.symbolInstances,o.bucketInstanceId),!0},gn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},gn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var _n=function(){this.layerIndexes={},this.crossTileIDs=new Ei,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};_n.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new gn);var p=!1,f={};s.handleWrapJump(n);for(var d=0,g=o;d<g.length;d+=1){var b=g[d],E=b.getBucket(i);E&&i.id===E.layerIds[0]&&(E.bucketInstanceId||(E.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(b.tileID,E,this.crossTileIDs)&&(p=!0),f[E.bucketInstanceId]=!0)}return s.removeStaleBuckets(f)&&(p=!0),p},_n.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach(function(s){o[s]=!0}),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var Kn=function(i,o){return l.emitValidationErrors(i,o&&o.filter(function(n){return n.identifier!=="source.canvas"}))},xn=l.pick(ke,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),bn=l.pick(ke,["setCenter","setZoom","setBearing","setPitch"]),Ka=function(){var i={},o=l.styleSpec.$version;for(var n in l.styleSpec.$root){var s,p=l.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i}(),ni=function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Tr(de(),this),this.imageManager=new Ye,this.imageManager.setEventedParent(this),this.glyphManager=new pr(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Lt(256,512),this.crossTileSymbolIndex=new _n,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.getReferrer());var f=this;this._rtlTextPluginCallback=o.registerForPluginStateChange(function(d){f.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},function(g,b){if(l.triggerPluginCompletionEvent(g),b&&b.every(function(z){return z}))for(var E in f.sourceCaches)f.sourceCaches[E].reload()})}),this.on("data",function(d){if(d.dataType==="source"&&d.sourceDataType==="metadata"){var g=p.sourceCaches[d.sourceId];if(g){var b=g.getSource();if(b&&b.vectorLayerIds)for(var E in p._layers){var z=p._layers[E];z.source===b.id&&p._validateLayer(z)}}}})}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"}));var f=typeof s.validate=="boolean"?s.validate:!l.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var d=this.map._requestManager.transformRequest(n,l.ResourceType.Style);this._request=l.getJSON(d,function(g,b){p._request=null,g?p.fire(new l.ErrorEvent(g)):b&&p._load(b,f)})},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"})),this._request=l.browser.frame(function(){p._request=null,p._load(n,s.validate!==!1)})},o.prototype.loadEmpty=function(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(Ka,!1)},o.prototype._load=function(n,s){if(!s||!Kn(this,l.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var f=Ce(this.stylesheet.layers);this._order=f.map(function(E){return E.id}),this._layers={},this._serializedLayers={};for(var d=0,g=f;d<g.length;d+=1){var b=g[d];(b=l.createStyleLayer(b)).setEventedParent(this,{layer:{id:b.id}}),this._layers[b.id]=b,this._serializedLayers[b.id]=b.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new _i(this.stylesheet.light),this.fire(new l.Event("data",{dataType:"style"})),this.fire(new l.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=function(p,f,d){var g,b,E,z=l.browser.devicePixelRatio>1?"@2x":"",D=l.getJSON(f.transformRequest(f.normalizeSpriteURL(p,z,".json"),l.ResourceType.SpriteJSON),function(q,H){D=null,E||(E=q,g=H,$())}),L=l.getImage(f.transformRequest(f.normalizeSpriteURL(p,z,".png"),l.ResourceType.SpriteImage),function(q,H){L=null,E||(E=q,b=H,$())});function $(){if(E)d(E);else if(g&&b){var q=l.browser.getImageData(b),H={};for(var V in g){var X=g[V],Q=X.width,re=X.height,pe=X.x,ue=X.y,he=X.sdf,_e=X.pixelRatio,Ie=X.stretchX,Te=X.stretchY,Le=X.content,Ge=new l.RGBAImage({width:Q,height:re});l.RGBAImage.copy(q,Ge,{x:pe,y:ue},{x:0,y:0},{width:Q,height:re}),H[V]={data:Ge,pixelRatio:_e,sdf:he,stretchX:Ie,stretchY:Te,content:Le}}d(null,H)}}return{cancel:function(){D&&(D.cancel(),D=null),L&&(L.cancel(),L=null)}}}(n,this.map._requestManager,function(p,f){if(s._spriteRequest=null,p)s.fire(new l.ErrorEvent(p));else if(f)for(var d in f)s.imageManager.addImage(d,f[d]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new l.Event("data",{dataType:"style"}))})},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var f=s.getSource();(f.type==="geojson"||f.vectorLayerIds&&f.vectorLayerIds.indexOf(p)===-1)&&this.fire(new l.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+f.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,f=n;p<f.length;p+=1){var d=this._layers[f[p]];d.type!=="custom"&&s.push(d.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),f=Object.keys(this._removedLayers);for(var d in(p.length||f.length)&&this._updateWorkerLayers(p,f),this._updatedSources){var g=this._updatedSources[d];g==="reload"?this._reloadSource(d):g==="clear"&&this._clearSource(d)}for(var b in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[b].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var E={};for(var z in this.sourceCaches){var D=this.sourceCaches[z];E[z]=D.used,D.used=!1}for(var L=0,$=this._order;L<$.length;L+=1){var q=this._layers[$[L]];q.recalculate(n,this._availableImages),!q.isHidden(n.zoom)&&q.source&&(this.sourceCaches[q.source].used=!0)}for(var H in E){var V=this.sourceCaches[H];E[H]!==V.used&&V.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:H}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new l.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),Kn(this,l.validateStyle(n)))return!1;(n=l.clone$1(n)).layers=Ce(n.layers);var p=function(d,g){if(!d)return[{command:ke.setStyle,args:[g]}];var b=[];try{if(!l.deepEqual(d.version,g.version))return[{command:ke.setStyle,args:[g]}];l.deepEqual(d.center,g.center)||b.push({command:ke.setCenter,args:[g.center]}),l.deepEqual(d.zoom,g.zoom)||b.push({command:ke.setZoom,args:[g.zoom]}),l.deepEqual(d.bearing,g.bearing)||b.push({command:ke.setBearing,args:[g.bearing]}),l.deepEqual(d.pitch,g.pitch)||b.push({command:ke.setPitch,args:[g.pitch]}),l.deepEqual(d.sprite,g.sprite)||b.push({command:ke.setSprite,args:[g.sprite]}),l.deepEqual(d.glyphs,g.glyphs)||b.push({command:ke.setGlyphs,args:[g.glyphs]}),l.deepEqual(d.transition,g.transition)||b.push({command:ke.setTransition,args:[g.transition]}),l.deepEqual(d.light,g.light)||b.push({command:ke.setLight,args:[g.light]});var E={},z=[];(function(L,$,q,H){var V;for(V in $=$||{},L=L||{})L.hasOwnProperty(V)&&($.hasOwnProperty(V)||ze(V,q,H));for(V in $)$.hasOwnProperty(V)&&(L.hasOwnProperty(V)?l.deepEqual(L[V],$[V])||(L[V].type==="geojson"&&$[V].type==="geojson"&&Ft(L,$,V)?q.push({command:ke.setGeoJSONSourceData,args:[V,$[V].data]}):yt(V,$,q,H)):ut(V,$,q))})(d.sources,g.sources,z,E);var D=[];d.layers&&d.layers.forEach(function(L){E[L.source]?b.push({command:ke.removeLayer,args:[L.id]}):D.push(L)}),b=b.concat(z),function(L,$,q){$=$||[];var H,V,X,Q,re,pe,ue,he=(L=L||[]).map(Tt),_e=$.map(Tt),Ie=L.reduce(gt,{}),Te=$.reduce(gt,{}),Le=he.slice(),Ge=Object.create(null);for(H=0,V=0;H<he.length;H++)Te.hasOwnProperty(X=he[H])?V++:(q.push({command:ke.removeLayer,args:[X]}),Le.splice(Le.indexOf(X,V),1));for(H=0,V=0;H<_e.length;H++)Le[Le.length-1-H]!==(X=_e[_e.length-1-H])&&(Ie.hasOwnProperty(X)?(q.push({command:ke.removeLayer,args:[X]}),Le.splice(Le.lastIndexOf(X,Le.length-V),1)):V++,q.push({command:ke.addLayer,args:[Te[X],pe=Le[Le.length-H]]}),Le.splice(Le.length-H,0,X),Ge[X]=!0);for(H=0;H<_e.length;H++)if(Q=Ie[X=_e[H]],re=Te[X],!Ge[X]&&!l.deepEqual(Q,re))if(l.deepEqual(Q.source,re.source)&&l.deepEqual(Q["source-layer"],re["source-layer"])&&l.deepEqual(Q.type,re.type)){for(ue in pt(Q.layout,re.layout,q,X,null,ke.setLayoutProperty),pt(Q.paint,re.paint,q,X,null,ke.setPaintProperty),l.deepEqual(Q.filter,re.filter)||q.push({command:ke.setFilter,args:[X,re.filter]}),l.deepEqual(Q.minzoom,re.minzoom)&&l.deepEqual(Q.maxzoom,re.maxzoom)||q.push({command:ke.setLayerZoomRange,args:[X,re.minzoom,re.maxzoom]}),Q)Q.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(Q[ue],re[ue],q,X,ue.slice(6),ke.setPaintProperty):l.deepEqual(Q[ue],re[ue])||q.push({command:ke.setLayerProperty,args:[X,ue,re[ue]]}));for(ue in re)re.hasOwnProperty(ue)&&!Q.hasOwnProperty(ue)&&ue!=="layout"&&ue!=="paint"&&ue!=="filter"&&ue!=="metadata"&&ue!=="minzoom"&&ue!=="maxzoom"&&(ue.indexOf("paint.")===0?pt(Q[ue],re[ue],q,X,ue.slice(6),ke.setPaintProperty):l.deepEqual(Q[ue],re[ue])||q.push({command:ke.setLayerProperty,args:[X,ue,re[ue]]}))}else q.push({command:ke.removeLayer,args:[X]}),pe=Le[Le.lastIndexOf(X)+1],q.push({command:ke.addLayer,args:[re,pe]})}(D,g.layers,b)}catch(L){console.warn("Unable to compute style diff:",L),b=[{command:ke.setStyle,args:[g]}]}return b}(this.serialize(),n).filter(function(d){return!(d.command in bn)});if(p.length===0)return!1;var f=p.filter(function(d){return!(d.command in xn)});if(f.length>0)throw new Error("Unimplemented: "+f.map(function(d){return d.command}).join(", ")+".");return p.forEach(function(d){d.command!=="setTransition"&&s[d.command].apply(s,d.args)}),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new l.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new l.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var f=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(l.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var d=this.sourceCaches[n]=new G(n,s,this.dispatcher);d.style=this,d.setEventedParent(this,function(){return{isSourceLoaded:f.loaded(),source:d.serialize(),sourceId:n}}),d.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new l.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new l.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=n.id;if(this.getLayer(f))this.fire(new l.ErrorEvent(new Error('Layer with id "'+f+'" already exists on this map')));else{var d;if(n.type==="custom"){if(Kn(this,l.validateCustomStyleLayer(n)))return;d=l.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(f,n.source),n=l.clone$1(n),n=l.extend(n,{source:f})),this._validate(l.validateStyle.layer,"layers."+f,n,{arrayIndex:-1},p))return;d=l.createStyleLayer(n),this._validateLayer(d),d.setEventedParent(this,{layer:{id:f}}),this._serializedLayers[d.id]=d.serialize()}var g=s?this._order.indexOf(s):this._order.length;if(s&&g===-1)this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(g,0,f),this._layerOrderChanged=!0,this._layers[f]=d,this._removedLayers[f]&&d.source&&d.type!=="custom"){var b=this._removedLayers[f];delete this._removedLayers[f],b.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var f=s?this._order.indexOf(s):this._order.length;s&&f===-1?this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(f,0,n),this._layerOrderChanged=!0)}}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var f=this.getLayer(n);f?f.minzoom===s&&f.maxzoom===p||(s!=null&&(f.minzoom=s),p!=null&&(f.maxzoom=p),this._updateLayer(f)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var f=this.getLayer(n);if(f){if(!l.deepEqual(f.filter,s))return s==null?(f.filter=void 0,void this._updateLayer(f)):void(this._validate(l.validateStyle.filter,"layers."+f.id+".filter",s,null,p)||(f.filter=l.clone$1(s),this._updateLayer(f)))}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return l.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?l.deepEqual(d.getLayoutProperty(s),p)||(d.setLayoutProperty(s,p,f),this._updateLayer(d)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,f){f===void 0&&(f={}),this._checkLoaded();var d=this.getLayer(n);d?l.deepEqual(d.getPaintProperty(s),p)||(d.setPaintProperty(s,p,f)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=n.sourceLayer,d=this.sourceCaches[p];if(d!==void 0){var g=d.getSource().type;g==="geojson"&&f?this.fire(new l.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||f?(n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),d.setFeatureState(f,n.id,s)):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,f=this.sourceCaches[p];if(f!==void 0){var d=f.getSource().type,g=d==="vector"?n.sourceLayer:void 0;d!=="vector"||g?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new l.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):f.removeFeatureState(g,n.id,s):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,f=this.sourceCaches[s];if(f!==void 0){if(f.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),f.getFeatureState(p,n.id);this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return l.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:l.mapObject(this.sourceCaches,function(n){return n.serialize()}),layers:this._serializeLayers(this._order)},function(n){return n!==void 0})},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Ie){return s._layers[Ie].type==="fill-extrusion"},f={},d=[],g=this._order.length-1;g>=0;g--){var b=this._order[g];if(p(b)){f[b]=g;for(var E=0,z=n;E<z.length;E+=1){var D=z[E][b];if(D)for(var L=0,$=D;L<$.length;L+=1)d.push($[L])}}}d.sort(function(Ie,Te){return Te.intersectionZ-Ie.intersectionZ});for(var q=[],H=this._order.length-1;H>=0;H--){var V=this._order[H];if(p(V))for(var X=d.length-1;X>=0;X--){var Q=d[X].feature;if(f[Q.layer.id]<H)break;q.push(Q),d.pop()}else for(var re=0,pe=n;re<pe.length;re+=1){var ue=pe[re][V];if(ue)for(var he=0,_e=ue;he<_e.length;he+=1)q.push(_e[he].feature)}}return q},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(l.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var f={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new l.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var d=0,g=s.layers;d<g.length;d+=1){var b=g[d],E=this._layers[b];if(!E)return this.fire(new l.ErrorEvent(new Error("The layer '"+b+"' does not exist in the map's style and cannot be queried for features."))),[];f[E.source]=!0}}var z=[];for(var D in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!f[D]||z.push(Vr(this.sourceCaches[D],this._layers,this._serializedLayers,n,s,p));return this.placement&&z.push(function(L,$,q,H,V,X,Q){for(var re={},pe=X.queryRenderedSymbols(H),ue=[],he=0,_e=Object.keys(pe).map(Number);he<_e.length;he+=1)ue.push(Q[_e[he]]);ue.sort(rn);for(var Ie=function(){var He=Le[Te],xt=He.featureIndex.lookupSymbolFeatures(pe[He.bucketInstanceId],$,He.bucketIndex,He.sourceLayerIndex,V.filter,V.layers,V.availableImages,L);for(var Re in xt){var nt=re[Re]=re[Re]||[],st=xt[Re];st.sort(function(at,et){var Je=He.featureSortOrder;if(Je){var xr=Je.indexOf(at.featureIndex);return Je.indexOf(et.featureIndex)-xr}return et.featureIndex-at.featureIndex});for(var it=0,rt=st;it<rt.length;it+=1)nt.push(rt[it])}},Te=0,Le=ue;Te<Le.length;Te+=1)Ie();var Ge=function(He){re[He].forEach(function(xt){var Re=xt.feature,nt=q[L[He].source].getFeatureState(Re.layer["source-layer"],Re.id);Re.source=Re.layer.source,Re.layer["source-layer"]&&(Re.sourceLayer=Re.layer["source-layer"]),Re.state=nt})};for(var Ke in re)Ge(Ke);return re}(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(z)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(l.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?function(f,d){for(var g=f.getRenderableIds().map(function($){return f.getTileByID($)}),b=[],E={},z=0;z<g.length;z++){var D=g[z],L=D.tileID.canonical.key;E[L]||(E[L]=!0,D.querySourceFeatures(b,d))}return b}(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),f=!1;for(var d in n)if(!l.deepEqual(n[d],p[d])){f=!0;break}if(f){var g={now:l.browser.now(),transition:l.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(g)}},o.prototype._validate=function(n,s,p,f,d){return d===void 0&&(d={}),(!d||d.validate!==!1)&&Kn(this,n.call(l.validateStyle,l.extend({key:s,style:this.serialize(),value:p,styleSpec:l.styleSpec},f)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,f,d){d===void 0&&(d=!1);for(var g=!1,b=!1,E={},z=0,D=this._order;z<D.length;z+=1){var L=this._layers[D[z]];if(L.type==="symbol"){if(!E[L.source]){var $=this.sourceCaches[L.source];E[L.source]=$.getRenderableIds(!0).map(function(Q){return $.getTileByID(Q)}).sort(function(Q,re){return re.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(re.tileID)?-1:1)})}var q=this.crossTileSymbolIndex.addLayer(L,E[L.source],n.center.lng);g=g||q}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.browser.now(),n.zoom))&&(this.pauseablePlacement=new pa(n,this._order,d,s,p,f,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,E),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.browser.now()),b=!0),g&&this.pauseablePlacement.placement.setStale()),b||g)for(var H=0,V=this._order;H<V.length;H+=1){var X=this._layers[V[H]];X.type==="symbol"&&this.placement.updateLayerOpacities(X,E[X.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var f=this.sourceCaches[s.source];f&&f.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return l.makeRequest(s,p)},o}(l.Evented);ni.getSourceType=function(i){return yn[i]},ni.setSourceType=function(i,o){yn[i]=o},ni.registerForPluginStateChange=l.registerForPluginStateChange;var hr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),Bo=Ot(`#ifdef GL_ES
|
|
2
|
+
precision mediump float;
|
|
3
|
+
#else
|
|
4
|
+
#if !defined(lowp)
|
|
5
|
+
#define lowp
|
|
6
|
+
#endif
|
|
7
|
+
#if !defined(mediump)
|
|
8
|
+
#define mediump
|
|
9
|
+
#endif
|
|
10
|
+
#if !defined(highp)
|
|
11
|
+
#define highp
|
|
12
|
+
#endif
|
|
13
|
+
#endif`,`#ifdef GL_ES
|
|
14
|
+
precision highp float;
|
|
15
|
+
#else
|
|
16
|
+
#if !defined(lowp)
|
|
17
|
+
#define lowp
|
|
18
|
+
#endif
|
|
19
|
+
#if !defined(mediump)
|
|
20
|
+
#define mediump
|
|
21
|
+
#endif
|
|
22
|
+
#if !defined(highp)
|
|
23
|
+
#define highp
|
|
24
|
+
#endif
|
|
25
|
+
#endif
|
|
26
|
+
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
27
|
+
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),nu=Ot(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
28
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
29
|
+
gl_FragColor=vec4(1.0);
|
|
30
|
+
#endif
|
|
31
|
+
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Uc=Ot(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
32
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
33
|
+
gl_FragColor=vec4(1.0);
|
|
34
|
+
#endif
|
|
35
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),qc=Ot(`varying vec3 v_data;
|
|
36
|
+
#pragma mapbox: define highp vec4 color
|
|
37
|
+
#pragma mapbox: define mediump float radius
|
|
38
|
+
#pragma mapbox: define lowp float blur
|
|
39
|
+
#pragma mapbox: define lowp float opacity
|
|
40
|
+
#pragma mapbox: define highp vec4 stroke_color
|
|
41
|
+
#pragma mapbox: define mediump float stroke_width
|
|
42
|
+
#pragma mapbox: define lowp float stroke_opacity
|
|
43
|
+
void main() {
|
|
44
|
+
#pragma mapbox: initialize highp vec4 color
|
|
45
|
+
#pragma mapbox: initialize mediump float radius
|
|
46
|
+
#pragma mapbox: initialize lowp float blur
|
|
47
|
+
#pragma mapbox: initialize lowp float opacity
|
|
48
|
+
#pragma mapbox: initialize highp vec4 stroke_color
|
|
49
|
+
#pragma mapbox: initialize mediump float stroke_width
|
|
50
|
+
#pragma mapbox: initialize lowp float stroke_opacity
|
|
51
|
+
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|
52
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
53
|
+
gl_FragColor=vec4(1.0);
|
|
54
|
+
#endif
|
|
55
|
+
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
|
|
56
|
+
#pragma mapbox: define highp vec4 color
|
|
57
|
+
#pragma mapbox: define mediump float radius
|
|
58
|
+
#pragma mapbox: define lowp float blur
|
|
59
|
+
#pragma mapbox: define lowp float opacity
|
|
60
|
+
#pragma mapbox: define highp vec4 stroke_color
|
|
61
|
+
#pragma mapbox: define mediump float stroke_width
|
|
62
|
+
#pragma mapbox: define lowp float stroke_opacity
|
|
63
|
+
void main(void) {
|
|
64
|
+
#pragma mapbox: initialize highp vec4 color
|
|
65
|
+
#pragma mapbox: initialize mediump float radius
|
|
66
|
+
#pragma mapbox: initialize lowp float blur
|
|
67
|
+
#pragma mapbox: initialize lowp float opacity
|
|
68
|
+
#pragma mapbox: initialize highp vec4 stroke_color
|
|
69
|
+
#pragma mapbox: initialize mediump float stroke_width
|
|
70
|
+
#pragma mapbox: initialize lowp float stroke_opacity
|
|
71
|
+
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),tl=Ot("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),rl=Ot(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
72
|
+
#pragma mapbox: define highp float weight
|
|
73
|
+
#define GAUSS_COEF 0.3989422804014327
|
|
74
|
+
void main() {
|
|
75
|
+
#pragma mapbox: initialize highp float weight
|
|
76
|
+
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|
77
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
78
|
+
gl_FragColor=vec4(1.0);
|
|
79
|
+
#endif
|
|
80
|
+
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|
81
|
+
#pragma mapbox: define highp float weight
|
|
82
|
+
#pragma mapbox: define mediump float radius
|
|
83
|
+
const highp float ZERO=1.0/255.0/16.0;
|
|
84
|
+
#define GAUSS_COEF 0.3989422804014327
|
|
85
|
+
void main(void) {
|
|
86
|
+
#pragma mapbox: initialize highp float weight
|
|
87
|
+
#pragma mapbox: initialize mediump float radius
|
|
88
|
+
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),il=Ot(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
89
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
90
|
+
gl_FragColor=vec4(0.0);
|
|
91
|
+
#endif
|
|
92
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),nl=Ot("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),ou=Ot("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),au=Ot("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),jc=Ot(`#pragma mapbox: define highp vec4 color
|
|
93
|
+
#pragma mapbox: define lowp float opacity
|
|
94
|
+
void main() {
|
|
95
|
+
#pragma mapbox: initialize highp vec4 color
|
|
96
|
+
#pragma mapbox: initialize lowp float opacity
|
|
97
|
+
gl_FragColor=color*opacity;
|
|
98
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
99
|
+
gl_FragColor=vec4(1.0);
|
|
100
|
+
#endif
|
|
101
|
+
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|
102
|
+
#pragma mapbox: define highp vec4 color
|
|
103
|
+
#pragma mapbox: define lowp float opacity
|
|
104
|
+
void main() {
|
|
105
|
+
#pragma mapbox: initialize highp vec4 color
|
|
106
|
+
#pragma mapbox: initialize lowp float opacity
|
|
107
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);}`),ha=Ot(`varying vec2 v_pos;
|
|
108
|
+
#pragma mapbox: define highp vec4 outline_color
|
|
109
|
+
#pragma mapbox: define lowp float opacity
|
|
110
|
+
void main() {
|
|
111
|
+
#pragma mapbox: initialize highp vec4 outline_color
|
|
112
|
+
#pragma mapbox: initialize lowp float opacity
|
|
113
|
+
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|
114
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
115
|
+
gl_FragColor=vec4(1.0);
|
|
116
|
+
#endif
|
|
117
|
+
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|
118
|
+
#pragma mapbox: define highp vec4 outline_color
|
|
119
|
+
#pragma mapbox: define lowp float opacity
|
|
120
|
+
void main() {
|
|
121
|
+
#pragma mapbox: initialize highp vec4 outline_color
|
|
122
|
+
#pragma mapbox: initialize lowp float opacity
|
|
123
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fa=Ot(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
124
|
+
#pragma mapbox: define lowp float opacity
|
|
125
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
126
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
127
|
+
void main() {
|
|
128
|
+
#pragma mapbox: initialize lowp float opacity
|
|
129
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
130
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
131
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
132
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
133
|
+
gl_FragColor=vec4(1.0);
|
|
134
|
+
#endif
|
|
135
|
+
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
136
|
+
#pragma mapbox: define lowp float opacity
|
|
137
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
138
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
139
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
140
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
141
|
+
void main() {
|
|
142
|
+
#pragma mapbox: initialize lowp float opacity
|
|
143
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
144
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
145
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
146
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
147
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),su=Ot(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
148
|
+
#pragma mapbox: define lowp float opacity
|
|
149
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
150
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
151
|
+
void main() {
|
|
152
|
+
#pragma mapbox: initialize lowp float opacity
|
|
153
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
154
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
155
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|
156
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
157
|
+
gl_FragColor=vec4(1.0);
|
|
158
|
+
#endif
|
|
159
|
+
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
160
|
+
#pragma mapbox: define lowp float opacity
|
|
161
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
162
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
163
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
164
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
165
|
+
void main() {
|
|
166
|
+
#pragma mapbox: initialize lowp float opacity
|
|
167
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
168
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
169
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
170
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
171
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Br=Ot(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
172
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
173
|
+
gl_FragColor=vec4(1.0);
|
|
174
|
+
#endif
|
|
175
|
+
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
|
|
176
|
+
#pragma mapbox: define highp float base
|
|
177
|
+
#pragma mapbox: define highp float height
|
|
178
|
+
#pragma mapbox: define highp vec4 color
|
|
179
|
+
void main() {
|
|
180
|
+
#pragma mapbox: initialize highp float base
|
|
181
|
+
#pragma mapbox: initialize highp float height
|
|
182
|
+
#pragma mapbox: initialize highp vec4 color
|
|
183
|
+
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),ol=Ot(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
184
|
+
#pragma mapbox: define lowp float base
|
|
185
|
+
#pragma mapbox: define lowp float height
|
|
186
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
187
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
188
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
189
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
190
|
+
void main() {
|
|
191
|
+
#pragma mapbox: initialize lowp float base
|
|
192
|
+
#pragma mapbox: initialize lowp float height
|
|
193
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
194
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
195
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
196
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
197
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|
198
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
199
|
+
gl_FragColor=vec4(1.0);
|
|
200
|
+
#endif
|
|
201
|
+
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
202
|
+
#pragma mapbox: define lowp float base
|
|
203
|
+
#pragma mapbox: define lowp float height
|
|
204
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
205
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
206
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
207
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
208
|
+
void main() {
|
|
209
|
+
#pragma mapbox: initialize lowp float base
|
|
210
|
+
#pragma mapbox: initialize lowp float height
|
|
211
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
212
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
213
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
214
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
215
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
216
|
+
? a_pos
|
|
217
|
+
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),wn=Ot(`#ifdef GL_ES
|
|
218
|
+
precision highp float;
|
|
219
|
+
#endif
|
|
220
|
+
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
221
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
222
|
+
gl_FragColor=vec4(1.0);
|
|
223
|
+
#endif
|
|
224
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Sn=Ot(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
225
|
+
#define PI 3.141592653589793
|
|
226
|
+
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
227
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
228
|
+
gl_FragColor=vec4(1.0);
|
|
229
|
+
#endif
|
|
230
|
+
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),Yn=Ot(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
231
|
+
#pragma mapbox: define highp vec4 color
|
|
232
|
+
#pragma mapbox: define lowp float blur
|
|
233
|
+
#pragma mapbox: define lowp float opacity
|
|
234
|
+
void main() {
|
|
235
|
+
#pragma mapbox: initialize highp vec4 color
|
|
236
|
+
#pragma mapbox: initialize lowp float blur
|
|
237
|
+
#pragma mapbox: initialize lowp float opacity
|
|
238
|
+
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|
239
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
240
|
+
gl_FragColor=vec4(1.0);
|
|
241
|
+
#endif
|
|
242
|
+
}`,`
|
|
243
|
+
#define scale 0.015873016
|
|
244
|
+
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|
245
|
+
#pragma mapbox: define highp vec4 color
|
|
246
|
+
#pragma mapbox: define lowp float blur
|
|
247
|
+
#pragma mapbox: define lowp float opacity
|
|
248
|
+
#pragma mapbox: define mediump float gapwidth
|
|
249
|
+
#pragma mapbox: define lowp float offset
|
|
250
|
+
#pragma mapbox: define mediump float width
|
|
251
|
+
void main() {
|
|
252
|
+
#pragma mapbox: initialize highp vec4 color
|
|
253
|
+
#pragma mapbox: initialize lowp float blur
|
|
254
|
+
#pragma mapbox: initialize lowp float opacity
|
|
255
|
+
#pragma mapbox: initialize mediump float gapwidth
|
|
256
|
+
#pragma mapbox: initialize lowp float offset
|
|
257
|
+
#pragma mapbox: initialize mediump float width
|
|
258
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),Jn=Ot(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
259
|
+
#pragma mapbox: define lowp float blur
|
|
260
|
+
#pragma mapbox: define lowp float opacity
|
|
261
|
+
void main() {
|
|
262
|
+
#pragma mapbox: initialize lowp float blur
|
|
263
|
+
#pragma mapbox: initialize lowp float opacity
|
|
264
|
+
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|
265
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
266
|
+
gl_FragColor=vec4(1.0);
|
|
267
|
+
#endif
|
|
268
|
+
}`,`
|
|
269
|
+
#define scale 0.015873016
|
|
270
|
+
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
271
|
+
#pragma mapbox: define lowp float blur
|
|
272
|
+
#pragma mapbox: define lowp float opacity
|
|
273
|
+
#pragma mapbox: define mediump float gapwidth
|
|
274
|
+
#pragma mapbox: define lowp float offset
|
|
275
|
+
#pragma mapbox: define mediump float width
|
|
276
|
+
void main() {
|
|
277
|
+
#pragma mapbox: initialize lowp float blur
|
|
278
|
+
#pragma mapbox: initialize lowp float opacity
|
|
279
|
+
#pragma mapbox: initialize mediump float gapwidth
|
|
280
|
+
#pragma mapbox: initialize lowp float offset
|
|
281
|
+
#pragma mapbox: initialize mediump float width
|
|
282
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),Tn=Ot(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
283
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
284
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
285
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
286
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
287
|
+
#pragma mapbox: define lowp float blur
|
|
288
|
+
#pragma mapbox: define lowp float opacity
|
|
289
|
+
void main() {
|
|
290
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
291
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
292
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
293
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
294
|
+
#pragma mapbox: initialize lowp float blur
|
|
295
|
+
#pragma mapbox: initialize lowp float opacity
|
|
296
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|
297
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
298
|
+
gl_FragColor=vec4(1.0);
|
|
299
|
+
#endif
|
|
300
|
+
}`,`
|
|
301
|
+
#define scale 0.015873016
|
|
302
|
+
#define LINE_DISTANCE_SCALE 2.0
|
|
303
|
+
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
304
|
+
#pragma mapbox: define lowp float blur
|
|
305
|
+
#pragma mapbox: define lowp float opacity
|
|
306
|
+
#pragma mapbox: define lowp float offset
|
|
307
|
+
#pragma mapbox: define mediump float gapwidth
|
|
308
|
+
#pragma mapbox: define mediump float width
|
|
309
|
+
#pragma mapbox: define lowp float floorwidth
|
|
310
|
+
#pragma mapbox: define lowp vec4 pattern_from
|
|
311
|
+
#pragma mapbox: define lowp vec4 pattern_to
|
|
312
|
+
#pragma mapbox: define lowp float pixel_ratio_from
|
|
313
|
+
#pragma mapbox: define lowp float pixel_ratio_to
|
|
314
|
+
void main() {
|
|
315
|
+
#pragma mapbox: initialize lowp float blur
|
|
316
|
+
#pragma mapbox: initialize lowp float opacity
|
|
317
|
+
#pragma mapbox: initialize lowp float offset
|
|
318
|
+
#pragma mapbox: initialize mediump float gapwidth
|
|
319
|
+
#pragma mapbox: initialize mediump float width
|
|
320
|
+
#pragma mapbox: initialize lowp float floorwidth
|
|
321
|
+
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
322
|
+
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
323
|
+
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
324
|
+
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
325
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),Qn=Ot(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
326
|
+
#pragma mapbox: define highp vec4 color
|
|
327
|
+
#pragma mapbox: define lowp float blur
|
|
328
|
+
#pragma mapbox: define lowp float opacity
|
|
329
|
+
#pragma mapbox: define mediump float width
|
|
330
|
+
#pragma mapbox: define lowp float floorwidth
|
|
331
|
+
void main() {
|
|
332
|
+
#pragma mapbox: initialize highp vec4 color
|
|
333
|
+
#pragma mapbox: initialize lowp float blur
|
|
334
|
+
#pragma mapbox: initialize lowp float opacity
|
|
335
|
+
#pragma mapbox: initialize mediump float width
|
|
336
|
+
#pragma mapbox: initialize lowp float floorwidth
|
|
337
|
+
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|
338
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
339
|
+
gl_FragColor=vec4(1.0);
|
|
340
|
+
#endif
|
|
341
|
+
}`,`
|
|
342
|
+
#define scale 0.015873016
|
|
343
|
+
#define LINE_DISTANCE_SCALE 2.0
|
|
344
|
+
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
345
|
+
#pragma mapbox: define highp vec4 color
|
|
346
|
+
#pragma mapbox: define lowp float blur
|
|
347
|
+
#pragma mapbox: define lowp float opacity
|
|
348
|
+
#pragma mapbox: define mediump float gapwidth
|
|
349
|
+
#pragma mapbox: define lowp float offset
|
|
350
|
+
#pragma mapbox: define mediump float width
|
|
351
|
+
#pragma mapbox: define lowp float floorwidth
|
|
352
|
+
void main() {
|
|
353
|
+
#pragma mapbox: initialize highp vec4 color
|
|
354
|
+
#pragma mapbox: initialize lowp float blur
|
|
355
|
+
#pragma mapbox: initialize lowp float opacity
|
|
356
|
+
#pragma mapbox: initialize mediump float gapwidth
|
|
357
|
+
#pragma mapbox: initialize lowp float offset
|
|
358
|
+
#pragma mapbox: initialize mediump float width
|
|
359
|
+
#pragma mapbox: initialize lowp float floorwidth
|
|
360
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),eo=Ot(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
361
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
362
|
+
gl_FragColor=vec4(1.0);
|
|
363
|
+
#endif
|
|
364
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),In=Ot(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
365
|
+
#pragma mapbox: define lowp float opacity
|
|
366
|
+
void main() {
|
|
367
|
+
#pragma mapbox: initialize lowp float opacity
|
|
368
|
+
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|
369
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
370
|
+
gl_FragColor=vec4(1.0);
|
|
371
|
+
#endif
|
|
372
|
+
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|
373
|
+
#pragma mapbox: define lowp float opacity
|
|
374
|
+
void main() {
|
|
375
|
+
#pragma mapbox: initialize lowp float opacity
|
|
376
|
+
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
377
|
+
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
378
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),lu=Ot(`#define SDF_PX 8.0
|
|
379
|
+
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
380
|
+
#pragma mapbox: define highp vec4 fill_color
|
|
381
|
+
#pragma mapbox: define highp vec4 halo_color
|
|
382
|
+
#pragma mapbox: define lowp float opacity
|
|
383
|
+
#pragma mapbox: define lowp float halo_width
|
|
384
|
+
#pragma mapbox: define lowp float halo_blur
|
|
385
|
+
void main() {
|
|
386
|
+
#pragma mapbox: initialize highp vec4 fill_color
|
|
387
|
+
#pragma mapbox: initialize highp vec4 halo_color
|
|
388
|
+
#pragma mapbox: initialize lowp float opacity
|
|
389
|
+
#pragma mapbox: initialize lowp float halo_width
|
|
390
|
+
#pragma mapbox: initialize lowp float halo_blur
|
|
391
|
+
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
392
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
393
|
+
gl_FragColor=vec4(1.0);
|
|
394
|
+
#endif
|
|
395
|
+
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
|
|
396
|
+
#pragma mapbox: define highp vec4 fill_color
|
|
397
|
+
#pragma mapbox: define highp vec4 halo_color
|
|
398
|
+
#pragma mapbox: define lowp float opacity
|
|
399
|
+
#pragma mapbox: define lowp float halo_width
|
|
400
|
+
#pragma mapbox: define lowp float halo_blur
|
|
401
|
+
void main() {
|
|
402
|
+
#pragma mapbox: initialize highp vec4 fill_color
|
|
403
|
+
#pragma mapbox: initialize highp vec4 halo_color
|
|
404
|
+
#pragma mapbox: initialize lowp float opacity
|
|
405
|
+
#pragma mapbox: initialize lowp float halo_width
|
|
406
|
+
#pragma mapbox: initialize lowp float halo_blur
|
|
407
|
+
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
408
|
+
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
409
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),uu=Ot(`#define SDF_PX 8.0
|
|
410
|
+
#define SDF 1.0
|
|
411
|
+
#define ICON 0.0
|
|
412
|
+
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
413
|
+
#pragma mapbox: define highp vec4 fill_color
|
|
414
|
+
#pragma mapbox: define highp vec4 halo_color
|
|
415
|
+
#pragma mapbox: define lowp float opacity
|
|
416
|
+
#pragma mapbox: define lowp float halo_width
|
|
417
|
+
#pragma mapbox: define lowp float halo_blur
|
|
418
|
+
void main() {
|
|
419
|
+
#pragma mapbox: initialize highp vec4 fill_color
|
|
420
|
+
#pragma mapbox: initialize highp vec4 halo_color
|
|
421
|
+
#pragma mapbox: initialize lowp float opacity
|
|
422
|
+
#pragma mapbox: initialize lowp float halo_width
|
|
423
|
+
#pragma mapbox: initialize lowp float halo_blur
|
|
424
|
+
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|
425
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
426
|
+
gl_FragColor=vec4(1.0);
|
|
427
|
+
#endif
|
|
428
|
+
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
429
|
+
#ifdef OVERDRAW_INSPECTOR
|
|
430
|
+
gl_FragColor=vec4(1.0);
|
|
431
|
+
#endif
|
|
432
|
+
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|
433
|
+
#pragma mapbox: define highp vec4 fill_color
|
|
434
|
+
#pragma mapbox: define highp vec4 halo_color
|
|
435
|
+
#pragma mapbox: define lowp float opacity
|
|
436
|
+
#pragma mapbox: define lowp float halo_width
|
|
437
|
+
#pragma mapbox: define lowp float halo_blur
|
|
438
|
+
void main() {
|
|
439
|
+
#pragma mapbox: initialize highp vec4 fill_color
|
|
440
|
+
#pragma mapbox: initialize highp vec4 halo_color
|
|
441
|
+
#pragma mapbox: initialize lowp float opacity
|
|
442
|
+
#pragma mapbox: initialize lowp float halo_width
|
|
443
|
+
#pragma mapbox: initialize lowp float halo_blur
|
|
444
|
+
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
445
|
+
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
446
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ot(i,o){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=o.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),f=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=f?f.concat(p):p,g={};return{fragmentSource:i=i.replace(n,function(b,E,z,D,L){return g[L]=!0,E==="define"?`
|
|
447
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
448
|
+
varying `+z+" "+D+" "+L+`;
|
|
449
|
+
#else
|
|
450
|
+
uniform `+z+" "+D+" u_"+L+`;
|
|
451
|
+
#endif
|
|
452
|
+
`:`
|
|
453
|
+
#ifdef HAS_UNIFORM_u_`+L+`
|
|
454
|
+
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
455
|
+
#endif
|
|
456
|
+
`}),vertexSource:o=o.replace(n,function(b,E,z,D,L){var $=D==="float"?"vec2":"vec4",q=L.match(/color/)?"color":$;return g[L]?E==="define"?`
|
|
457
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
458
|
+
uniform lowp float u_`+L+`_t;
|
|
459
|
+
attribute `+z+" "+$+" a_"+L+`;
|
|
460
|
+
varying `+z+" "+D+" "+L+`;
|
|
461
|
+
#else
|
|
462
|
+
uniform `+z+" "+D+" u_"+L+`;
|
|
463
|
+
#endif
|
|
464
|
+
`:q==="vec4"?`
|
|
465
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
466
|
+
`+L+" = a_"+L+`;
|
|
467
|
+
#else
|
|
468
|
+
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
469
|
+
#endif
|
|
470
|
+
`:`
|
|
471
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
472
|
+
`+L+" = unpack_mix_"+q+"(a_"+L+", u_"+L+`_t);
|
|
473
|
+
#else
|
|
474
|
+
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
475
|
+
#endif
|
|
476
|
+
`:E==="define"?`
|
|
477
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
478
|
+
uniform lowp float u_`+L+`_t;
|
|
479
|
+
attribute `+z+" "+$+" a_"+L+`;
|
|
480
|
+
#else
|
|
481
|
+
uniform `+z+" "+D+" u_"+L+`;
|
|
482
|
+
#endif
|
|
483
|
+
`:q==="vec4"?`
|
|
484
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
485
|
+
`+z+" "+D+" "+L+" = a_"+L+`;
|
|
486
|
+
#else
|
|
487
|
+
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
488
|
+
#endif
|
|
489
|
+
`:`
|
|
490
|
+
#ifndef HAS_UNIFORM_u_`+L+`
|
|
491
|
+
`+z+" "+D+" "+L+" = unpack_mix_"+q+"(a_"+L+", u_"+L+`_t);
|
|
492
|
+
#else
|
|
493
|
+
`+z+" "+D+" "+L+" = u_"+L+`;
|
|
494
|
+
#endif
|
|
495
|
+
`}),staticAttributes:s,staticUniforms:d}}var $c=Object.freeze({__proto__:null,prelude:Bo,background:nu,backgroundPattern:Uc,circle:qc,clippingMask:tl,heatmap:rl,heatmapTexture:il,collisionBox:nl,collisionCircle:ou,debug:au,fill:jc,fillOutline:ha,fillOutlinePattern:fa,fillPattern:su,fillExtrusion:Br,fillExtrusionPattern:ol,hillshadePrepare:wn,hillshade:Sn,line:Yn,lineGradient:Jn,linePattern:Tn,lineSDF:Qn,raster:eo,symbolIcon:In,symbolSDF:lu,symbolTextAndIcon:uu}),Ya=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function cu(i){for(var o=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");o.push(s.pop())}return o}Ya.prototype.bind=function(i,o,n,s,p,f,d,g){this.context=i;for(var b=this.boundPaintVertexBuffers.length!==s.length,E=0;!b&&E<s.length;E++)this.boundPaintVertexBuffers[E]!==s[E]&&(b=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===o&&this.boundLayoutVertexBuffer===n&&!b&&this.boundIndexBuffer===p&&this.boundVertexOffset===f&&this.boundDynamicVertexBuffer===d&&this.boundDynamicVertexBuffer2===g?(i.bindVertexArrayOES.set(this.vao),d&&d.bind(),p&&p.dynamicDraw&&p.bind(),g&&g.bind()):this.freshBind(o,n,s,p,f,d,g)},Ya.prototype.freshBind=function(i,o,n,s,p,f,d){var g,b=i.numAttributes,E=this.context,z=E.gl;if(E.extVertexArrayObject)this.vao&&this.destroy(),this.vao=E.extVertexArrayObject.createVertexArrayOES(),E.bindVertexArrayOES.set(this.vao),g=0,this.boundProgram=i,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=f,this.boundDynamicVertexBuffer2=d;else{g=E.currentNumAttributes||0;for(var D=b;D<g;D++)z.disableVertexAttribArray(D)}o.enableAttributes(z,i);for(var L=0,$=n;L<$.length;L+=1)$[L].enableAttributes(z,i);f&&f.enableAttributes(z,i),d&&d.enableAttributes(z,i),o.bind(),o.setVertexAttribPointers(z,i,p);for(var q=0,H=n;q<H.length;q+=1){var V=H[q];V.bind(),V.setVertexAttribPointers(z,i,p)}f&&(f.bind(),f.setVertexAttribPointers(z,i,p)),s&&s.bind(),d&&(d.bind(),d.setVertexAttribPointers(z,i,p)),E.currentNumAttributes=b},Ya.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var pu=function(i,o,n,s,p,f){var d=i.gl;this.program=d.createProgram();for(var g=cu(n.staticAttributes),b=s?s.getBinderAttributes():[],E=g.concat(b),z=n.staticUniforms?cu(n.staticUniforms):[],D=s?s.getBinderUniforms():[],L=[],$=0,q=z.concat(D);$<q.length;$+=1){var H=q[$];L.indexOf(H)<0&&L.push(H)}var V=s?s.defines():[];f&&V.push("#define OVERDRAW_INSPECTOR;");var X=V.concat(Bo.fragmentSource,n.fragmentSource).join(`
|
|
496
|
+
`),Q=V.concat(Bo.vertexSource,n.vertexSource).join(`
|
|
497
|
+
`),re=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(re,X),d.compileShader(re),d.attachShader(this.program,re);var pe=d.createShader(d.VERTEX_SHADER);if(d.isContextLost())this.failedToCreate=!0;else{d.shaderSource(pe,Q),d.compileShader(pe),d.attachShader(this.program,pe),this.attributes={};var ue={};this.numAttributes=E.length;for(var he=0;he<this.numAttributes;he++)E[he]&&(d.bindAttribLocation(this.program,he,E[he]),this.attributes[E[he]]=he);d.linkProgram(this.program),d.deleteShader(pe),d.deleteShader(re);for(var _e=0;_e<L.length;_e++){var Ie=L[_e];if(Ie&&!ue[Ie]){var Te=d.getUniformLocation(this.program,Ie);Te&&(ue[Ie]=Te)}}this.fixedUniforms=p(i,ue),this.binderUniforms=s?s.getUniforms(i,ue):[]}}};function hu(i,o,n){var s=1/Zt(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),f=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,d=f*(n.tileID.canonical.x+n.tileID.wrap*p),g=f*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[d>>16,g>>16],u_pixel_coord_lower:[65535&d,65535&g]}}pu.prototype.draw=function(i,o,n,s,p,f,d,g,b,E,z,D,L,$,q,H){var V,X=i.gl;if(!this.failedToCreate){for(var Q in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(f),this.fixedUniforms)this.fixedUniforms[Q].set(d[Q]);$&&$.setUniforms(i,this.binderUniforms,D,{zoom:L});for(var re=(V={},V[X.LINES]=2,V[X.TRIANGLES]=3,V[X.LINE_STRIP]=1,V)[o],pe=0,ue=z.get();pe<ue.length;pe+=1){var he=ue[pe],_e=he.vaos||(he.vaos={});(_e[g]||(_e[g]=new Ya)).bind(i,this,b,$?$.getPaintVertexBuffers():[],E,he.vertexOffset,q,H),X.drawElements(o,he.primitiveLength*re,X.UNSIGNED_SHORT,he.primitiveOffset*re*2)}}};var fu=function(i,o,n,s){var p=o.style.light,f=p.properties.get("position"),d=[f.x,f.y,f.z],g=l.create$1();p.properties.get("anchor")==="viewport"&&l.fromRotation(g,-o.transform.angle),l.transformMat3(d,d,g);var b=p.properties.get("color");return{u_matrix:i,u_lightpos:d,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_vertical_gradient:+n,u_opacity:s}},to=function(i,o,n,s,p,f,d){return l.extend(fu(i,o,n,s),hu(f,o,d),{u_height_factor:-Math.pow(2,p.overscaledZ)/d.tileSize/8})},En=function(i){return{u_matrix:i}},ro=function(i,o,n,s){return l.extend(En(i),hu(n,o,s))},du=function(i,o){return{u_matrix:i,u_world:o}},mu=function(i,o,n,s,p){return l.extend(ro(i,o,n,s),{u_world:p})},al=function(i,o,n,s){var p,f,d=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var g=Zt(n,1,d.zoom);p=!0,f=[g,g]}else p=!1,f=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:l.browser.devicePixelRatio,u_extrude_scale:f}},io=function(i,o,n){var s=Zt(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),f=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:f}},yu=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},no=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},oo=function(i){return{u_matrix:i}},vu=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:Zt(o,1,n),u_intensity:s}},da=function(i,o,n){var s=i.transform;return{u_matrix:gu(i,o,n),u_ratio:1/Zt(o,1,s.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Ut=function(i,o,n,s){return l.extend(da(i,o,n),{u_image:0,u_image_height:s})},Ja=function(i,o,n,s){var p=i.transform,f=Do(o,p);return{u_matrix:gu(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/Zt(o,1,p.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_image:0,u_scale:[f,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Zc=function(i,o,n,s,p){var f=i.lineAtlas,d=Do(o,i.transform),g=n.layout.get("line-cap")==="round",b=f.getDash(s.from,g),E=f.getDash(s.to,g),z=b.width*p.fromScale,D=E.width*p.toScale;return l.extend(da(i,o,n),{u_patternscale_a:[d/z,-b.height/2],u_patternscale_b:[d/D,-E.height/2],u_sdfgamma:f.width/(256*Math.min(z,D)*l.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:b.y,u_tex_y_b:E.y,u_mix:p.t})};function Do(i,o){return 1/Zt(i,1,o.tileZoom)}function gu(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Gc=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(d=p.paint.get("raster-saturation"),d>0?1-1/(1.001-d):-d),u_contrast_factor:(f=p.paint.get("raster-contrast"),f>0?1/(1-f):1+f),u_spin_weights:_u(p.paint.get("raster-hue-rotate"))};var f,d};function _u(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var Qa,Lo=function(i,o,n,s,p,f,d,g,b,E){var z=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:z.cameraToCenterDistance,u_pitch:z.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:z.width/z.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:f,u_label_plane_matrix:d,u_coord_matrix:g,u_is_text:+b,u_pitch_with_map:+s,u_texsize:E,u_texture:0}},ma=function(i,o,n,s,p,f,d,g,b,E,z){var D=p.transform;return l.extend(Lo(i,o,n,s,p,f,d,g,b,E),{u_gamma_scale:s?Math.cos(D._pitch)*D.cameraToCenterDistance:1,u_device_pixel_ratio:l.browser.devicePixelRatio,u_is_halo:+z})},es=function(i,o,n,s,p,f,d,g,b,E){return l.extend(ma(i,o,n,s,p,f,d,g,!0,b,!0),{u_texsize_icon:E,u_texture_icon:1})},ya=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Ro=function(i,o,n,s,p,f){return l.extend(function(d,g,b,E){var z=b.imageManager.getPattern(d.from.toString()),D=b.imageManager.getPattern(d.to.toString()),L=b.imageManager.getPixelSize(),$=L.width,q=L.height,H=Math.pow(2,E.tileID.overscaledZ),V=E.tileSize*Math.pow(2,b.transform.tileZoom)/H,X=V*(E.tileID.canonical.x+E.tileID.wrap*H),Q=V*E.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:z.tl,u_pattern_br_a:z.br,u_pattern_tl_b:D.tl,u_pattern_br_b:D.br,u_texsize:[$,q],u_mix:g.t,u_pattern_size_a:z.displaySize,u_pattern_size_b:D.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Zt(E,1,b.transform.tileZoom),u_pixel_coord_upper:[X>>16,Q>>16],u_pixel_coord_lower:[65535&X,65535&Q]}}(s,f,n,p),{u_matrix:i,u_opacity:o})},xu={fillExtrusion:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new l.Uniform1f(i,o.u_height_factor),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new l.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new l.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new l.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new l.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new l.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new l.UniformColor(i,o.u_color),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_overlay:new l.Uniform1i(i,o.u_overlay),u_overlay_scale:new l.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new l.Uniform1f(i,o.u_extrude_scale),u_intensity:new l.Uniform1f(i,o.u_intensity),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_color_ramp:new l.Uniform1i(i,o.u_color_ramp),u_opacity:new l.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_latrange:new l.Uniform2f(i,o.u_latrange),u_light:new l.Uniform2f(i,o.u_light),u_shadow:new l.UniformColor(i,o.u_shadow),u_highlight:new l.UniformColor(i,o.u_highlight),u_accent:new l.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_dimension:new l.Uniform2f(i,o.u_dimension),u_zoom:new l.Uniform1f(i,o.u_zoom),u_unpack:new l.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_image:new l.Uniform1i(i,o.u_image),u_image_height:new l.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_texsize:new l.Uniform2f(i,o.u_texsize),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_image:new l.Uniform1i(i,o.u_image),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new l.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new l.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new l.Uniform1f(i,o.u_sdfgamma),u_image:new l.Uniform1i(i,o.u_image),u_tex_y_a:new l.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new l.Uniform1f(i,o.u_tex_y_b),u_mix:new l.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new l.Uniform2f(i,o.u_tl_parent),u_scale_parent:new l.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new l.Uniform1f(i,o.u_buffer_scale),u_fade_t:new l.Uniform1f(i,o.u_fade_t),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image0:new l.Uniform1i(i,o.u_image0),u_image1:new l.Uniform1i(i,o.u_image1),u_brightness_low:new l.Uniform1f(i,o.u_brightness_low),u_brightness_high:new l.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new l.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new l.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new l.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texsize_icon:new l.Uniform2f(i,o.u_texsize_icon),u_texture:new l.Uniform1i(i,o.u_texture),u_texture_icon:new l.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_color:new l.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image:new l.Uniform1i(i,o.u_image),u_pattern_tl_a:new l.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new l.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new l.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new l.Uniform2f(i,o.u_pattern_br_b),u_texsize:new l.Uniform2f(i,o.u_texsize),u_mix:new l.Uniform1f(i,o.u_mix),u_pattern_size_a:new l.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new l.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new l.Uniform1f(i,o.u_scale_a),u_scale_b:new l.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new l.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Fo(i,o,n,s,p,f,d){for(var g=i.context,b=g.gl,E=i.useProgram("collisionBox"),z=[],D=0,L=0,$=0;$<s.length;$++){var q=s[$],H=o.getTile(q),V=H.getBucket(n);if(V){var X=q.posMatrix;p[0]===0&&p[1]===0||(X=i.translatePosMatrix(q.posMatrix,H,p,f));var Q=d?V.textCollisionBox:V.iconCollisionBox,re=V.collisionCircleArray;if(re.length>0){var pe=l.create(),ue=X;l.mul(pe,V.placementInvProjMatrix,i.transform.glCoordMatrix),l.mul(pe,pe,V.placementViewportMatrix),z.push({circleArray:re,circleOffset:L,transform:ue,invTransform:pe}),L=D+=re.length/4}Q&&E.draw(g,b.LINES,F.disabled,j.disabled,i.colorModeForRenderPass(),ee.disabled,io(X,i.transform,H),n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,null,i.transform.zoom,null,null,Q.collisionVertexBuffer)}}if(d&&z.length){var he=i.useProgram("collisionCircle"),_e=new l.StructArrayLayout2f1f2i16;_e.resize(4*D),_e._trim();for(var Ie=0,Te=0,Le=z;Te<Le.length;Te+=1)for(var Ge=Le[Te],Ke=0;Ke<Ge.circleArray.length/4;Ke++){var He=4*Ke,xt=Ge.circleArray[He+0],Re=Ge.circleArray[He+1],nt=Ge.circleArray[He+2],st=Ge.circleArray[He+3];_e.emplace(Ie++,xt,Re,nt,st,0),_e.emplace(Ie++,xt,Re,nt,st,1),_e.emplace(Ie++,xt,Re,nt,st,2),_e.emplace(Ie++,xt,Re,nt,st,3)}(!Qa||Qa.length<2*D)&&(Qa=function(Qt){var Rr=2*Qt,Cr=new l.StructArrayLayout3ui6;Cr.resize(Rr),Cr._trim();for(var Yt=0;Yt<Rr;Yt++){var ar=6*Yt;Cr.uint16[ar+0]=4*Yt+0,Cr.uint16[ar+1]=4*Yt+1,Cr.uint16[ar+2]=4*Yt+2,Cr.uint16[ar+3]=4*Yt+2,Cr.uint16[ar+4]=4*Yt+3,Cr.uint16[ar+5]=4*Yt+0}return Cr}(D));for(var it=g.createIndexBuffer(Qa,!0),rt=g.createVertexBuffer(_e,l.collisionCircleLayout.members,!0),at=0,et=z;at<et.length;at+=1){var Je=et[at],xr=yu(Je.transform,Je.invTransform,i.transform);he.draw(g,b.TRIANGLES,F.disabled,j.disabled,i.colorModeForRenderPass(),ee.disabled,xr,n.id,rt,it,l.SegmentVector.simpleSegment(0,2*Je.circleOffset,Je.circleArray.length,Je.circleArray.length/2),null,i.transform.zoom,null,null,null)}rt.destroy(),it.destroy()}}var Vi=l.identity(new Float32Array(16));function bu(i,o,n,s,p,f){var d=l.getAnchorAlignment(i),g=-(d.horizontalAlign-.5)*o,b=-(d.verticalAlign-.5)*n,E=l.evaluateVariableOffset(i,s);return new l.Point((g/p+E[0])*f,(b/p+E[1])*f)}function wu(i,o,n,s,p,f,d,g,b,E,z){var D=i.text.placedSymbolArray,L=i.text.dynamicLayoutVertexArray,$=i.icon.dynamicLayoutVertexArray,q={};L.clear();for(var H=0;H<D.length;H++){var V=D.get(H),X=V.hidden||!V.crossTileID||i.allowVerticalPlacement&&!V.placedOrientation?null:s[V.crossTileID];if(X){var Q=new l.Point(V.anchorX,V.anchorY),re=dt(Q,n?g:d),pe=It(f.cameraToCenterDistance,re.signedDistanceFromCamera),ue=p.evaluateSizeForFeature(i.textSizeData,E,V)*pe/l.ONE_EM;n&&(ue*=i.tilePixelRatio/b);for(var he=bu(X.anchor,X.width,X.height,X.textOffset,X.textBoxScale,ue),_e=n?dt(Q.add(he),d).point:re.point.add(o?he.rotate(-f.angle):he),Ie=i.allowVerticalPlacement&&V.placedOrientation===l.WritingMode.vertical?Math.PI/2:0,Te=0;Te<V.numGlyphs;Te++)l.addDynamicAttributes(L,_e,Ie);z&&V.associatedIconIndex>=0&&(q[V.associatedIconIndex]={shiftedAnchor:_e,angle:Ie})}else Ur(V.numGlyphs,L)}if(z){$.clear();for(var Le=i.icon.placedSymbolArray,Ge=0;Ge<Le.length;Ge++){var Ke=Le.get(Ge);if(Ke.hidden)Ur(Ke.numGlyphs,$);else{var He=q[Ge];if(He)for(var xt=0;xt<Ke.numGlyphs;xt++)l.addDynamicAttributes($,He.shiftedAnchor,He.angle);else Ur(Ke.numGlyphs,$)}}i.icon.dynamicLayoutVertexBuffer.updateData($)}i.text.dynamicLayoutVertexBuffer.updateData(L)}function Su(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function ao(i,o,n,s,p,f,d,g,b,E,z,D){for(var L=i.context,$=L.gl,q=i.transform,H=g==="map",V=b==="map",X=H&&n.layout.get("symbol-placement")!=="point",Q=H&&!V&&!X,re=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,pe=!1,ue=i.depthModeForSublayer(0,F.ReadOnly),he=n.layout.get("text-variable-anchor"),_e=[],Ie=0,Te=s;Ie<Te.length;Ie+=1){var Le=Te[Ie],Ge=o.getTile(Le),Ke=Ge.getBucket(n);if(Ke){var He=p?Ke.text:Ke.icon;if(He&&He.segments.get().length){var xt=He.programConfigurations.get(n.id),Re=p||Ke.sdfIcons,nt=p?Ke.textSizeData:Ke.iconSizeData,st=V||q.pitch!==0,it=i.useProgram(Su(Re,p,Ke),xt),rt=l.evaluateSizeForZoom(nt,q.zoom),at=void 0,et=[0,0],Je=void 0,xr=void 0,Qt=null,Rr=void 0;if(p)Je=Ge.glyphAtlasTexture,xr=$.LINEAR,at=Ge.glyphAtlasTexture.size,Ke.iconsInText&&(et=Ge.imageAtlasTexture.size,Qt=Ge.imageAtlasTexture,Rr=st||i.options.rotating||i.options.zooming||nt.kind==="composite"||nt.kind==="camera"?$.LINEAR:$.NEAREST);else{var Cr=n.layout.get("icon-size").constantOr(0)!==1||Ke.iconsNeedLinear;Je=Ge.imageAtlasTexture,xr=Re||i.options.rotating||i.options.zooming||Cr||st?$.LINEAR:$.NEAREST,at=Ge.imageAtlasTexture.size}var Yt=Zt(Ge,1,i.transform.zoom),ar=nr(Le.posMatrix,V,H,i.transform,Yt),ci=Bt(Le.posMatrix,V,H,i.transform,Yt),Zr=he&&Ke.hasTextData(),zn=n.layout.get("icon-text-fit")!=="none"&&Zr&&Ke.hasIconData();X&&la(Ke,Le.posMatrix,i,p,ar,ci,V,E);var Qr=i.translatePosMatrix(Le.posMatrix,Ge,f,d),$i=X||p&&he||zn?Vi:ar,ki=i.translatePosMatrix(ci,Ge,f,d,!0),Ca=Re&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,jo={program:it,buffers:He,uniformValues:Re?Ke.iconsInText?es(nt.kind,rt,Q,V,i,Qr,$i,ki,at,et):ma(nt.kind,rt,Q,V,i,Qr,$i,ki,p,at,!0):Lo(nt.kind,rt,Q,V,i,Qr,$i,ki,p,at),atlasTexture:Je,atlasTextureIcon:Qt,atlasInterpolation:xr,atlasInterpolationIcon:Rr,isSDF:Re,hasHalo:Ca};if(re&&Ke.canOverlap){pe=!0;for(var Bn=0,$o=He.segments.get();Bn<$o.length;Bn+=1){var Pa=$o[Bn];_e.push({segments:new l.SegmentVector([Pa]),sortKey:Pa.sortKey,state:jo})}}else _e.push({segments:He.segments,sortKey:0,state:jo})}}}pe&&_e.sort(function(Dn,ho){return Dn.sortKey-ho.sortKey});for(var Ji=0,ka=_e;Ji<ka.length;Ji+=1){var Qi=ka[Ji],br=Qi.state;if(L.activeTexture.set($.TEXTURE0),br.atlasTexture.bind(br.atlasInterpolation,$.CLAMP_TO_EDGE),br.atlasTextureIcon&&(L.activeTexture.set($.TEXTURE1),br.atlasTextureIcon&&br.atlasTextureIcon.bind(br.atlasInterpolationIcon,$.CLAMP_TO_EDGE)),br.isSDF){var cn=br.uniformValues;br.hasHalo&&(cn.u_is_halo=1,va(br.buffers,Qi.segments,n,i,br.program,ue,z,D,cn)),cn.u_is_halo=0}va(br.buffers,Qi.segments,n,i,br.program,ue,z,D,br.uniformValues)}}function va(i,o,n,s,p,f,d,g,b){var E=s.context;p.draw(E,E.gl.TRIANGLES,f,d,g,ee.disabled,b,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function ts(i,o,n,s,p,f,d){var g,b,E,z,D,L=i.context.gl,$=n.paint.get("fill-pattern"),q=$&&$.constantOr(1),H=n.getCrossfadeParameters();d?(b=q&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g=L.LINES):(b=q?"fillPattern":"fill",g=L.TRIANGLES);for(var V=0,X=s;V<X.length;V+=1){var Q=X[V],re=o.getTile(Q);if(!q||re.patternsLoaded()){var pe=re.getBucket(n);if(pe){var ue=pe.programConfigurations.get(n.id),he=i.useProgram(b,ue);q&&(i.context.activeTexture.set(L.TEXTURE0),re.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),ue.updatePaintBuffers(H));var _e=$.constantOr(null);if(_e&&re.imageAtlas){var Ie=re.imageAtlas,Te=Ie.patternPositions[_e.to.toString()],Le=Ie.patternPositions[_e.from.toString()];Te&&Le&&ue.setConstantPatternPositions(Te,Le)}var Ge=i.translatePosMatrix(Q.posMatrix,re,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(d){z=pe.indexBuffer2,D=pe.segments2;var Ke=[L.drawingBufferWidth,L.drawingBufferHeight];E=b==="fillOutlinePattern"&&q?mu(Ge,i,H,re,Ke):du(Ge,Ke)}else z=pe.indexBuffer,D=pe.segments,E=q?ro(Ge,i,H,re):En(Ge);he.draw(i.context,g,p,i.stencilModeForClipping(Q),f,ee.disabled,E,n.id,pe.layoutVertexBuffer,z,D,n.paint,i.transform.zoom,ue)}}}}function sl(i,o,n,s,p,f,d){for(var g=i.context,b=g.gl,E=n.paint.get("fill-extrusion-pattern"),z=E.constantOr(1),D=n.getCrossfadeParameters(),L=n.paint.get("fill-extrusion-opacity"),$=0,q=s;$<q.length;$+=1){var H=q[$],V=o.getTile(H),X=V.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),re=i.useProgram(z?"fillExtrusionPattern":"fillExtrusion",Q);z&&(i.context.activeTexture.set(b.TEXTURE0),V.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),Q.updatePaintBuffers(D));var pe=E.constantOr(null);if(pe&&V.imageAtlas){var ue=V.imageAtlas,he=ue.patternPositions[pe.to.toString()],_e=ue.patternPositions[pe.from.toString()];he&&_e&&Q.setConstantPatternPositions(he,_e)}var Ie=i.translatePosMatrix(H.posMatrix,V,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Te=n.paint.get("fill-extrusion-vertical-gradient"),Le=z?to(Ie,i,Te,L,H,D,V):fu(Ie,i,Te,L);re.draw(g,g.gl.TRIANGLES,p,f,d,ee.backCCW,Le,n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,n.paint,i.transform.zoom,Q)}}}function rs(i,o,n,s,p,f){var d=i.context,g=d.gl,b=o.fbo;if(b){var E=i.useProgram("hillshade");d.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,b.colorAttachment.get());var z=function(D,L,$){var q=$.paint.get("hillshade-shadow-color"),H=$.paint.get("hillshade-highlight-color"),V=$.paint.get("hillshade-accent-color"),X=$.paint.get("hillshade-illumination-direction")*(Math.PI/180);$.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=D.transform.angle);var Q,re,pe,ue=!D.options.moving;return{u_matrix:D.transform.calculatePosMatrix(L.tileID.toUnwrapped(),ue),u_image:0,u_latrange:(Q=L.tileID,re=Math.pow(2,Q.canonical.z),pe=Q.canonical.y,[new l.MercatorCoordinate(0,pe/re).toLngLat().lat,new l.MercatorCoordinate(0,(pe+1)/re).toLngLat().lat]),u_light:[$.paint.get("hillshade-exaggeration"),X],u_shadow:q,u_highlight:H,u_accent:V}}(i,o,n);E.draw(d,g.TRIANGLES,s,p,f,ee.disabled,z,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function Wc(i,o,n,s,p,f){var d=i.context,g=d.gl,b=o.dem;if(b&&b.data){var E=b.dim,z=b.stride,D=b.getPixels();if(d.activeTexture.set(g.TEXTURE1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(z),o.demTexture){var L=o.demTexture;L.update(D,{premultiply:!1}),L.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else o.demTexture=new l.Texture(d,D,g.RGBA,{premultiply:!1}),o.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);d.activeTexture.set(g.TEXTURE0);var $=o.fbo;if(!$){var q=new l.Texture(d,{width:E,height:E,data:null},g.RGBA);q.bind(g.LINEAR,g.CLAMP_TO_EDGE),($=o.fbo=d.createFramebuffer(E,E,!0)).colorAttachment.set(q.texture)}d.bindFramebuffer.set($.framebuffer),d.viewport.set([0,0,E,E]),i.useProgram("hillshadePrepare").draw(d,g.TRIANGLES,s,p,f,ee.disabled,function(H,V){var X=V.stride,Q=l.create();return l.ortho(Q,0,l.EXTENT,-l.EXTENT,0,0,1),l.translate(Q,Q,[0,-l.EXTENT,0]),{u_matrix:Q,u_image:1,u_dimension:[X,X],u_zoom:H.overscaledZ,u_unpack:V.getUnpackVector()}}(o.tileID,b),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function is(i,o,n,s,p){var f=s.paint.get("raster-fade-duration");if(f>0){var d=l.browser.now(),g=(d-i.timeAdded)/f,b=o?(d-o.timeAdded)/f:-1,E=n.getSource(),z=p.coveringZoomLevel({tileSize:E.tileSize,roundZoom:E.roundZoom}),D=!o||Math.abs(o.tileID.overscaledZ-z)>Math.abs(i.tileID.overscaledZ-z),L=D&&i.refreshedUponExpiration?1:l.clamp(D?g:1-b,0,1);return i.refreshedUponExpiration&&g>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-L}:{opacity:L,mix:0}}return{opacity:1,mix:0}}var ll=new l.Color(1,0,0,1),Tu=new l.Color(0,1,0,1),Iu=new l.Color(0,0,1,1),ns=new l.Color(1,0,1,1),ul=new l.Color(0,1,1,1);function cl(i,o,n,s){ga(i,0,o+n/2,i.transform.width,n,s)}function pl(i,o,n,s){ga(i,o-n/2,0,n,i.transform.height,s)}function ga(i,o,n,s,p,f){var d=i.context,g=d.gl;g.enable(g.SCISSOR_TEST),g.scissor(o*l.browser.devicePixelRatio,n*l.browser.devicePixelRatio,s*l.browser.devicePixelRatio,p*l.browser.devicePixelRatio),d.clear({color:f}),g.disable(g.SCISSOR_TEST)}function Eu(i,o,n){var s=i.context,p=s.gl,f=n.posMatrix,d=i.useProgram("debug"),g=F.disabled,b=j.disabled,E=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),d.draw(s,p.LINE_STRIP,g,b,E,ee.disabled,no(f,l.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var z=o.getTileByID(n.key).latestRawTileData,D=Math.floor((z&&z.byteLength||0)/1024),L=o.getTile(n).tileSize,$=512/Math.min(L,512)*(n.overscaledZ/i.transform.zoom)*.5,q=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(q+=" => "+n.overscaledZ),function(H,V){H.initDebugOverlayCanvas();var X=H.debugOverlayCanvas,Q=H.context.gl,re=H.debugOverlayCanvas.getContext("2d");re.clearRect(0,0,X.width,X.height),re.shadowColor="white",re.shadowBlur=2,re.lineWidth=1.5,re.strokeStyle="white",re.textBaseline="top",re.font="bold 36px Open Sans, sans-serif",re.fillText(V,5,5),re.strokeText(V,5,5),H.debugOverlayTexture.update(X),H.debugOverlayTexture.bind(Q.LINEAR,Q.CLAMP_TO_EDGE)}(i,q+" "+D+"kb"),d.draw(s,p.TRIANGLES,g,b,J.alphaBlended,ee.disabled,no(f,l.Color.transparent,$),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var so={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var f=j.disabled,d=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(g,b,E,z,D,L,$){for(var q=b.transform,H=D==="map",V=L==="map",X=0,Q=g;X<Q.length;X+=1){var re=Q[X],pe=z.getTile(re),ue=pe.getBucket(E);if(ue&&ue.text&&ue.text.segments.get().length){var he=l.evaluateSizeForZoom(ue.textSizeData,q.zoom),_e=Zt(pe,1,b.transform.zoom),Ie=nr(re.posMatrix,V,H,b.transform,_e),Te=E.layout.get("icon-text-fit")!=="none"&&ue.hasIconData();if(he){var Le=Math.pow(2,q.zoom-pe.tileID.overscaledZ);wu(ue,H,V,$,l.symbolSize,q,Ie,re.posMatrix,Le,he,Te)}}}}(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&ao(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),f,d),n.paint.get("text-opacity").constantOr(1)!==0&&ao(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),f,d),o.map.showCollisionBoxes&&(Fo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Fo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),f=n.paint.get("circle-stroke-width"),d=n.paint.get("circle-stroke-opacity"),g=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||f.constantOr(1)!==0&&d.constantOr(1)!==0){for(var b=i.context,E=b.gl,z=i.depthModeForSublayer(0,F.ReadOnly),D=j.disabled,L=i.colorModeForRenderPass(),$=[],q=0;q<s.length;q++){var H=s[q],V=o.getTile(H),X=V.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),re={programConfiguration:Q,program:i.useProgram("circle",Q),layoutVertexBuffer:X.layoutVertexBuffer,indexBuffer:X.indexBuffer,uniformValues:al(i,H,V,n)};if(g)for(var pe=0,ue=X.segments.get();pe<ue.length;pe+=1){var he=ue[pe];$.push({segments:new l.SegmentVector([he]),sortKey:he.sortKey,state:re})}else $.push({segments:X.segments,sortKey:0,state:re})}}g&&$.sort(function(Ge,Ke){return Ge.sortKey-Ke.sortKey});for(var _e=0,Ie=$;_e<Ie.length;_e+=1){var Te=Ie[_e],Le=Te.state;Le.program.draw(b,E.TRIANGLES,z,D,L,ee.disabled,Le.uniformValues,n.id,Le.layoutVertexBuffer,Le.indexBuffer,Te.segments,n.paint,i.transform.zoom,Le.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,f=p.gl,d=j.disabled,g=new J([f.ONE,f.ONE],l.Color.transparent,[!0,!0,!0,!0]);(function($,q,H){var V=$.gl;$.activeTexture.set(V.TEXTURE1),$.viewport.set([0,0,q.width/4,q.height/4]);var X=H.heatmapFbo;if(X)V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),$.bindFramebuffer.set(X.framebuffer);else{var Q=V.createTexture();V.bindTexture(V.TEXTURE_2D,Q),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_S,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_WRAP_T,V.CLAMP_TO_EDGE),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MIN_FILTER,V.LINEAR),V.texParameteri(V.TEXTURE_2D,V.TEXTURE_MAG_FILTER,V.LINEAR),X=H.heatmapFbo=$.createFramebuffer(q.width/4,q.height/4,!1),function(re,pe,ue,he){var _e=re.gl;_e.texImage2D(_e.TEXTURE_2D,0,_e.RGBA,pe.width/4,pe.height/4,0,_e.RGBA,re.extRenderToTextureHalfFloat?re.extTextureHalfFloat.HALF_FLOAT_OES:_e.UNSIGNED_BYTE,null),he.colorAttachment.set(ue)}($,q,Q,X)}})(p,i,n),p.clear({color:l.Color.transparent});for(var b=0;b<s.length;b++){var E=s[b];if(!o.hasRenderableParent(E)){var z=o.getTile(E),D=z.getBucket(n);if(D){var L=D.programConfigurations.get(n.id);i.useProgram("heatmap",L).draw(p,f.TRIANGLES,F.disabled,d,g,ee.disabled,vu(E.posMatrix,z,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,D.layoutVertexBuffer,D.indexBuffer,D.segments,n.paint,i.transform.zoom,L)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),function($,q){var H=$.context,V=H.gl,X=q.heatmapFbo;if(X){H.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,X.colorAttachment.get()),H.activeTexture.set(V.TEXTURE1);var Q=q.colorRampTexture;Q||(Q=q.colorRampTexture=new l.Texture(H,q.colorRamp,V.RGBA)),Q.bind(V.LINEAR,V.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(H,V.TRIANGLES,F.disabled,j.disabled,$.colorModeForRenderPass(),ee.disabled,function(re,pe,ue,he){var _e=l.create();l.ortho(_e,0,re.width,re.height,0,0,1);var Ie=re.context.gl;return{u_matrix:_e,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:pe.paint.get("heatmap-opacity")}}($,q),q.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,q.paint,$.transform.zoom)}}(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),f=n.paint.get("line-width");if(p.constantOr(1)!==0&&f.constantOr(1)!==0)for(var d=i.depthModeForSublayer(0,F.ReadOnly),g=i.colorModeForRenderPass(),b=n.paint.get("line-dasharray"),E=n.paint.get("line-pattern"),z=E.constantOr(1),D=n.paint.get("line-gradient"),L=n.getCrossfadeParameters(),$=z?"linePattern":b?"lineSDF":D?"lineGradient":"line",q=i.context,H=q.gl,V=!0,X=0,Q=s;X<Q.length;X+=1){var re=Q[X],pe=o.getTile(re);if(!z||pe.patternsLoaded()){var ue=pe.getBucket(n);if(ue){var he=ue.programConfigurations.get(n.id),_e=i.context.program.get(),Ie=i.useProgram($,he),Te=V||Ie.program!==_e,Le=E.constantOr(null);if(Le&&pe.imageAtlas){var Ge=pe.imageAtlas,Ke=Ge.patternPositions[Le.to.toString()],He=Ge.patternPositions[Le.from.toString()];Ke&&He&&he.setConstantPatternPositions(Ke,He)}var xt=z?Ja(i,pe,n,L):b?Zc(i,pe,n,b,L):D?Ut(i,pe,n,ue.lineClipsArray.length):da(i,pe,n);if(z)q.activeTexture.set(H.TEXTURE0),pe.imageAtlasTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),he.updatePaintBuffers(L);else if(b&&(Te||i.lineAtlas.dirty))q.activeTexture.set(H.TEXTURE0),i.lineAtlas.bind(q);else if(D){var Re=ue.gradients[n.id],nt=Re.texture;if(n.gradientVersion!==Re.version){var st=256;if(n.stepInterpolant){var it=o.getSource().maxzoom,rt=re.canonical.z===it?Math.ceil(1<<i.transform.maxZoom-re.canonical.z):1;st=l.clamp(l.nextPowerOfTwo(ue.maxLineLength/l.EXTENT*1024*rt),256,q.maxTextureSize)}Re.gradient=l.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:st,image:Re.gradient||void 0,clips:ue.lineClipsArray}),Re.texture?Re.texture.update(Re.gradient):Re.texture=new l.Texture(q,Re.gradient,H.RGBA),Re.version=n.gradientVersion,nt=Re.texture}q.activeTexture.set(H.TEXTURE0),nt.bind(n.stepInterpolant?H.NEAREST:H.LINEAR,H.CLAMP_TO_EDGE)}Ie.draw(q,H.TRIANGLES,d,i.stencilModeForClipping(re),g,ee.disabled,xt,n.id,ue.layoutVertexBuffer,ue.indexBuffer,ue.segments,n.paint,i.transform.zoom,he,ue.layoutVertexBuffer2),V=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),f=n.paint.get("fill-opacity");if(f.constantOr(1)!==0){var d=i.colorModeForRenderPass(),g=n.paint.get("fill-pattern"),b=i.opaquePassEnabledForLayer()&&!g.constantOr(1)&&p.constantOr(l.Color.transparent).a===1&&f.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===b){var E=i.depthModeForSublayer(1,i.renderPass==="opaque"?F.ReadWrite:F.ReadOnly);ts(i,o,n,s,E,d,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var z=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,F.ReadOnly);ts(i,o,n,s,z,d,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var f=new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))sl(i,o,n,s,f,j.disabled,J.disabled),sl(i,o,n,s,f,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var d=i.colorModeForRenderPass();sl(i,o,n,s,f,j.disabled,d)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,f=i.depthModeForSublayer(0,F.ReadOnly),d=i.colorModeForRenderPass(),g=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],b=g[0],E=0,z=g[1];E<z.length;E+=1){var D=z[E],L=o.getTile(D);L.needsHillshadePrepare&&i.renderPass==="offscreen"?Wc(i,L,n,f,j.disabled,d):i.renderPass==="translucent"&&rs(i,L,n,f,b[D.overscaledZ],d)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,f=p.gl,d=o.getSource(),g=i.useProgram("raster"),b=i.colorModeForRenderPass(),E=d instanceof Gi?[{},s]:i.stencilConfigForOverlap(s),z=E[0],D=E[1],L=D[D.length-1].overscaledZ,$=!i.options.moving,q=0,H=D;q<H.length;q+=1){var V=H[q],X=i.depthModeForSublayer(V.overscaledZ-L,n.paint.get("raster-opacity")===1?F.ReadWrite:F.ReadOnly,f.LESS),Q=o.getTile(V),re=i.transform.calculatePosMatrix(V.toUnwrapped(),$);Q.registerFadeDuration(n.paint.get("raster-fade-duration"));var pe=o.findLoadedParent(V,0),ue=is(Q,pe,o,n,i.transform),he=void 0,_e=void 0,Ie=n.paint.get("raster-resampling")==="nearest"?f.NEAREST:f.LINEAR;p.activeTexture.set(f.TEXTURE0),Q.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1),pe?(pe.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,pe.tileID.overscaledZ-Q.tileID.overscaledZ),_e=[Q.tileID.canonical.x*he%1,Q.tileID.canonical.y*he%1]):Q.texture.bind(Ie,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST);var Te=Gc(re,_e||[0,0],he||1,ue,n);d instanceof Gi?g.draw(p,f.TRIANGLES,X,j.disabled,b,ee.disabled,Te,n.id,d.boundsBuffer,i.quadTriangleIndexBuffer,d.boundsSegments):g.draw(p,f.TRIANGLES,X,z[V.overscaledZ],b,ee.disabled,Te,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var f=i.context,d=f.gl,g=i.transform,b=g.tileSize,E=n.paint.get("background-pattern");if(!i.isPatternMissing(E)){var z=!E&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===z){var D=j.disabled,L=i.depthModeForSublayer(0,z==="opaque"?F.ReadWrite:F.ReadOnly),$=i.colorModeForRenderPass(),q=i.useProgram(E?"backgroundPattern":"background"),H=g.coveringTiles({tileSize:b});E&&(f.activeTexture.set(d.TEXTURE0),i.imageManager.bind(i.context));for(var V=n.getCrossfadeParameters(),X=0,Q=H;X<Q.length;X+=1){var re=Q[X],pe=i.transform.calculatePosMatrix(re.toUnwrapped()),ue=E?Ro(pe,p,i,E,{tileID:re,tileSize:b},V):ya(pe,p,s);q.draw(f,d.TRIANGLES,L,D,$,ee.disabled,ue,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)Eu(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var f=p.prerender;f&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),f.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(j.disabled);var d=p.renderingMode==="3d"?new F(i.context.gl.LEQUAL,F.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,F.ReadOnly);s.setDepthMode(d),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Gt=function(i,o){this.context=new B(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=G.maxUnderzooming+G.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new _n,this.gpuTimers={}};Gt.prototype.resize=function(i,o){if(this.width=i*l.browser.devicePixelRatio,this.height=o*l.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Gt.prototype.setup=function(){var i=this.context,o=new l.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(l.EXTENT,0),o.emplaceBack(0,l.EXTENT),o.emplaceBack(l.EXTENT,l.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,hr.members),this.tileExtentSegments=l.SegmentVector.simpleSegment(0,0,4,2);var n=new l.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(l.EXTENT,0),n.emplaceBack(0,l.EXTENT),n.emplaceBack(l.EXTENT,l.EXTENT),this.debugBuffer=i.createVertexBuffer(n,hr.members),this.debugSegments=l.SegmentVector.simpleSegment(0,0,4,5);var s=new l.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(l.EXTENT,0,l.EXTENT,0),s.emplaceBack(0,l.EXTENT,0,l.EXTENT),s.emplaceBack(l.EXTENT,l.EXTENT,l.EXTENT,l.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Di.members),this.rasterBoundsSegments=l.SegmentVector.simpleSegment(0,0,4,2);var p=new l.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,hr.members),this.viewportSegments=l.SegmentVector.simpleSegment(0,0,4,2);var f=new l.StructArrayLayout1ui2;f.emplaceBack(0),f.emplaceBack(1),f.emplaceBack(3),f.emplaceBack(2),f.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(f);var d=new l.StructArrayLayout3ui6;d.emplaceBack(0,1,2),d.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(d),this.emptyTexture=new l.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var g=this.context.gl;this.stencilClearMode=new j({func:g.ALWAYS,mask:0},0,255,g.ZERO,g.ZERO,g.ZERO)},Gt.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=l.create();l.ortho(n,0,this.width,this.height,0,0,1),l.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,F.disabled,this.stencilClearMode,J.disabled,ee.disabled,oo(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Gt.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(J.disabled),n.setDepthMode(F.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var f=0,d=o;f<d.length;f+=1){var g=d[f],b=this._tileClippingMaskIDs[g.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,F.disabled,new j({func:s.ALWAYS,mask:0},b,255,s.KEEP,s.KEEP,s.REPLACE),J.disabled,ee.disabled,oo(g.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Gt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new j({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},Gt.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new j({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},Gt.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort(function(b,E){return E.overscaledZ-b.overscaledZ}),p=s[s.length-1].overscaledZ,f=s[0].overscaledZ-p+1;if(f>1){this.currentStencilSource=void 0,this.nextStencilID+f>256&&this.clearStencil();for(var d={},g=0;g<f;g++)d[g+p]=new j({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=f,[d,s]}return[(o={},o[p]=j.disabled,o),s]},Gt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new J([i.CONSTANT_COLOR,i.ONE],new l.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?J.unblended:J.alphaBlended},Gt.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return F.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new F(n||this.context.gl.LEQUAL,o,[s,s])},Gt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Gt.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(l.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var f in p){var d=p[f];d.used&&d.prepare(this.context)}var g,b,E={},z={},D={};for(var L in p){var $=p[L];E[L]=$.getVisibleCoordinates(),z[L]=E[L].slice().reverse(),D[L]=$.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var q=0;q<s.length;q++)if(this.style._layers[s[q]].is3D()){this.opaquePassCutoff=q;break}this.renderPass="offscreen";for(var H=0,V=s;H<V.length;H+=1){var X=this.style._layers[V[H]];if(X.hasOffscreenPass()&&!X.isHidden(this.transform.zoom)){var Q=z[X.source];(X.type==="custom"||Q.length)&&this.renderLayer(this,p[X.source],X,Q)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?l.Color.black:l.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var re=this.style._layers[s[this.currentLayer]],pe=p[re.source],ue=E[re.source];this._renderTileClippingMasks(re,ue),this.renderLayer(this,pe,re,ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var he=this.style._layers[s[this.currentLayer]],_e=p[he.source],Ie=(he.type==="symbol"?D:z)[he.source];this._renderTileClippingMasks(he,E[he.source]),this.renderLayer(this,_e,he,Ie)}this.options.showTileBoundaries&&(l.values(this.style._layers).forEach(function(Te){Te.source&&!Te.isHidden(n.transform.zoom)&&(Te.source!==(b&&b.id)&&(b=n.style.sourceCaches[Te.source]),(!g||g.getSource().maxzoom<b.getSource().maxzoom)&&(g=b))}),g&&so.debug(this,g,g.getVisibleCoordinates())),this.options.showPadding&&function(Te){var Le=Te.transform.padding;cl(Te,Te.transform.height-(Le.top||0),3,ll),cl(Te,Le.bottom||0,3,Tu),pl(Te,Le.left||0,3,Iu),pl(Te,Te.transform.width-(Le.right||0),3,ns);var Ge=Te.transform.centerPoint;(function(Ke,He,xt,Re){ga(Ke,He-1,xt-10,2,20,Re),ga(Ke,He-10,xt-1,20,2,Re)})(Te,Ge.x,Te.transform.height-Ge.y,ul)}(this),this.context.setDefault()},Gt.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),so[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Gt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},Gt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Gt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Gt.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,f=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=f}return o},Gt.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var f=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(f){var d=Math.sin(f),g=Math.cos(f);n=[n[0]*g-n[1]*d,n[0]*d+n[1]*g]}var b=[p?n[0]:Zt(o,n[0],this.transform.zoom),p?n[1]:Zt(o,n[1],this.transform.zoom),0],E=new Float32Array(16);return l.translate(E,i,b),E},Gt.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},Gt.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},Gt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},Gt.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new pu(this.context,i,$c[i],o,xu[i],this._showOverdrawInspector)),this.cache[n]},Gt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Gt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Gt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=l.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Gt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var os=function(i,o){this.points=i,this.planes=o};os.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(d){return l.transformMat4([],d,i)}).map(function(d){return l.scale$1([],d,1/d[3]/o*s)}),f=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(d){var g=l.sub([],p[d[0]],p[d[1]]),b=l.sub([],p[d[2]],p[d[1]]),E=l.normalize([],l.cross([],g,b)),z=-l.dot(E,p[d[1]]);return E.concat(z)});return new os(p,f)};var lo=function(i,o){this.min=i,this.max=o,this.center=l.scale$2([],l.add([],this.min,this.max),.5)};lo.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=l.clone$2(this.min),s=l.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new lo(n,s)},lo.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},lo.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},lo.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],f=0,d=0;d<o.length;d++)f+=l.dot$1(p,o[d])>=0;if(f===0)return 0;f!==o.length&&(n=!1)}if(n)return 2;for(var g=0;g<3;g++){for(var b=Number.MAX_VALUE,E=-Number.MAX_VALUE,z=0;z<i.points.length;z++){var D=i.points[z][g]-this.min[g];b=Math.min(b,D),E=Math.max(E,D)}if(E<0||b>this.max[g]-this.min[g])return 0}return 1};var An=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};An.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=l.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=l.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=l.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=l.number(i.right,o.right,n)),this},An.prototype.getCenter=function(i,o){var n=l.clamp((this.left+i-this.right)/2,0,i),s=l.clamp((this.top+o-this.bottom)/2,0,o);return new l.Point(n,s)},An.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},An.prototype.clone=function(){return new An(this.top,this.bottom,this.left,this.right)},An.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var vt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new An,this._posMatrixCache={},this._alignedPosMatrixCache={}},qt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};vt.prototype.clone=function(){var i=new vt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},qt.minZoom.get=function(){return this._minZoom},qt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},qt.maxZoom.get=function(){return this._maxZoom},qt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},qt.minPitch.get=function(){return this._minPitch},qt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},qt.maxPitch.get=function(){return this._maxPitch},qt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},qt.renderWorldCopies.get=function(){return this._renderWorldCopies},qt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},qt.worldSize.get=function(){return this.tileSize*this.scale},qt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},qt.size.get=function(){return new l.Point(this.width,this.height)},qt.bearing.get=function(){return-this.angle/Math.PI*180},qt.bearing.set=function(i){var o=-l.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=l.create$2(),l.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},qt.pitch.get=function(){return this._pitch/Math.PI*180},qt.pitch.set=function(i){var o=l.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},qt.fov.get=function(){return this._fov/Math.PI*180},qt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},qt.zoom.get=function(){return this._zoom},qt.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},qt.center.get=function(){return this._center},qt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},qt.padding.get=function(){return this._edgeInsets.toJSON()},qt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},qt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},vt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},vt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},vt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},vt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new l.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new l.Point(0,0)),s=this.pointCoordinate(new l.Point(this.width,0)),p=this.pointCoordinate(new l.Point(this.width,this.height)),f=this.pointCoordinate(new l.Point(0,this.height)),d=Math.floor(Math.min(n.x,s.x,p.x,f.x)),g=Math.floor(Math.max(n.x,s.x,p.x,f.x)),b=d-1;b<=g+1;b++)b!==0&&o.push(new l.UnwrappedTileID(b,i));return o},vt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=l.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),f=[p*s.x,p*s.y,0],d=os.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),g=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(g=o);var b=function(Te){return{aabb:new lo([Te*p,0,0],[(Te+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Te,fullyVisible:!1}},E=[],z=[],D=o,L=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var $=1;$<=3;$++)E.push(b(-$)),E.push(b($));for(E.push(b(0));E.length>0;){var q=E.pop(),H=q.x,V=q.y,X=q.fullyVisible;if(!X){var Q=q.aabb.intersects(d);if(Q===0)continue;X=Q===2}var re=q.aabb.distanceX(f),pe=q.aabb.distanceY(f),ue=Math.max(Math.abs(re),Math.abs(pe));if(q.zoom===D||ue>3+(1<<D-q.zoom)-2&&q.zoom>=g)z.push({tileID:new l.OverscaledTileID(q.zoom===D?L:q.zoom,q.wrap,q.zoom,H,V),distanceSq:l.sqrLen([f[0]-.5-H,f[1]-.5-V])});else for(var he=0;he<4;he++){var _e=(H<<1)+he%2,Ie=(V<<1)+(he>>1);E.push({aabb:q.aabb.quadrant(he),zoom:q.zoom+1,x:_e,y:Ie,wrap:q.wrap,fullyVisible:X})}}return z.sort(function(Te,Le){return Te.distanceSq-Le.distanceSq}).map(function(Te){return Te.tileID})},vt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},qt.unmodified.get=function(){return this._unmodified},vt.prototype.zoomScale=function(i){return Math.pow(2,i)},vt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},vt.prototype.project=function(i){var o=l.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.Point(l.mercatorXfromLng(i.lng)*this.worldSize,l.mercatorYfromLat(o)*this.worldSize)},vt.prototype.unproject=function(i){return new l.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},qt.point.get=function(){return this.project(this.center)},vt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),f=new l.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(f),this._renderWorldCopies&&(this.center=this.center.wrap())},vt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},vt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},vt.prototype.locationCoordinate=function(i){return l.MercatorCoordinate.fromLngLat(i)},vt.prototype.coordinateLocation=function(i){return i.toLngLat()},vt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];l.transformMat4(o,o,this.pixelMatrixInverse),l.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],f=o[1]/s,d=n[1]/p,g=o[2]/s,b=n[2]/p,E=g===b?0:(0-g)/(b-g);return new l.MercatorCoordinate(l.number(o[0]/s,n[0]/p,E)/this.worldSize,l.number(f,d,E)/this.worldSize)},vt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix),new l.Point(o[0]/o[3],o[1]/o[3])},vt.prototype.getBounds=function(){return new l.LngLatBounds().extend(this.pointLocation(new l.Point(0,0))).extend(this.pointLocation(new l.Point(this.width,0))).extend(this.pointLocation(new l.Point(this.width,this.height))).extend(this.pointLocation(new l.Point(0,this.height)))},vt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new l.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},vt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},vt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,f=this.worldSize/this.zoomScale(p.z),d=p.x+Math.pow(2,p.z)*i.wrap,g=l.identity(new Float64Array(16));return l.translate(g,g,[d*f,p.y*f,0]),l.scale(g,g,[f/l.EXTENT,f/l.EXTENT,1]),l.multiply(g,o?this.alignedProjMatrix:this.projMatrix,g),s[n]=new Float32Array(g),s[n]},vt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},vt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,f=90,d=-180,g=180,b=this.size,E=this._unmodified;if(this.latRange){var z=this.latRange;p=l.mercatorYfromLat(z[1])*this.worldSize,i=(f=l.mercatorYfromLat(z[0])*this.worldSize)-p<b.y?b.y/(f-p):0}if(this.lngRange){var D=this.lngRange;d=l.mercatorXfromLng(D[0])*this.worldSize,o=(g=l.mercatorXfromLng(D[1])*this.worldSize)-d<b.x?b.x/(g-d):0}var L=this.point,$=Math.max(o||0,i||0);if($)return this.center=this.unproject(new l.Point(o?(g+d)/2:L.x,i?(f+p)/2:L.y)),this.zoom+=this.scaleZoom($),this._unmodified=E,void(this._constraining=!1);if(this.latRange){var q=L.y,H=b.y/2;q-H<p&&(s=p+H),q+H>f&&(s=f-H)}if(this.lngRange){var V=L.x,X=b.x/2;V-X<d&&(n=d+X),V+X>g&&(n=g-X)}n===void 0&&s===void 0||(this.center=this.unproject(new l.Point(n!==void 0?n:L.x,s!==void 0?s:L.y))),this._unmodified=E,this._constraining=!1}},vt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(l.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,f=p.x,d=p.y,g=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),b=this.height/50,E=new Float64Array(16);l.perspective(E,this._fov,this.width/this.height,b,g),E[8]=2*-i.x/this.width,E[9]=2*i.y/this.height,l.scale(E,E,[1,-1,1]),l.translate(E,E,[0,0,-this.cameraToCenterDistance]),l.rotateX(E,E,this._pitch),l.rotateZ(E,E,this.angle),l.translate(E,E,[-f,-d,0]),this.mercatorMatrix=l.scale([],E,[this.worldSize,this.worldSize,this.worldSize]),l.scale(E,E,[1,1,l.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=E,this.invProjMatrix=l.invert([],this.projMatrix);var z=this.width%2/2,D=this.height%2/2,L=Math.cos(this.angle),$=Math.sin(this.angle),q=f-Math.round(f)+L*z+$*D,H=d-Math.round(d)+L*D+$*z,V=new Float64Array(E);if(l.translate(V,V,[q>.5?q-1:q,H>.5?H-1:H,0]),this.alignedProjMatrix=V,E=l.create(),l.scale(E,E,[this.width/2,-this.height/2,1]),l.translate(E,E,[1,-1,0]),this.labelPlaneMatrix=E,E=l.create(),l.scale(E,E,[1,-1,1]),l.translate(E,E,[-1,-1,0]),l.scale(E,E,[2/this.width,2/this.height,1]),this.glCoordMatrix=E,this.pixelMatrix=l.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(E=l.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=E,this._posMatrixCache={},this._alignedPosMatrixCache={}}},vt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new l.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},vt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.Point(0,i))},vt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,f=o.y,d=0,g=i;d<g.length;d+=1){var b=g[d];n=Math.min(n,b.x),s=Math.min(s,b.y),p=Math.max(p,b.x),f=Math.max(f,b.y)}return[new l.Point(n,s),new l.Point(p,s),new l.Point(p,f),new l.Point(n,f),new l.Point(n,s)]},Object.defineProperties(vt.prototype,qt);var di=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),l.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};di.prototype.addTo=function(i){return this._map=i,l.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},di.prototype.remove=function(){return l.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},di.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),f=Math.round(o.lng*p)/p,d=Math.round(o.lat*p)/p,g=this._map.getBearing(),b=this._map.getPitch(),E="";if(E+=i?"/"+f+"/"+d+"/"+n:n+"/"+d+"/"+f,(g||b)&&(E+="/"+Math.round(10*g)/10),b&&(E+="/"+Math.round(b)),this._hashName){var z=this._hashName,D=!1,L=l.window.location.hash.slice(1).split("&").map(function($){var q=$.split("=")[0];return q===z?(D=!0,q+"="+E):$}).filter(function($){return $});return D||L.push(z+"="+E),"#"+L.join("&")}return"#"+E},di.prototype._getCurrentHash=function(){var i,o=this,n=l.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(s){return s.split("=")}).forEach(function(s){s[0]===o._hashName&&(i=s)}),(i&&i[1]||"").split("/")):n.split("/")},di.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some(function(n){return isNaN(n)})){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},di.prototype._updateHashUnthrottled=function(){var i=l.window.location.href.replace(/(#.+)?$/,this.getHashString());try{l.window.history.replaceState(l.window.history.state,null,i)}catch{}};var _a={linearity:.3,easing:l.bezier(0,0,.3,1)},Oo=l.extend({deceleration:2500,maxSpeed:1400},_a),xa=l.extend({deceleration:20,maxSpeed:1400},_a),Xc=l.extend({deceleration:1e3,maxSpeed:360},_a),Hc=l.extend({deceleration:1e3,maxSpeed:90},_a),ba=function(i){this._map=i,this.clear()};function wa(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function sn(i,o,n){var s=n.maxSpeed,p=n.linearity,f=n.deceleration,d=l.clamp(i*p/(o/1e3),-s,s),g=Math.abs(d)/(f*p);return{easing:n.easing,duration:1e3*g,amount:d*(g/2)}}ba.prototype.clear=function(){this._inertiaBuffer=[]},ba.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.browser.now(),settings:i})},ba.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=l.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},ba.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new l.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var f=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){var g=sn(o.pan.mag(),f,l.extend({},Oo,i||{}));d.offset=o.pan.mult(g.amount/o.pan.mag()),d.center=this._map.transform.center,wa(d,g)}if(o.zoom){var b=sn(o.zoom,f,xa);d.zoom=this._map.transform.zoom+b.amount,wa(d,b)}if(o.bearing){var E=sn(o.bearing,f,Xc);d.bearing=this._map.transform.bearing+l.clamp(E.amount,-179,179),wa(d,E)}if(o.pitch){var z=sn(o.pitch,f,Hc);d.pitch=this._map.transform.pitch+z.amount,wa(d,z)}if(d.zoom||d.bearing){var D=o.pinchAround===void 0?o.around:o.pinchAround;d.around=D?this._map.unproject(D):this._map.getCenter()}return this.clear(),l.extend(d,{noMoveStart:!0})}};var mr=function(i){function o(s,p,f,d){d===void 0&&(d={});var g=Y.mousePos(p.getCanvasContainer(),f),b=p.unproject(g);i.call(this,s,l.extend({point:g,lngLat:b,originalEvent:f},d)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),Sa=function(i){function o(s,p,f){var d=s==="touchend"?f.changedTouches:f.touches,g=Y.touchPos(p.getCanvasContainer(),d),b=g.map(function(D){return p.unproject(D)}),E=g.reduce(function(D,L,$,q){return D.add(L.div(q.length))},new l.Point(0,0)),z=p.unproject(E);i.call(this,s,{points:g,point:E,lngLats:b,lngLat:z,originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),Au=function(i){function o(s,p,f){i.call(this,s,{originalEvent:f}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),fr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};fr.prototype.reset=function(){delete this._mousedownPos},fr.prototype.wheel=function(i){return this._firePreventable(new Au(i.type,this._map,i))},fr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new mr(i.type,this._map,i))},fr.prototype.mouseup=function(i){this._map.fire(new mr(i.type,this._map,i))},fr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new mr(i.type,this._map,i))},fr.prototype.dblclick=function(i){return this._firePreventable(new mr(i.type,this._map,i))},fr.prototype.mouseover=function(i){this._map.fire(new mr(i.type,this._map,i))},fr.prototype.mouseout=function(i){this._map.fire(new mr(i.type,this._map,i))},fr.prototype.touchstart=function(i){return this._firePreventable(new Sa(i.type,this._map,i))},fr.prototype.touchmove=function(i){this._map.fire(new Sa(i.type,this._map,i))},fr.prototype.touchend=function(i){this._map.fire(new Sa(i.type,this._map,i))},fr.prototype.touchcancel=function(i){this._map.fire(new Sa(i.type,this._map,i))},fr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},fr.prototype.isEnabled=function(){return!0},fr.prototype.isActive=function(){return!1},fr.prototype.enable=function(){},fr.prototype.disable=function(){};var Ve=function(i){this._map=i};Ve.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ve.prototype.mousemove=function(i){this._map.fire(new mr(i.type,this._map,i))},Ve.prototype.mousedown=function(){this._delayContextMenu=!0},Ve.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new mr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ve.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new mr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Ve.prototype.isEnabled=function(){return!0},Ve.prototype.isActive=function(){return!1},Ve.prototype.enable=function(){},Ve.prototype.disable=function(){};var oi=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function as(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}oi.prototype.isEnabled=function(){return!!this._enabled},oi.prototype.isActive=function(){return!!this._active},oi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},oi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},oi.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(Y.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},oi.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=Y.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),f=Math.max(s.x,n.x),d=Math.min(s.y,n.y),g=Math.max(s.y,n.y);Y.setTransform(this._box,"translate("+p+"px,"+d+"px)"),this._box.style.width=f-p+"px",this._box.style.height=g-d+"px"}}},oi.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),Y.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new l.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(f){return f.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},oi.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},oi.prototype.blur=function(){this.reset()},oi.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(Y.remove(this._box),this._box=null),Y.enableDrag(),delete this._startPos,delete this._lastPos},oi.prototype._fireEvent=function(i,o){return this._map.fire(new l.Event(i,{originalEvent:o}))};var Vo=function(i){this.reset(),this.numTouches=i.numTouches};Vo.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Vo.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=function(s){for(var p=new l.Point(0,0),f=0,d=s;f<d.length;f+=1)p._add(d[f]);return p.div(s.length)}(o),this.touches=as(n,o)))},Vo.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=as(n,o);for(var p in this.touches){var f=s[p];(!f||f.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Vo.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var Ni=function(i){this.singleTap=new Vo(i),this.numTaps=i.numTaps,this.reset()};Ni.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ni.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},Ni.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},Ni.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,f=!this.lastTap||this.lastTap.dist(s)<30;if(p&&f||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var ai=function(){this._zoomIn=new Ni({numTouches:1,numTaps:2}),this._zoomOut=new Ni({numTouches:2,numTaps:1}),this.reset()};ai.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ai.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},ai.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},ai.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),f=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()+1,around:d.unproject(p)},{originalEvent:i})}}):f?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(d){return d.easeTo({duration:300,zoom:d.getZoom()-1,around:d.unproject(f)},{originalEvent:i})}}):void 0},ai.prototype.touchcancel=function(){this.reset()},ai.prototype.enable=function(){this._enabled=!0},ai.prototype.disable=function(){this._enabled=!1,this.reset()},ai.prototype.isEnabled=function(){return this._enabled},ai.prototype.isActive=function(){return this._active};var hl={0:1,2:2},Pe=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Pe.prototype.blur=function(){this.reset()},Pe.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Pe.prototype._correctButton=function(i,o){return!1},Pe.prototype._move=function(i,o){return{}},Pe.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=Y.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Pe.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),function(s,p){var f=hl[p];return s.buttons===void 0||(s.buttons&f)!==f}(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Pe.prototype.mouseupWindow=function(i){this._lastPoint&&Y.mouseButton(i)===this._eventButton&&(this._moved&&Y.suppressClick(),this.reset())},Pe.prototype.enable=function(){this._enabled=!0},Pe.prototype.disable=function(){this._enabled=!1,this.reset()},Pe.prototype.isEnabled=function(){return this._enabled},Pe.prototype.isActive=function(){return this._active};var fl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o}(Pe),ss=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Pe),dl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Pe),Ai=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Ai.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new l.Point(0,0)},Ai.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},Ai.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},Ai.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},Ai.prototype.touchcancel=function(){this.reset()},Ai.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=as(n,o),p=new l.Point(0,0),f=new l.Point(0,0),d=0;for(var g in s){var b=s[g],E=this._touches[g];E&&(p._add(b),f._add(b.sub(E)),d++,s[g]=b)}if(this._touches=s,!(d<this._minTouches)&&f.mag()){var z=f.div(d);if(this._sum._add(z),!(this._sum.mag()<this._clickTolerance))return{around:p.div(d),panDelta:z}}},Ai.prototype.enable=function(){this._enabled=!0},Ai.prototype.disable=function(){this._enabled=!1,this.reset()},Ai.prototype.isEnabled=function(){return this._enabled},Ai.prototype.isActive=function(){return this._active};var si=function(){this.reset()};function ls(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function us(i,o){return Math.log(i/o)/Math.LN2}si.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},si.prototype._start=function(i){},si.prototype._move=function(i,o,n){return{}},si.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},si.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],f=ls(n,o,s[0]),d=ls(n,o,p);if(f&&d){var g=this._aroundCenter?null:f.add(d).div(2);return this._move([f,d],g,i)}}},si.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],f=ls(n,o,s[0]),d=ls(n,o,p);f&&d||(this._active&&Y.suppressClick(),this.reset())}},si.prototype.touchcancel=function(){this.reset()},si.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},si.prototype.disable=function(){this._enabled=!1,this.reset()},si.prototype.isEnabled=function(){return this._enabled},si.prototype.isActive=function(){return this._active};var li=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(us(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:us(this._distance,p),pinchAround:s}},o}(si);function ln(i,o){return 180*i.angleWith(o)/Math.PI}var Cu=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=ln(n,this._startVector);return Math.abs(p)<s},o}(si);function Ta(i){return Math.abs(i.y)>Math.abs(i.x)}var ml=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Ta(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var f=n[0].sub(this._lastPoints[0]),d=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(f,d,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(f.y+d.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var f=n.mag()>=2,d=s.mag()>=2;if(f||d){if(!f||!d)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var g=n.y>0==s.y>0;return Ta(n)&&Ta(s)&&g}},o}(si),yl={panStep:100,bearingStep:15,pitchStep:10},Ui=function(){var i=yl;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function mi(i){return i*(2-i)}Ui.prototype.blur=function(){this.reset()},Ui.prototype.reset=function(){this._active=!1},Ui.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,f=0,d=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),f=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),f=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),d=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),d=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(g){var b=g.getZoom();g.easeTo({duration:300,easeId:"keyboardHandler",easing:mi,zoom:n?Math.round(b)+n*(i.shiftKey?2:1):b,bearing:g.getBearing()+s*o._bearingStep,pitch:g.getPitch()+p*o._pitchStep,offset:[-f*o._panStep,-d*o._panStep],center:g.getCenter()},{originalEvent:i})}}}},Ui.prototype.enable=function(){this._enabled=!0},Ui.prototype.disable=function(){this._enabled=!1,this.reset()},Ui.prototype.isEnabled=function(){return this._enabled},Ui.prototype.isActive=function(){return this._active},Ui.prototype.disableRotation=function(){this._rotationDisabled=!0},Ui.prototype.enableRotation=function(){this._rotationDisabled=!1};var ht=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,l.bindAll(["_onTimeout"],this)};ht.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ht.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ht.prototype.isEnabled=function(){return!!this._enabled},ht.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ht.prototype.isZooming=function(){return!!this._zooming},ht.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ht.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ht.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===l.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=l.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},ht.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ht.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=Y.mousePos(this._el,i);this._around=l.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ht.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var f,d=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,g=this._startZoom,b=this._easing,E=!1;if(this._type==="wheel"&&g&&b){var z=Math.min((l.browser.now()-this._lastWheelEventTime)/200,1),D=b(z);f=l.number(g,d,D),z<1?this._frameId||(this._frameId=!0):E=!0}else f=d,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:f-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ht.prototype._smoothOutEasing=function(i){var o=l.ease;if(this._prevEase){var n=this._prevEase,s=(l.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),f=.27/Math.sqrt(p*p+1e-4)*.01,d=Math.sqrt(.0729-f*f);o=l.bezier(f,d,.25,1)}return this._prevEase={start:l.browser.now(),duration:i,easing:o},o},ht.prototype.blur=function(){this.reset()},ht.prototype.reset=function(){this._active=!1};var Hi=function(i,o){this._clickZoom=i,this._tapZoom=o};Hi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Hi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Hi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Hi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Ci=function(){this.reset()};Ci.prototype.reset=function(){this._active=!1},Ci.prototype.blur=function(){this.reset()},Ci.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},Ci.prototype.enable=function(){this._enabled=!0},Ci.prototype.disable=function(){this._enabled=!1,this.reset()},Ci.prototype.isEnabled=function(){return this._enabled},Ci.prototype.isActive=function(){return this._active};var Dr=function(){this._tap=new Ni({numTouches:1,numTaps:1}),this.reset()};Dr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Dr.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},Dr.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},Dr.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},Dr.prototype.touchcancel=function(){this.reset()},Dr.prototype.enable=function(){this._enabled=!0},Dr.prototype.disable=function(){this._enabled=!1,this.reset()},Dr.prototype.isEnabled=function(){return this._enabled},Dr.prototype.isActive=function(){return this._active};var uo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};uo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},uo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},uo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},uo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Cn=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};Cn.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Cn.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Cn.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Cn.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var qi=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};qi.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},qi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},qi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},qi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},qi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},qi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var jr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},Ia=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o}(l.Event);function Ze(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var qe=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ba(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),l.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[l.window.document,"mousemove",{capture:!0}],[l.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[l.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var f=p[s],d=f[0];Y.addEventListener(d,f[1],d===l.window.document?this.handleWindowEvent:this.handleEvent,f[2])}};qe.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];Y.removeEventListener(s,n[1],s===l.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},qe.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new fr(o,i));var s=o.boxZoom=new oi(o,i);this._add("boxZoom",s);var p=new ai,f=new Ci;o.doubleClickZoom=new Hi(f,p),this._add("tapZoom",p),this._add("clickZoom",f);var d=new Dr;this._add("tapDragZoom",d);var g=o.touchPitch=new ml;this._add("touchPitch",g);var b=new ss(i),E=new dl(i);o.dragRotate=new Cn(i,b,E),this._add("mouseRotate",b,["mousePitch"]),this._add("mousePitch",E,["mouseRotate"]);var z=new fl(i),D=new Ai(i);o.dragPan=new uo(n,z,D),this._add("mousePan",z),this._add("touchPan",D,["touchZoom","touchRotate"]);var L=new Cu,$=new li;o.touchZoomRotate=new qi(n,$,L,d),this._add("touchRotate",L,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]);var q=o.scrollZoom=new ht(o,this);this._add("scrollZoom",q,["mousePan"]);var H=o.keyboard=new Ui;this._add("keyboard",H),this._add("blockableMapEvent",new Ve(o));for(var V=0,X=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];V<X.length;V+=1){var Q=X[V];i.interactive&&i[Q]&&o[Q].enable(i[Q])}},qe.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},qe.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},qe.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},qe.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},qe.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},qe.prototype.isMoving=function(){return!!jr(this._eventsInProgress)||this.isZooming()},qe.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},qe.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},qe.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},qe.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},f={},d=i.touches?this._getMapTouches(i.touches):void 0,g=d?Y.touchPos(this._el,d):Y.mousePos(this._el,i),b=0,E=this._handlers;b<E.length;b+=1){var z=E[b],D=z.handlerName,L=z.handler,$=z.allowed;if(L.isEnabled()){var q=void 0;this._blockedByActive(f,$,D)?L.reset():L[o||i.type]&&(q=L[o||i.type](i,g,d),this.mergeHandlerResult(s,p,q,D,n),q&&q.needsRenderFrame&&this._triggerRenderFrame()),(q||L.isActive())&&(f[D]=L)}}var H={};for(var V in this._previousActiveHandlers)f[V]||(H[V]=n);this._previousActiveHandlers=f,(Object.keys(H).length||Ze(s))&&(this._changes.push([s,p,H]),this._triggerRenderFrame()),(Object.keys(f).length||Ze(s))&&this._map._stop(!0),this._updatingCamera=!1;var X=s.cameraAnimation;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},qe.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){l.extend(i,n);var f={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=f),n.panDelta!==void 0&&(o.drag=f),n.pitchDelta!==void 0&&(o.pitch=f),n.bearingDelta!==void 0&&(o.rotate=f)}},qe.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var f=p[s],d=f[0],g=f[1],b=f[2];d.panDelta&&(i.panDelta=(i.panDelta||new l.Point(0,0))._add(d.panDelta)),d.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(i.around=d.around),d.pinchAround!==void 0&&(i.pinchAround=d.pinchAround),d.noInertia&&(i.noInertia=d.noInertia),l.extend(o,g),l.extend(n,b)}this._updateMapTransform(i,o,n),this._changes=[]},qe.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!Ze(i))return this._fireEvents(o,n,!0);var f=i.panDelta,d=i.zoomDelta,g=i.bearingDelta,b=i.pitchDelta,E=i.around,z=i.pinchAround;z!==void 0&&(E=z),s._stop(!0),E=E||s.transform.centerPoint;var D=p.pointLocation(f?E.sub(f):E);g&&(p.bearing+=g),b&&(p.pitch+=b),d&&(p.zoom+=d),p.setLocationAtPoint(D,E),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},qe.prototype._fireEvents=function(i,o,n){var s=this,p=jr(this._eventsInProgress),f=jr(i),d={};for(var g in i)this._eventsInProgress[g]||(d[g+"start"]=i[g].originalEvent),this._eventsInProgress[g]=i[g];for(var b in!p&&f&&this._fireEvent("movestart",f.originalEvent),d)this._fireEvent(b,d[b]);for(var E in f&&this._fireEvent("move",f.originalEvent),i)this._fireEvent(E,i[E].originalEvent);var z,D={};for(var L in this._eventsInProgress){var $=this._eventsInProgress[L],q=$.handlerName,H=$.originalEvent;this._handlersById[q].isActive()||(delete this._eventsInProgress[L],D[L+"end"]=z=o[q]||H)}for(var V in D)this._fireEvent(V,D[V]);var X=jr(this._eventsInProgress);if(n&&(p||f)&&!X){this._updatingCamera=!0;var Q=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),re=function(pe){return pe!==0&&-s._bearingSnap<pe&&pe<s._bearingSnap};Q?(re(Q.bearing||this._map.getBearing())&&(Q.bearing=0),this._map.easeTo(Q,{originalEvent:z})):(this._map.fire(new l.Event("moveend",{originalEvent:z})),re(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},qe.prototype._fireEvent=function(i,o){this._map.fire(new l.Event(i,o?{originalEvent:o}:{}))},qe.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(o){delete i._frameId,i.handleEvent(new Ia("renderFrame",{timeStamp:o})),i._applyChanges()})},qe.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var cs=function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,l.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new l.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=l.Point.convert(n).mult(-1),this.panTo(this.transform.center,l.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(l.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(l.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(l.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,l.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(l.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=l.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,f){var d={top:0,bottom:0,right:0,left:0};if(typeof(f=l.extend({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},f)).padding=="number"){var g=f.padding;f.padding={top:g,bottom:g,right:g,left:g}}f.padding=l.extend(d,f.padding);var b=this.transform,E=b.padding,z=b.project(l.LngLat.convert(n)),D=b.project(l.LngLat.convert(s)),L=z.rotate(-p*Math.PI/180),$=D.rotate(-p*Math.PI/180),q=new l.Point(Math.max(L.x,$.x),Math.max(L.y,$.y)),H=new l.Point(Math.min(L.x,$.x),Math.min(L.y,$.y)),V=q.sub(H),X=(b.width-(E.left+E.right+f.padding.left+f.padding.right))/V.x,Q=(b.height-(E.top+E.bottom+f.padding.top+f.padding.bottom))/V.y;if(!(Q<0||X<0)){var re=Math.min(b.scaleZoom(b.scale*Math.min(X,Q)),f.maxZoom),pe=typeof f.offset.x=="number"?new l.Point(f.offset.x,f.offset.y):l.Point.convert(f.offset),ue=new l.Point((f.padding.left-f.padding.right)/2,(f.padding.top-f.padding.bottom)/2).rotate(p*Math.PI/180),he=pe.add(ue).mult(b.scale/b.zoomScale(re));return{center:b.unproject(z.add(D).div(2).sub(he)),zoom:re,bearing:p}}l.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,f,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.Point.convert(n)),this.transform.pointLocation(l.Point.convert(s)),p,f),f,d)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=l.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,f=!1,d=!1,g=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(f=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=l.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(d=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(g=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),f&&this.fire(new l.Event("zoomstart",s)).fire(new l.Event("zoom",s)).fire(new l.Event("zoomend",s)),d&&this.fire(new l.Event("rotatestart",s)).fire(new l.Event("rotate",s)).fire(new l.Event("rotateend",s)),g&&this.fire(new l.Event("pitchstart",s)).fire(new l.Event("pitch",s)).fire(new l.Event("pitchend",s)),this.fire(new l.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=l.extend({offset:[0,0],duration:500,easing:l.ease},n)).animate===!1||!n.essential&&l.browser.prefersReducedMotion)&&(n.duration=0);var f=this.transform,d=this.getZoom(),g=this.getBearing(),b=this.getPitch(),E=this.getPadding(),z="zoom"in n?+n.zoom:d,D="bearing"in n?this._normalizeBearing(n.bearing,g):g,L="pitch"in n?+n.pitch:b,$="padding"in n?n.padding:f.padding,q=l.Point.convert(n.offset),H=f.centerPoint.add(q),V=f.pointLocation(H),X=l.LngLat.convert(n.center||V);this._normalizeCenter(X);var Q,re,pe=f.project(V),ue=f.project(X).sub(pe),he=f.zoomScale(z-d);n.around&&(Q=l.LngLat.convert(n.around),re=f.locationPoint(Q));var _e={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||z!==d,this._rotating=this._rotating||g!==D,this._pitching=this._pitching||L!==b,this._padding=!f.isPaddingEqual($),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,_e),this._ease(function(Ie){if(p._zooming&&(f.zoom=l.number(d,z,Ie)),p._rotating&&(f.bearing=l.number(g,D,Ie)),p._pitching&&(f.pitch=l.number(b,L,Ie)),p._padding&&(f.interpolatePadding(E,$,Ie),H=f.centerPoint.add(q)),Q)f.setLocationAtPoint(Q,re);else{var Te=f.zoomScale(f.zoom-d),Le=z>d?Math.min(2,he):Math.max(.5,he),Ge=Math.pow(Le,1-Ie),Ke=f.unproject(pe.add(ue.mult(Ie*Ge)).mult(Te));f.setLocationAtPoint(f.renderWorldCopies?Ke.wrap():Ke,H)}p._fireMoveEvents(s)},function(Ie){p._afterEase(s,Ie)},n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new l.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new l.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new l.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new l.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new l.Event("move",n)),this._zooming&&this.fire(new l.Event("zoom",n)),this._rotating&&this.fire(new l.Event("rotate",n)),this._pitching&&this.fire(new l.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,f=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new l.Event("zoomend",n)),f&&this.fire(new l.Event("rotateend",n)),d&&this.fire(new l.Event("pitchend",n)),this.fire(new l.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&l.browser.prefersReducedMotion){var f=l.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(f,s)}this.stop(),n=l.extend({offset:[0,0],speed:1.2,curve:1.42,easing:l.ease},n);var d=this.transform,g=this.getZoom(),b=this.getBearing(),E=this.getPitch(),z=this.getPadding(),D="zoom"in n?l.clamp(+n.zoom,d.minZoom,d.maxZoom):g,L="bearing"in n?this._normalizeBearing(n.bearing,b):b,$="pitch"in n?+n.pitch:E,q="padding"in n?n.padding:d.padding,H=d.zoomScale(D-g),V=l.Point.convert(n.offset),X=d.centerPoint.add(V),Q=d.pointLocation(X),re=l.LngLat.convert(n.center||Q);this._normalizeCenter(re);var pe=d.project(Q),ue=d.project(re).sub(pe),he=n.curve,_e=Math.max(d.width,d.height),Ie=_e/H,Te=ue.mag();if("minZoom"in n){var Le=l.clamp(Math.min(n.minZoom,g,D),d.minZoom,d.maxZoom),Ge=_e/d.zoomScale(Le-g);he=Math.sqrt(Ge/Te*2)}var Ke=he*he;function He(et){var Je=(Ie*Ie-_e*_e+(et?-1:1)*Ke*Ke*Te*Te)/(2*(et?Ie:_e)*Ke*Te);return Math.log(Math.sqrt(Je*Je+1)-Je)}function xt(et){return(Math.exp(et)-Math.exp(-et))/2}function Re(et){return(Math.exp(et)+Math.exp(-et))/2}var nt=He(0),st=function(et){return Re(nt)/Re(nt+he*et)},it=function(et){return _e*((Re(nt)*(xt(Je=nt+he*et)/Re(Je))-xt(nt))/Ke)/Te;var Je},rt=(He(1)-nt)/he;if(Math.abs(Te)<1e-6||!isFinite(rt)){if(Math.abs(_e-Ie)<1e-6)return this.easeTo(n,s);var at=Ie<_e?-1:1;rt=Math.abs(Math.log(Ie/_e))/he,it=function(){return 0},st=function(et){return Math.exp(at*he*et)}}return n.duration="duration"in n?+n.duration:1e3*rt/("screenSpeed"in n?+n.screenSpeed/he:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=b!==L,this._pitching=$!==E,this._padding=!d.isPaddingEqual(q),this._prepareEase(s,!1),this._ease(function(et){var Je=et*rt,xr=1/st(Je);d.zoom=et===1?D:g+d.scaleZoom(xr),p._rotating&&(d.bearing=l.number(b,L,et)),p._pitching&&(d.pitch=l.number(E,$,et)),p._padding&&(d.interpolatePadding(z,q,et),X=d.centerPoint.add(V));var Qt=et===1?re:d.unproject(pe.add(ue.mult(it(Je))).mult(xr));d.setLocationAtPoint(d.renderWorldCopies?Qt.wrap():Qt,X),p._fireMoveEvents(s)},function(){return p._afterEase(s)},n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var f=this.handlers;f&&f.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=l.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((l.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=l.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o}(l.Evented),$r=function(i){i===void 0&&(i={}),this.options=i,l.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};$r.prototype.getDefaultPosition=function(){return"bottom-right"},$r.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=Y.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Y.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Y.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},$r.prototype.onRemove=function(){Y.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},$r.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},$r.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},$r.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||l.config.ACCESS_TOKEN}];if(i){var n=o.reduce(function(s,p,f){return p.value&&(s+=p.key+"="+p.value+(f<o.length-1?"&":"")),s},"?");i.href=l.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},$r.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},$r.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(function(g){return typeof g!="string"?"":g})):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var f=p.getSource();f.attribution&&i.indexOf(f.attribution)<0&&i.push(f.attribution)}}i.sort(function(g,b){return g.length-b.length});var d=(i=i.filter(function(g,b){for(var E=b+1;E<i.length;E++)if(i[E].indexOf(g)>=0)return!1;return!0})).join(" | ");d!==this._attribHTML&&(this._attribHTML=d,i.length?(this._innerContainer.innerHTML=d,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},$r.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ji=function(){l.bindAll(["_updateLogo"],this),l.bindAll(["_updateCompact"],this)};ji.prototype.onAdd=function(i){this._map=i,this._container=Y.create("div","mapboxgl-ctrl");var o=Y.create("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ji.prototype.onRemove=function(){Y.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ji.prototype.getDefaultPosition=function(){return"bottom-left"},ji.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},ji.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},ji.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var Lr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Lr.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},Lr.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Lr.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Lr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ki={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},vl=l.window.HTMLImageElement,ps=l.window.HTMLElement,kt=l.window.ImageBitmap,Ar={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Pu=function(i){function o(s){var p=this;if((s=l.extend({},Ar,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var f=new vt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,f,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Lr,this._controls=[],this._mapId=l.uniqueId(),this._locale=l.extend({},Ki,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new l.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=l.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof ps))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),l.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return p._update(!1)}),this.on("moveend",function(){return p._update(!1)}),this.on("zoom",function(){return p._update(!0)}),l.window!==void 0&&(l.window.addEventListener("online",this._onWindowOnline,!1),l.window.addEventListener("resize",this._onWindowResize,!1),l.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new qe(this,s),this._hash=s.hash&&new di(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,l.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new $r({customAttribution:s.customAttribution})),this.addControl(new ji,s.logoPosition),this.on("style.load",function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)}),this.on("data",function(d){p._update(d.dataType==="style"),p.fire(new l.Event(d.dataType+"data",d))}),this.on("dataloading",function(d){p.fire(new l.Event(d.dataType+"dataloading",d))})}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var f=s.onAdd(this);this._controls.push(s);var d=this._controlPositions[p];return p.indexOf("bottom")!==-1?d.insertBefore(f,d.firstChild):d.appendChild(f),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),f=p[0],d=p[1];if(f===this.transform.width&&d===this.transform.height)return this;this._resizeCanvas(f,d),this.transform.resize(f,d),this.painter.resize(f,d);var g=!this._moving;return g&&this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),this.fire(new l.Event("resize",s)),g&&this.fire(new l.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(l.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(l.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(l.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,f){var d,g=this;if(s==="mouseenter"||s==="mouseover"){var b=!1;return{layer:p,listener:f,delegates:{mousemove:function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length?b||(b=!0,f.call(g,new mr(s,g,z.originalEvent,{features:D}))):b=!1},mouseout:function(){b=!1}}}}if(s==="mouseleave"||s==="mouseout"){var E=!1;return{layer:p,listener:f,delegates:{mousemove:function(z){(g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[]).length?E=!0:E&&(E=!1,f.call(g,new mr(s,g,z.originalEvent)))},mouseout:function(z){E&&(E=!1,f.call(g,new mr(s,g,z.originalEvent)))}}}}return{layer:p,listener:f,delegates:(d={},d[s]=function(z){var D=g.getLayer(p)?g.queryRenderedFeatures(z.point,{layers:[p]}):[];D.length&&(z.features=D,f.call(g,z),delete z.features)},d)}},o.prototype.on=function(s,p,f){if(f===void 0)return i.prototype.on.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var g in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(d),d.delegates)this.on(g,d.delegates[g]);return this},o.prototype.once=function(s,p,f){if(f===void 0)return i.prototype.once.call(this,s,p);var d=this._createDelegatedListener(s,p,f);for(var g in d.delegates)this.once(g,d.delegates[g]);return this},o.prototype.off=function(s,p,f){var d=this;return f===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&function(g){for(var b=g[s],E=0;E<b.length;E++){var z=b[E];if(z.layer===p&&z.listener===f){for(var D in z.delegates)d.off(D,z.delegates[D]);return b.splice(E,1),d}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var f;if(p!==void 0||s===void 0||s instanceof l.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof l.Point||typeof s[0]=="number")f=[l.Point.convert(s)];else{var d=l.Point.convert(s[0]),g=l.Point.convert(s[1]);f=[d,new l.Point(g.x,d.y),g,new l.Point(d.x,g.y),d]}return this.style.queryRenderedFeatures(f,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=l.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new ni(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var f=this;if(typeof s=="string"){var d=this._requestManager.normalizeStyleURL(s),g=this._requestManager.transformRequest(d,l.ResourceType.Style);l.getJSON(g,function(b,E){b?f.fire(new l.ErrorEvent(b)):E&&f._updateDiff(E,p)})}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(f){l.warnOnce("Unable to perform style diff: "+(f.message||f.error||f)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():l.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new l.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var f=s[p]._tiles;for(var d in f){var g=f[d];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,f)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,f){f===void 0&&(f={});var d=f.pixelRatio;d===void 0&&(d=1);var g=f.sdf;g===void 0&&(g=!1);var b=f.stretchX,E=f.stretchY,z=f.content;if(this._lazyInitEmptyStyle(),p instanceof vl||kt&&p instanceof kt){var D=l.browser.getImageData(p);this.style.addImage(s,{data:new l.RGBAImage({width:D.width,height:D.height},D.data),pixelRatio:d,stretchX:b,stretchY:E,content:z,sdf:g,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var L=p;this.style.addImage(s,{data:new l.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:d,stretchX:b,stretchY:E,content:z,sdf:g,version:0,userImage:L}),L.onAdd&&L.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var f=this.style.getImage(s);if(!f)return this.fire(new l.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var d=p instanceof vl||kt&&p instanceof kt?l.browser.getImageData(p):p,g=d.width,b=d.height,E=d.data;return g===void 0||b===void 0?this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):g!==f.data.width||b!==f.data.height?this.fire(new l.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(f.data.replace(E,!(p instanceof vl||kt&&p instanceof kt)),void this.style.updateImage(s,f))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new l.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){l.getImage(this._requestManager.transformRequest(s,l.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,f){return this.style.setLayerZoomRange(s,p,f),this._update(!0)},o.prototype.setFilter=function(s,p,f){return f===void 0&&(f={}),this.style.setFilter(s,p,f),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setPaintProperty(s,p,f,d),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,f,d){return d===void 0&&(d={}),this.style.setLayoutProperty(s,p,f,d),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){l.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&l.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=Y.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=Y.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=Y.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var f=this._containerDimensions();this._resizeCanvas(f[0],f[1]);var d=this._controlContainer=Y.create("div","mapboxgl-control-container",s),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(b){g[b]=Y.create("div","mapboxgl-ctrl-"+b,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var f=l.browser.devicePixelRatio||1;this._canvas.width=f*s,this._canvas.height=f*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=l.extend({},ae.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Gt(p,this.transform),l.webpSupported.testSupport(p)):this.fire(new l.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new l.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,f=this,d=0,g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,p),d=l.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var b=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var E=this.transform.zoom,z=l.browser.now();this.style.zoomHistory.update(E,z);var D=new l.EvaluationParameters(E,{now:z,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),L=D.crossFadingFactor();L===1&&L===this._crossFadingFactor||(b=!0,this._crossFadingFactor=L),this.style.update(D)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new l.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new l.Event("load"))),this.style&&(this.style.hasTransitions()||b)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var $=l.browser.now()-d;g.endQueryEXT(g.TIME_ELAPSED_EXT,p),setTimeout(function(){var V=g.getQueryObjectEXT(p,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(p),f.fire(new l.Event("gpu-timing-frame",{cpuTime:$,gpuTime:V}))},50)}if(this.listens("gpu-timing-layer")){var q=this.painter.collectGpuTimers();setTimeout(function(){var V=f.painter.queryGpuTimers(q);f.fire(new l.Event("gpu-timing-layer",{layerTimes:V}))},50)}var H=this._sourcesDirty||this._styleDirty||this._placementDirty;return H||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.Event("idle")),!this._loaded||this._fullyLoaded||H||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),l.window!==void 0&&(l.window.removeEventListener("resize",this._onWindowResize,!1),l.window.removeEventListener("orientationchange",this._onWindowResize,!1),l.window.removeEventListener("online",this._onWindowOnline,!1));var f=this.painter.context.gl.getExtension("WEBGL_lose_context");f&&f.loseContext(),co(this._canvasContainer),co(this._controlContainer),co(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new l.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=l.browser.frame(function(p){s._frame=null,s._render(p)}))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){l.setCacheLimits(s,p)},n.version.get=function(){return l.version},Object.defineProperties(o.prototype,n),o}(cs);function co(i){i.parentNode&&i.parentNode.removeChild(i)}var gl={showCompass:!0,showZoom:!0,visualizePitch:!1},un=function(i){var o=this;this.options=l.extend({},gl,i),this._container=Y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this.options.showZoom&&(l.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(n){return o._map.zoomIn({},{originalEvent:n})}),Y.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(n){return o._map.zoomOut({},{originalEvent:n})}),Y.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(l.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})}),this._compassIcon=Y.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};un.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},un.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},un.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ui(this._map,this._compass,this.options.visualizePitch)),this._container},un.prototype.onRemove=function(){Y.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},un.prototype._createButton=function(i,o){var n=Y.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},un.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var ui=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ss({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new dl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),l.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Y.addEventListener(o,"mousedown",this.mousedown),Y.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),Y.addEventListener(o,"touchmove",this.touchmove),Y.addEventListener(o,"touchend",this.touchend),Y.addEventListener(o,"touchcancel",this.reset)};function No(i,o,n){if(i=new l.LngLat(i.lng,i.lat),o){var s=new l.LngLat(i.lng-360,i.lat),p=new l.LngLat(i.lng+360,i.lat),f=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<f?i=s:n.locationPoint(p).distSqr(o)<f&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var d=n.locationPoint(i);if(d.x>=0&&d.y>=0&&d.x<=n.width&&d.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}ui.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),Y.disableDrag()},ui.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},ui.prototype.off=function(){var i=this.element;Y.removeEventListener(i,"mousedown",this.mousedown),Y.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),Y.removeEventListener(i,"touchmove",this.touchmove),Y.removeEventListener(i,"touchend",this.touchend),Y.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},ui.prototype.offTemp=function(){Y.enableDrag(),Y.removeEventListener(l.window,"mousemove",this.mousemove),Y.removeEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousedown=function(i){this.down(l.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),Y.mousePos(this.element,i)),Y.addEventListener(l.window,"mousemove",this.mousemove),Y.addEventListener(l.window,"mouseup",this.mouseup)},ui.prototype.mousemove=function(i){this.move(i,Y.mousePos(this.element,i))},ui.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},ui.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Y.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},ui.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=Y.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},ui.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},ui.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Yi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function hs(i,o,n){var s=i.classList;for(var p in Yi)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var Uo,Ea=function(i){function o(n,s){if(i.call(this),(n instanceof l.window.HTMLElement||s)&&(n=l.extend({element:n},s)),l.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=l.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=Y.create("div"),this._element.setAttribute("aria-label","Map marker");var p=Y.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var f=Y.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"stroke","none"),f.setAttributeNS(null,"stroke-width","1"),f.setAttributeNS(null,"fill","none"),f.setAttributeNS(null,"fill-rule","evenodd");var d=Y.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill-rule","nonzero");var g=Y.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");for(var b=0,E=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];b<E.length;b+=1){var z=E[b],D=Y.createNS("http://www.w3.org/2000/svg","ellipse");D.setAttributeNS(null,"opacity","0.04"),D.setAttributeNS(null,"cx","10.5"),D.setAttributeNS(null,"cy","5.80029008"),D.setAttributeNS(null,"rx",z.rx),D.setAttributeNS(null,"ry",z.ry),g.appendChild(D)}var L=Y.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"fill",this._color);var $=Y.createNS("http://www.w3.org/2000/svg","path");$.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),L.appendChild($);var q=Y.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"fill","#000000");var H=Y.createNS("http://www.w3.org/2000/svg","path");H.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),q.appendChild(H);var V=Y.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");var X=Y.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Q=Y.createNS("http://www.w3.org/2000/svg","circle");Q.setAttributeNS(null,"fill","#000000"),Q.setAttributeNS(null,"opacity","0.25"),Q.setAttributeNS(null,"cx","5.5"),Q.setAttributeNS(null,"cy","5.5"),Q.setAttributeNS(null,"r","5.4999962");var re=Y.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#FFFFFF"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962"),X.appendChild(Q),X.appendChild(re),d.appendChild(g),d.appendChild(L),d.appendChild(q),d.appendChild(V),d.appendChild(X),p.appendChild(d),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=l.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(pe){pe.preventDefault()}),this._element.addEventListener("mousedown",function(pe){pe.preventDefault()}),hs(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Y.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=No(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),Y.setTransform(this._element,Yi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=l.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.Event("dragstart"))),this.fire(new l.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o}(l.Evented),_l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},qo=0,po=!1,xl=function(i){function o(n){i.call(this),this.options=l.extend({},_l,n),l.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=Y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Uo!==void 0?s(Uo):l.window.navigator.permissions!==void 0?l.window.navigator.permissions.query({name:"geolocation"}).then(function(p){s(Uo=p.state!=="denied")}):s(Uo=!!l.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),Y.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,qo=0,po=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new l.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,f=this._map.getBearing(),d=l.extend({bearing:f},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),d,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),f=s.distanceTo(p),d=Math.ceil(2*this._accuracy/f);this._circleElement.style.width=d+"px",this._circleElement.style.height=d+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&po)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",function(d){return d.preventDefault()}),this._geolocateButton=Y.create("button","mapboxgl-ctrl-geolocate",this._container),Y.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){l.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Y.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ea(this._dotElement),this._circleElement=Y.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ea({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(d){d.geolocateSource||s._watchState!=="ACTIVE_LOCK"||d.originalEvent&&d.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new l.Event("trackuserlocationend")))})},o.prototype.trigger=function(){if(!this._setup)return l.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new l.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":qo--,po=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new l.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++qo>1?(n={maximumAge:6e5,timeout:0},po=!0):(n=this.options.positionOptions,po=!1),this._geolocationWatchID=l.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else l.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o}(l.Evented),Pn={maxWidth:100,unit:"metric"},kn=function(i){this.options=l.extend({},Pn,i),l.bindAll(["_onMove","setUnit"],this)};function fs(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,f=i.unproject([0,p]),d=i.unproject([s,p]),g=f.distanceTo(d);if(n&&n.unit==="imperial"){var b=3.2808*g;b>5280?Mn(o,s,b/5280,i._getUIString("ScaleControl.Miles")):Mn(o,s,b,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Mn(o,s,g/1852,i._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Mn(o,s,g/1e3,i._getUIString("ScaleControl.Kilometers")):Mn(o,s,g,i._getUIString("ScaleControl.Meters"))}function Mn(i,o,n,s){var p,f,d,g=(p=n,(f=Math.pow(10,(""+Math.floor(p)).length-1))*(d=(d=p/f)>=10?10:d>=5?5:d>=3?3:d>=2?2:d>=1?1:function(b){var E=Math.pow(10,Math.ceil(-Math.log(b)/Math.LN10));return Math.round(b*E)/E}(d)));i.style.width=o*(g/n)+"px",i.innerHTML=g+" "+s}kn.prototype.getDefaultPosition=function(){return"bottom-left"},kn.prototype._onMove=function(){fs(this._map,this._container,this.options)},kn.prototype.onAdd=function(i){return this._map=i,this._container=Y.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},kn.prototype.onRemove=function(){Y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},kn.prototype.setUnit=function(i){this.options.unit=i,fs(this._map,this._container,this.options)};var Pi=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof l.window.HTMLElement?this._container=i.container:l.warnOnce("Full screen control 'container' must be a DOM element.")),l.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in l.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in l.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in l.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in l.window.document&&(this._fullscreenchange="MSFullscreenChange")};Pi.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=Y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",l.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Pi.prototype.onRemove=function(){Y.remove(this._controlContainer),this._map=null,l.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Pi.prototype._checkFullscreenSupport=function(){return!!(l.window.document.fullscreenEnabled||l.window.document.mozFullScreenEnabled||l.window.document.msFullscreenEnabled||l.window.document.webkitFullscreenEnabled)},Pi.prototype._setupUI=function(){var i=this._fullscreenButton=Y.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Y.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),l.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Pi.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Pi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Pi.prototype._isFullscreen=function(){return this._fullscreen},Pi.prototype._changeIcon=function(){(l.window.document.fullscreenElement||l.window.document.mozFullScreenElement||l.window.document.webkitFullscreenElement||l.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Pi.prototype._onClickFullscreen=function(){this._isFullscreen()?l.window.document.exitFullscreen?l.window.document.exitFullscreen():l.window.document.mozCancelFullScreen?l.window.document.mozCancelFullScreen():l.window.document.msExitFullscreen?l.window.document.msExitFullscreen():l.window.document.webkitCancelFullScreen&&l.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var bl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Aa=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),wl=function(i){function o(n){i.call(this),this.options=l.extend(Object.create(bl),n),l.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new l.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&Y.remove(this._content),this._container&&(Y.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(l.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=l.window.document.createDocumentFragment(),f=l.window.document.createElement("body");for(f.innerHTML=n;s=f.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Y.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=Y.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=Y.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=Y.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(D){return s._container.classList.add(D)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=No(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),f=this.options.anchor,d=function D(L){if(L){if(typeof L=="number"){var $=Math.round(Math.sqrt(.5*Math.pow(L,2)));return{center:new l.Point(0,0),top:new l.Point(0,L),"top-left":new l.Point($,$),"top-right":new l.Point(-$,$),bottom:new l.Point(0,-L),"bottom-left":new l.Point($,-$),"bottom-right":new l.Point(-$,-$),left:new l.Point(L,0),right:new l.Point(-L,0)}}if(L instanceof l.Point||Array.isArray(L)){var q=l.Point.convert(L);return{center:q,top:q,"top-left":q,"top-right":q,bottom:q,"bottom-left":q,"bottom-right":q,left:q,right:q}}return{center:l.Point.convert(L.center||[0,0]),top:l.Point.convert(L.top||[0,0]),"top-left":l.Point.convert(L["top-left"]||[0,0]),"top-right":l.Point.convert(L["top-right"]||[0,0]),bottom:l.Point.convert(L.bottom||[0,0]),"bottom-left":l.Point.convert(L["bottom-left"]||[0,0]),"bottom-right":l.Point.convert(L["bottom-right"]||[0,0]),left:l.Point.convert(L.left||[0,0]),right:l.Point.convert(L.right||[0,0])}}return D(new l.Point(0,0))}(this.options.offset);if(!f){var g,b=this._container.offsetWidth,E=this._container.offsetHeight;g=p.y+d.bottom.y<E?["top"]:p.y>this._map.transform.height-E?["bottom"]:[],p.x<b/2?g.push("left"):p.x>this._map.transform.width-b/2&&g.push("right"),f=g.length===0?"bottom":g.join("-")}var z=p.add(d[f]).round();Y.setTransform(this._container,Yi[f]+" translate("+z.x+"px,"+z.y+"px)"),hs(this._container,f,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Aa);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o}(l.Evented),ds={version:l.version,supported:ae,setRTLTextPlugin:l.setRTLTextPlugin,getRTLTextPluginStatus:l.getRTLTextPluginStatus,Map:Pu,NavigationControl:un,GeolocateControl:xl,AttributionControl:$r,ScaleControl:kn,FullscreenControl:Pi,Popup:wl,Marker:Ea,Style:ni,LngLat:l.LngLat,LngLatBounds:l.LngLatBounds,Point:l.Point,MercatorCoordinate:l.MercatorCoordinate,Evented:l.Evented,config:l.config,prewarm:function(){de().acquire(fe)},clearPrewarmedResources:function(){var i=Ue;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(fe),Ue=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return l.config.ACCESS_TOKEN},set accessToken(i){l.config.ACCESS_TOKEN=i},get baseApiUrl(){return l.config.API_URL},set baseApiUrl(i){l.config.API_URL=i},get workerCount(){return be.workerCount},set workerCount(i){be.workerCount=i},get maxParallelImageRequests(){return l.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){l.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){l.clearTileCache(i)},workerUrl:""};return ds}),O})})(Fy);var c_=Fy.exports;const Un=oe.getDefaultExportFromCjs(c_);var Ec={exports:{}},p_=f_,h_={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function f_(y){if(!y||!y.type)return null;var v=h_[y.type];if(!v)return null;if(v==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:y}]};if(v==="feature")return{type:"FeatureCollection",features:[y]};if(v==="featurecollection")return y}function _c(y){switch(y&&y.type||null){case"FeatureCollection":return y.features=y.features.reduce(function(v,S){return v.concat(_c(S))},[]),y;case"Feature":return y.geometry?_c(y.geometry).map(function(v){var S={type:"Feature",properties:JSON.parse(JSON.stringify(y.properties)),geometry:v};return y.id!==void 0&&(S.id=y.id),S}):[y];case"MultiPoint":return y.coordinates.map(function(v){return{type:"Point",coordinates:v}});case"MultiPolygon":return y.coordinates.map(function(v){return{type:"Polygon",coordinates:v}});case"MultiLineString":return y.coordinates.map(function(v){return{type:"LineString",coordinates:v}});case"GeometryCollection":return y.geometries.map(_c).reduce(function(v,S){return v.concat(S)},[]);case"Point":case"Polygon":case"LineString":return[y]}}const d_=Object.freeze(Object.defineProperty({__proto__:null,default:_c},Symbol.toStringTag,{value:"Module"})),m_=oe.getAugmentedNamespace(d_);var y_=function(v){return S(v);function S(M){return Array.isArray(M)&&M.length&&typeof M[0]=="number"?[M]:M.reduce(function(O,Z){return Array.isArray(Z)&&Array.isArray(Z[0])?O.concat(S(Z)):(O.push(Z),O)},[])}},v_=p_,xc=m_,g_=y_;xc instanceof Function||(xc=xc.default);var __=function(y){if(!y)return[];var v=xc(v_(y)),S=[];return v.features.forEach(function(M){M.geometry&&(S=S.concat(g_(M.geometry.coordinates)))}),S},Bd=Object.prototype.toString,Oy=function(v){var S=Bd.call(v),M=S==="[object Arguments]";return M||(M=S!=="[object Array]"&&v!==null&&typeof v=="object"&&typeof v.length=="number"&&v.length>=0&&Bd.call(v.callee)==="[object Function]"),M},Pp,Dd;function x_(){if(Dd)return Pp;Dd=1;var y;if(!Object.keys){var v=Object.prototype.hasOwnProperty,S=Object.prototype.toString,M=Oy,O=Object.prototype.propertyIsEnumerable,Z=!O.call({toString:null},"toString"),l=O.call(function(){},"prototype"),ae=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Y=function(le){var ge=le.constructor;return ge&&ge.prototype===le},ye={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},me=function(){if(typeof window>"u")return!1;for(var le in window)try{if(!ye["$"+le]&&v.call(window,le)&&window[le]!==null&&typeof window[le]=="object")try{Y(window[le])}catch{return!0}}catch{return!0}return!1}(),Ee=function(le){if(typeof window>"u"||!me)return Y(le);try{return Y(le)}catch{return!1}};y=function(ge){var Fe=ge!==null&&typeof ge=="object",tt=S.call(ge)==="[object Function]",Ne=M(ge),Nt=Fe&&S.call(ge)==="[object String]",Ye=[];if(!Fe&&!tt&&!Ne)throw new TypeError("Object.keys called on a non-object");var Ct=l&&tt;if(Nt&&ge.length>0&&!v.call(ge,0))for(var zt=0;zt<ge.length;++zt)Ye.push(String(zt));if(Ne&&ge.length>0)for(var At=0;At<ge.length;++At)Ye.push(String(At));else for(var rr in ge)!(Ct&&rr==="prototype")&&v.call(ge,rr)&&Ye.push(String(rr));if(Z)for(var Kt=Ee(ge),cr=0;cr<ae.length;++cr)!(Kt&&ae[cr]==="constructor")&&v.call(ge,ae[cr])&&Ye.push(ae[cr]);return Ye}}return Pp=y,Pp}var b_=Array.prototype.slice,w_=Oy,Ld=Object.keys,bc=Ld?function(v){return Ld(v)}:x_(),Rd=Object.keys;bc.shim=function(){if(Object.keys){var v=function(){var S=Object.keys(arguments);return S&&S.length===arguments.length}(1,2);v||(Object.keys=function(M){return w_(M)?Rd(b_.call(M)):Rd(M)})}else Object.keys=bc;return Object.keys||bc};var ef=bc,S_=ef,T_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",I_=Object.prototype.toString,E_=Array.prototype.concat,Fd=oe.defineDataProperty,A_=function(y){return typeof y=="function"&&I_.call(y)==="[object Function]"},Vy=oe.hasPropertyDescriptors_1(),C_=function(y,v,S,M){if(v in y){if(M===!0){if(y[v]===S)return}else if(!A_(M)||!M())return}Vy?Fd(y,v,S,!0):Fd(y,v,S)},Ny=function(y,v){var S=arguments.length>2?arguments[2]:{},M=S_(v);T_&&(M=E_.call(M,Object.getOwnPropertySymbols(v)));for(var O=0;O<M.length;O+=1)C_(y,M[O],v[M[O]],S[M[O]])};Ny.supportsDescriptors=!!Vy;var Ac=Ny,tf=typeof Map=="function"&&Map.prototype,kp=Object.getOwnPropertyDescriptor&&tf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Sc=tf&&kp&&typeof kp.get=="function"?kp.get:null,Od=tf&&Map.prototype.forEach,rf=typeof Set=="function"&&Set.prototype,Mp=Object.getOwnPropertyDescriptor&&rf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Tc=rf&&Mp&&typeof Mp.get=="function"?Mp.get:null,Vd=rf&&Set.prototype.forEach,P_=typeof WeakMap=="function"&&WeakMap.prototype,Hl=P_?WeakMap.prototype.has:null,k_=typeof WeakSet=="function"&&WeakSet.prototype,Kl=k_?WeakSet.prototype.has:null,M_=typeof WeakRef=="function"&&WeakRef.prototype,Nd=M_?WeakRef.prototype.deref:null,z_=Boolean.prototype.valueOf,B_=Object.prototype.toString,D_=Function.prototype.toString,L_=String.prototype.match,nf=String.prototype.slice,Yo=String.prototype.replace,R_=String.prototype.toUpperCase,Ud=String.prototype.toLowerCase,Uy=RegExp.prototype.test,qd=Array.prototype.concat,qn=Array.prototype.join,F_=Array.prototype.slice,jd=Math.floor,Zh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zp=Object.getOwnPropertySymbols,Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$s=typeof Symbol=="function"&&typeof Symbol.iterator=="object",hi=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$s||!0)?Symbol.toStringTag:null,qy=Object.prototype.propertyIsEnumerable,$d=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(y){return y.__proto__}:null);function Zd(y,v){if(y===1/0||y===-1/0||y!==y||y&&y>-1e3&&y<1e3||Uy.call(/e/,v))return v;var S=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof y=="number"){var M=y<0?-jd(-y):jd(y);if(M!==y){var O=String(M),Z=nf.call(v,O.length+1);return Yo.call(O,S,"$&_")+"."+Yo.call(Yo.call(Z,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yo.call(v,S,"$&_")}var Wh=oe.require$$0,Gd=Wh.custom,Wd=$y(Gd)?Gd:null,O_=function y(v,S,M,O){var Z=S||{};if(Ko(Z,"quoteStyle")&&Z.quoteStyle!=="single"&&Z.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ko(Z,"maxStringLength")&&(typeof Z.maxStringLength=="number"?Z.maxStringLength<0&&Z.maxStringLength!==1/0:Z.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Ko(Z,"customInspect")?Z.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ko(Z,"indent")&&Z.indent!==null&&Z.indent!==" "&&!(parseInt(Z.indent,10)===Z.indent&&Z.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ko(Z,"numericSeparator")&&typeof Z.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ae=Z.numericSeparator;if(typeof v>"u")return"undefined";if(v===null)return"null";if(typeof v=="boolean")return v?"true":"false";if(typeof v=="string")return Gy(v,Z);if(typeof v=="number"){if(v===0)return 1/0/v>0?"0":"-0";var Y=String(v);return ae?Zd(v,Y):Y}if(typeof v=="bigint"){var ye=String(v)+"n";return ae?Zd(v,ye):ye}var me=typeof Z.depth>"u"?5:Z.depth;if(typeof M>"u"&&(M=0),M>=me&&me>0&&typeof v=="object")return Xh(v)?"[Array]":"[Object]";var Ee=r0(Z,M);if(typeof O>"u")O=[];else if(Zy(O,v)>=0)return"[Circular]";function le(Lt,Tr,To){if(Tr&&(O=F_.call(O),O.push(Tr)),To){var ii={depth:Z.depth};return Ko(Z,"quoteStyle")&&(ii.quoteStyle=Z.quoteStyle),y(Lt,ii,M+1,O)}return y(Lt,Z,M+1,O)}if(typeof v=="function"&&!Xd(v)){var ge=W_(v),Fe=uc(v,le);return"[Function"+(ge?": "+ge:" (anonymous)")+"]"+(Fe.length>0?" { "+qn.call(Fe,", ")+" }":"")}if($y(v)){var tt=$s?Yo.call(String(v),/^(Symbol\(.*\))_[^)]*$/,"$1"):Gh.call(v);return typeof v=="object"&&!$s?Xl(tt):tt}if(Q_(v)){for(var Ne="<"+Ud.call(String(v.nodeName)),Nt=v.attributes||[],Ye=0;Ye<Nt.length;Ye++)Ne+=" "+Nt[Ye].name+"="+jy(V_(Nt[Ye].value),"double",Z);return Ne+=">",v.childNodes&&v.childNodes.length&&(Ne+="..."),Ne+="</"+Ud.call(String(v.nodeName))+">",Ne}if(Xh(v)){if(v.length===0)return"[]";var Ct=uc(v,le);return Ee&&!t0(Ct)?"["+Hh(Ct,Ee)+"]":"[ "+qn.call(Ct,", ")+" ]"}if(U_(v)){var zt=uc(v,le);return!("cause"in Error.prototype)&&"cause"in v&&!qy.call(v,"cause")?"{ ["+String(v)+"] "+qn.call(qd.call("[cause]: "+le(v.cause),zt),", ")+" }":zt.length===0?"["+String(v)+"]":"{ ["+String(v)+"] "+qn.call(zt,", ")+" }"}if(typeof v=="object"&&l){if(Wd&&typeof v[Wd]=="function"&&Wh)return Wh(v,{depth:me-M});if(l!=="symbol"&&typeof v.inspect=="function")return v.inspect()}if(X_(v)){var At=[];return Od&&Od.call(v,function(Lt,Tr){At.push(le(Tr,v,!0)+" => "+le(Lt,v))}),Hd("Map",Sc.call(v),At,Ee)}if(Y_(v)){var rr=[];return Vd&&Vd.call(v,function(Lt){rr.push(le(Lt,v))}),Hd("Set",Tc.call(v),rr,Ee)}if(H_(v))return Bp("WeakMap");if(J_(v))return Bp("WeakSet");if(K_(v))return Bp("WeakRef");if(j_(v))return Xl(le(Number(v)));if(Z_(v))return Xl(le(Zh.call(v)));if($_(v))return Xl(z_.call(v));if(q_(v))return Xl(le(String(v)));if(typeof window<"u"&&v===window)return"{ [object Window] }";if(v===oe.commonjsGlobal)return"{ [object globalThis] }";if(!N_(v)&&!Xd(v)){var Kt=uc(v,le),cr=$d?$d(v)===Object.prototype:v instanceof Object||v.constructor===Object,pr=v instanceof Object?"":"null prototype",Hr=!cr&&hi&&Object(v)===v&&hi in v?nf.call(Qo(v),8,-1):pr?"Object":"",_r=cr||typeof v.constructor!="function"?"":v.constructor.name?v.constructor.name+" ":"",_i=_r+(Hr||pr?"["+qn.call(qd.call([],Hr||[],pr||[]),": ")+"] ":"");return Kt.length===0?_i+"{}":Ee?_i+"{"+Hh(Kt,Ee)+"}":_i+"{ "+qn.call(Kt,", ")+" }"}return String(v)};function jy(y,v,S){var M=(S.quoteStyle||v)==="double"?'"':"'";return M+y+M}function V_(y){return Yo.call(String(y),/"/g,""")}function Xh(y){return Qo(y)==="[object Array]"&&(!hi||!(typeof y=="object"&&hi in y))}function N_(y){return Qo(y)==="[object Date]"&&(!hi||!(typeof y=="object"&&hi in y))}function Xd(y){return Qo(y)==="[object RegExp]"&&(!hi||!(typeof y=="object"&&hi in y))}function U_(y){return Qo(y)==="[object Error]"&&(!hi||!(typeof y=="object"&&hi in y))}function q_(y){return Qo(y)==="[object String]"&&(!hi||!(typeof y=="object"&&hi in y))}function j_(y){return Qo(y)==="[object Number]"&&(!hi||!(typeof y=="object"&&hi in y))}function $_(y){return Qo(y)==="[object Boolean]"&&(!hi||!(typeof y=="object"&&hi in y))}function $y(y){if($s)return y&&typeof y=="object"&&y instanceof Symbol;if(typeof y=="symbol")return!0;if(!y||typeof y!="object"||!Gh)return!1;try{return Gh.call(y),!0}catch{}return!1}function Z_(y){if(!y||typeof y!="object"||!Zh)return!1;try{return Zh.call(y),!0}catch{}return!1}var G_=Object.prototype.hasOwnProperty||function(y){return y in this};function Ko(y,v){return G_.call(y,v)}function Qo(y){return B_.call(y)}function W_(y){if(y.name)return y.name;var v=L_.call(D_.call(y),/^function\s*([\w$]+)/);return v?v[1]:null}function Zy(y,v){if(y.indexOf)return y.indexOf(v);for(var S=0,M=y.length;S<M;S++)if(y[S]===v)return S;return-1}function X_(y){if(!Sc||!y||typeof y!="object")return!1;try{Sc.call(y);try{Tc.call(y)}catch{return!0}return y instanceof Map}catch{}return!1}function H_(y){if(!Hl||!y||typeof y!="object")return!1;try{Hl.call(y,Hl);try{Kl.call(y,Kl)}catch{return!0}return y instanceof WeakMap}catch{}return!1}function K_(y){if(!Nd||!y||typeof y!="object")return!1;try{return Nd.call(y),!0}catch{}return!1}function Y_(y){if(!Tc||!y||typeof y!="object")return!1;try{Tc.call(y);try{Sc.call(y)}catch{return!0}return y instanceof Set}catch{}return!1}function J_(y){if(!Kl||!y||typeof y!="object")return!1;try{Kl.call(y,Kl);try{Hl.call(y,Hl)}catch{return!0}return y instanceof WeakSet}catch{}return!1}function Q_(y){return!y||typeof y!="object"?!1:typeof HTMLElement<"u"&&y instanceof HTMLElement?!0:typeof y.nodeName=="string"&&typeof y.getAttribute=="function"}function Gy(y,v){if(y.length>v.maxStringLength){var S=y.length-v.maxStringLength,M="... "+S+" more character"+(S>1?"s":"");return Gy(nf.call(y,0,v.maxStringLength),v)+M}var O=Yo.call(Yo.call(y,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,e0);return jy(O,"single",v)}function e0(y){var v=y.charCodeAt(0),S={8:"b",9:"t",10:"n",12:"f",13:"r"}[v];return S?"\\"+S:"\\x"+(v<16?"0":"")+R_.call(v.toString(16))}function Xl(y){return"Object("+y+")"}function Bp(y){return y+" { ? }"}function Hd(y,v,S,M){var O=M?Hh(S,M):qn.call(S,", ");return y+" ("+v+") {"+O+"}"}function t0(y){for(var v=0;v<y.length;v++)if(Zy(y[v],`
|
|
498
|
+
`)>=0)return!1;return!0}function r0(y,v){var S;if(y.indent===" ")S=" ";else if(typeof y.indent=="number"&&y.indent>0)S=qn.call(Array(y.indent+1)," ");else return null;return{base:S,prev:qn.call(Array(v+1),S)}}function Hh(y,v){if(y.length===0)return"";var S=`
|
|
499
|
+
`+v.prev+v.base;return S+qn.call(y,","+S)+`
|
|
500
|
+
`+v.prev}function uc(y,v){var S=Xh(y),M=[];if(S){M.length=y.length;for(var O=0;O<y.length;O++)M[O]=Ko(y,O)?v(y[O],y):""}var Z=typeof zp=="function"?zp(y):[],l;if($s){l={};for(var ae=0;ae<Z.length;ae++)l["$"+Z[ae]]=Z[ae]}for(var Y in y)Ko(y,Y)&&(S&&String(Number(Y))===Y&&Y<y.length||$s&&l["$"+Y]instanceof Symbol||(Uy.call(/[^\w$]/,Y)?M.push(v(Y,y)+": "+v(y[Y],y)):M.push(Y+": "+v(y[Y],y))));if(typeof zp=="function")for(var ye=0;ye<Z.length;ye++)qy.call(y,Z[ye])&&M.push("["+v(Z[ye])+"]: "+v(y[Z[ye]],y));return M}var Cc=function(v){return typeof v=="string"||typeof v=="symbol"},i0=function(v){if(v===null)return"Null";if(typeof v>"u")return"Undefined";if(typeof v=="function"||typeof v=="object")return"Object";if(typeof v=="number")return"Number";if(typeof v=="boolean")return"Boolean";if(typeof v=="string")return"String"},n0=i0,Ua=function(v){return typeof v=="symbol"?"Symbol":typeof v=="bigint"?"BigInt":n0(v)},Kd=oe.type,o0=O_,a0=Cc,s0=Ua,l0=function(v,S){if(s0(v)!=="Object")throw new Kd("Assertion failed: Type(O) is not Object");if(!a0(S))throw new Kd("Assertion failed: IsPropertyKey(P) is not true, got "+o0(S));return v[S]},Zs=Number.isNaN||function(v){return v!==v},u0=Zs,So=function(y){return(typeof y=="number"||typeof y=="bigint")&&!u0(y)&&y!==1/0&&y!==-1/0},Wy=oe.getIntrinsic,c0=Wy("%Math.abs%"),p0=Wy("%Math.floor%"),h0=Zs,f0=So,Pc=function(v){if(typeof v!="number"||h0(v)||!f0(v))return!1;var S=c0(v);return p0(S)===S},d0=oe.callBindExports,Xy=oe.callBound,m0=oe.getIntrinsic,Kh=m0("%ArrayBuffer%",!0),wc=Xy("ArrayBuffer.prototype.byteLength",!0),y0=Xy("Object.prototype.toString"),Yd=!!Kh&&!wc&&new Kh(0).slice,Jd=!!Yd&&d0(Yd),Gs=wc||Jd?function(v){if(!v||typeof v!="object")return!1;try{return wc?wc(v):Jd(v,0),!0}catch{return!1}}:Kh?function(v){return y0(v)==="[object ArrayBuffer]"}:function(v){return!1},v0=oe.callBound,Qd=v0("ArrayBuffer.prototype.byteLength",!0),g0=Gs,Hy=function(v){return g0(v)?Qd?Qd(v):v.byteLength:NaN},_0=oe.callBound,em=_0("SharedArrayBuffer.prototype.byteLength",!0),Yl=em?function(v){if(!v||typeof v!="object")return!1;try{return em(v),!0}catch{return!1}}:function(v){return!1},x0=oe.type,b0=Hy,w0=oe.availableTypedArrays(),S0=oe.callBound,T0=Gs,I0=Yl,E0=S0("SharedArrayBuffer.prototype.byteLength",!0),Ws=function(v){var S=I0(v);if(!T0(v)&&!S)throw new x0("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((S?E0:b0)(v)===0)try{new oe.commonjsGlobal[w0[0]](v)}catch(M){return!!M&&M.name==="TypeError"}return!1},Dp,tm;function Ky(){if(tm)return Dp;tm=1;var y=oe.type,v=oe.hasown,S=Cc,M=Ua;return Dp=function(Z,l){if(M(Z)!=="Object")throw new y("Assertion failed: `O` must be an Object");if(!S(l))throw new y("Assertion failed: `P` must be a Property Key");return v(Z,l)},Dp}var A0=oe.getIntrinsic,Yy=A0("%Array%"),C0=!Yy.isArray&&oe.callBound("Object.prototype.toString"),Jy=Yy.isArray||function(v){return C0(v)==="[object Array]"},of=Jy,Lp,rm;function Qy(){return rm||(rm=1,Lp=function(v){return v==="BIGUINT64"||v==="BIGINT64"}),Lp}var Rp,im;function P0(){return im||(im=1,Rp=function(v){return v==="UINT8"||v==="UINT8C"||v==="UINT16"||v==="UINT32"||v==="BIGUINT64"}),Rp}var Fp,nm;function k0(){if(nm)return Fp;nm=1;var y=oe.getIntrinsic,v=y("%Math.pow%");return Fp=function(M){var O=M[3]&128?-1:1,Z=(M[3]&127)<<1|M[2]>>7,l=(M[2]&127)<<16|M[1]<<8|M[0];return Z===0&&l===0?O===1?0:-0:Z===255&&l===0?O===1?1/0:-1/0:Z===255&&l!==0?NaN:(Z-=127,Z===-127?O*l*v(2,-149):O*(1+l*v(2,-23))*v(2,Z))},Fp}var Op,om;function M0(){if(om)return Op;om=1;var y=oe.getIntrinsic,v=y("%Math.pow%");return Op=function(M){var O=M[7]&128?-1:1,Z=(M[7]&127)<<4|(M[6]&240)>>4,l=(M[6]&15)*281474976710656+M[5]*1099511627776+M[4]*4294967296+M[3]*16777216+M[2]*65536+M[1]*256+M[0];return Z===0&&l===0?O*0:Z===2047&&l!==0?NaN:Z===2047&&l===0?O*(1/0):(Z-=1023,Z===-1023?O*l*5e-324:O*(1+l/4503599627370496)*v(2,Z))},Op}var Vp,am;function z0(){if(am)return Vp;am=1;var y=oe.getIntrinsic,v=y("%Math.pow%"),S=y("%Number%"),M=y("%BigInt%",!0);return Vp=function(Z,l,ae,Y){for(var ye=Y?M:S,me=ye(0),Ee=0;Ee<Z.length;Ee++)me+=ye(Z[Ee]*v(2,8*Ee));if(!ae){var le=l*8;Z[l-1]&128&&(me-=ye(v(2,le)))}return me},Vp}var Np,sm;function B0(){return sm||(sm=1,Np=function(v,S){for(var M=0;M<v.length;M+=1)if(!S(v[M],M,v))return!1;return!0}),Np}var Up,lm;function D0(){return lm||(lm=1,Up=function(v){return typeof v=="number"&&v>=0&&v<=255&&(v|0)===v}),Up}var qp,um;function L0(){if(um)return qp;um=1;var y=oe.getIntrinsic,v=oe.callBound,S=oe.range,M=oe.syntax,O=oe.type,Z=y("%BigInt%",!0),l=Ky(),ae=of,Y=Qy(),ye=P0(),me=k0(),Ee=M0(),le=z0(),ge=B0(),Fe=D0(),tt=v("Array.prototype.reverse"),Ne=v("Array.prototype.slice"),Nt=ef,Ye={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};return qp=function(zt,At,rr){if(!l(Ye,zt))throw new O("Assertion failed: `type` must be a TypedArray element type: "+Nt(Ye));if(!ae(At)||!ge(At,Fe))throw new O("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof rr!="boolean")throw new O("Assertion failed: `isLittleEndian` must be a Boolean");var Kt=Ye[zt];if(At.length!==Kt)throw new S("Assertion failed: `rawBytes` must have a length of "+Kt+" for type "+zt);var cr=Y(zt);if(cr&&!Z)throw new M("this environment does not support BigInts");return At=Ne(At,0,Kt),rr||tt(At),zt==="FLOAT32"?me(At):zt==="FLOAT64"?Ee(At):le(At,Kt,ye(zt),cr)},qp}var jp,cm;function R0(){if(cm)return jp;cm=1;var y={}.toString;return jp=Array.isArray||function(v){return y.call(v)=="[object Array]"},jp}var $p,pm;function F0(){if(pm)return $p;pm=1;var y=oe.getIntrinsic,v=y("%Array.prototype.concat%"),S=oe.callBindExports,M=oe.callBound,O=M("Array.prototype.slice"),Z=oe.requireShams$1()(),l=Z&&Symbol.isConcatSpreadable,ae=[],Y=l?S.apply(v,ae):null,ye=l?R0():null;return $p=l?function(Ee){for(var le=0;le<arguments.length;le+=1){var ge=arguments[le];if(ge&&typeof ge=="object"&&typeof ge[l]=="boolean"){ae[l]||(ae[l]=!0);var Fe=ye(ge)?O(ge):[ge];Fe[l]=!0,arguments[le]=Fe}}return Y(arguments)}:S(v,ae),$p}var kc={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}},O0=oe.type,V0=oe.callBound,N0=V0("TypedArray.prototype.buffer",!0),U0=oe.isTypedArray,Jl=N0||function(v){if(!U0(v))throw new O0("Not a Typed Array");return v.buffer},Zp,hm;function ev(){if(hm)return Zp;hm=1;var y=oe.getIntrinsic,v=y("%Uint8Array%",!0),S=y("%Uint32Array%",!0),M=Jl,O=S&&new S([305419896]),Z=O&&new v(M(O));return Zp=Z?Z[0]===120?"little":Z[0]===18?"big":Z[0]===52?"mixed":"unknown":"indeterminate",Zp}var q0=oe.getIntrinsic,j0=oe.syntax,bo=oe.type,$0=q0("%Uint8Array%",!0),Z0=oe.callBound,Gp=Z0("Array.prototype.slice"),G0=Pc,W0=Ws,X0=L0(),H0=Gs,K0=Yl,fm=F0(),dm=kc,Y0=ev(),J0=function(v,S,M,O,Z){var l=K0(v);if(!H0(v)&&!l)throw new bo("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!G0(S))throw new bo("Assertion failed: `byteIndex` must be an integer");if(typeof M!="string"||typeof dm.size["$"+M]!="number")throw new bo("Assertion failed: `type` must be a Typed Array element type");if(typeof O!="boolean")throw new bo("Assertion failed: `isTypedArray` must be a boolean");if(Z!=="SEQ-CST"&&Z!=="UNORDERED")throw new bo("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new bo("Assertion failed: `isLittleEndian` must be a boolean, if present");if(W0(v))throw new bo("Assertion failed: `arrayBuffer` is detached");if(S<0)throw new bo("Assertion failed: `byteIndex` must be non-negative");var ae=dm.size["$"+M];if(!ae)throw new bo('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');var Y;if(l)throw new j0("SharedArrayBuffer is not supported by this implementation");Y=Gp(new $0(v,S),0,ae);var ye=arguments.length>5?arguments[5]:Y0==="little",me=ye?Gp(fm([0,0,0,0,0,0,0,0],Y),-ae):Gp(fm(Y,[0,0,0,0,0,0,0,0]),0,ae);return X0(M,me,ye)},Q0=oe.getIntrinsic,ex=Q0("%Math.max%"),tx=oe.getIntrinsic,rx=tx("%Math.min%"),mm=Zs,tv=function(v,S){return v===S?v===0?1/v===1/S:!0:mm(v)&&mm(S)},cc=oe.type,ix=Cc,ym=tv,nx=Ua,vm=function(){try{return delete[].length,!0}catch{return!1}}(),ox=function(v,S,M,O){if(nx(v)!=="Object")throw new cc("Assertion failed: `O` must be an Object");if(!ix(S))throw new cc("Assertion failed: `P` must be a Property Key");if(typeof O!="boolean")throw new cc("Assertion failed: `Throw` must be a Boolean");if(O){if(v[S]=M,vm&&!ym(v[S],M))throw new cc("Attempted to assign to readonly property.");return!0}try{return v[S]=M,vm?ym(v[S],M):!0}catch{return!1}},Wp,gm;function ax(){if(gm)return Wp;gm=1;var y=oe.getIntrinsic,v=y("%BigInt%",!0),S=oe.type,M=oe.syntax;return Wp=function(Z){if(typeof Z!="string")throw new S("`argument` must be a string");if(!v)throw new M("BigInts are not supported in this environment");try{return v(Z)}catch{return}},Wp}var Xp,_m;function sx(){return _m||(_m=1,Xp=function(v){return v===null||typeof v!="function"&&typeof v!="object"}),Xp}var Hp,xm;function lx(){if(xm)return Hp;xm=1;var y=Date.prototype.getDay,v=function(l){try{return y.call(l),!0}catch{return!1}},S=Object.prototype.toString,M="[object Date]",O=oe.requireShams()();return Hp=function(l){return typeof l!="object"||l===null?!1:O?v(l):S.call(l)===M},Hp}var pc={exports:{}},bm;function ux(){if(bm)return pc.exports;bm=1;var y=Object.prototype.toString,v=oe.hasSymbols();if(v){var S=Symbol.prototype.toString,M=/^Symbol\(.*\)$/,O=function(l){return typeof l.valueOf()!="symbol"?!1:M.test(S.call(l))};pc.exports=function(l){if(typeof l=="symbol")return!0;if(y.call(l)!=="[object Symbol]")return!1;try{return O(l)}catch{return!1}}}else pc.exports=function(l){return!1};return pc.exports}var Kp,wm;function cx(){if(wm)return Kp;wm=1;var y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",v=sx(),S=oe.isCallable,M=lx(),O=ux(),Z=function(Y,ye){if(typeof Y>"u"||Y===null)throw new TypeError("Cannot call method on "+Y);if(typeof ye!="string"||ye!=="number"&&ye!=="string")throw new TypeError('hint must be "string" or "number"');var me=ye==="string"?["toString","valueOf"]:["valueOf","toString"],Ee,le,ge;for(ge=0;ge<me.length;++ge)if(Ee=Y[me[ge]],S(Ee)&&(le=Ee.call(Y),v(le)))return le;throw new TypeError("No default value")},l=function(Y,ye){var me=Y[ye];if(me!==null&&typeof me<"u"){if(!S(me))throw new TypeError(me+" returned for property "+ye+" of object "+Y+" is not a function");return me}};return Kp=function(Y){if(v(Y))return Y;var ye="default";arguments.length>1&&(arguments[1]===String?ye="string":arguments[1]===Number&&(ye="number"));var me;if(y&&(Symbol.toPrimitive?me=l(Y,Symbol.toPrimitive):O(Y)&&(me=Symbol.prototype.valueOf)),typeof me<"u"){var Ee=me.call(Y,ye);if(v(Ee))return Ee;throw new TypeError("unable to convert exotic object to primitive")}return ye==="default"&&(M(Y)||O(Y))&&(ye="string"),Z(Y,ye==="default"?"number":ye)},Kp}var Yp,Sm;function rv(){if(Sm)return Yp;Sm=1;var y=cx();return Yp=function(S){return arguments.length>1?y(S,arguments[1]):y(S)},Yp}var Jp,Tm;function iv(){if(Tm)return Jp;Tm=1;var y=oe.getIntrinsic,v=y("%BigInt%",!0),S=y("%Number%"),M=oe.type,O=oe.syntax,Z=ax(),l=rv();return Jp=function(Y){if(!v)throw new O("BigInts are not supported in this environment");var ye=l(Y,S);if(ye==null)throw new M("Cannot convert null or undefined to a BigInt");if(typeof ye=="boolean")return v(ye?1:0);if(typeof ye=="number")throw new M("Cannot convert a Number value to a BigInt");if(typeof ye=="string"){var me=Z(ye);if(typeof me>"u")throw new M("Failed to parse String to BigInt");return me}if(typeof ye=="symbol")throw new M("Cannot convert a Symbol value to a BigInt");if(typeof ye!="bigint")throw new O("Assertion failed: unknown primitive type");return ye},Jp}var Qp,Im;function nv(){if(Im)return Qp;Im=1;var y=oe.getIntrinsic,v=y("%BigInt%",!0),S=oe.range,M=oe.type,O=v&&v(0);return Qp=function(l,ae){if(typeof l!="bigint"||typeof ae!="bigint")throw new M("Assertion failed: `n` and `d` arguments must be BigInts");if(ae===O)throw new S("Division by zero");return l===O?O:l%ae},Qp}var eh,Em;function ov(){return Em||(Em=1,eh=function(v,S,M){var O=v(S,M);return O>=0?O:O+M}),eh}var th,Am;function px(){if(Am)return th;Am=1;var y=oe.getIntrinsic,v=y("%BigInt%",!0),S=y("%Math.pow%"),M=iv(),O=nv(),Z=ov(),l=v&&BigInt(S(2,32))*BigInt(S(2,31)),ae=v&&BigInt(S(2,32))*BigInt(S(2,32));return th=function(ye){var me=M(ye),Ee=Z(O,me,ae);return Ee>=l?Ee-ae:Ee},th}var rh,Cm;function hx(){if(Cm)return rh;Cm=1;var y=oe.getIntrinsic,v=y("%BigInt%",!0),S=y("%Math.pow%"),M=iv(),O=nv(),Z=ov(),l=v&&BigInt(S(2,32))*BigInt(S(2,32));return rh=function(Y){var ye=M(Y),me=Z(O,ye,l);return me},rh}var ih,Pm;function fx(){if(Pm)return ih;Pm=1;var y=Math.floor;return ih=function(S,M){var O=S%M;return y(O>=0?O:O+M)},ih}var nh,km;function Xs(){if(km)return nh;km=1;var y=fx();return nh=function(S,M){return y(S,M)},nh}var oh,Mm;function dx(){return Mm||(Mm=1,oh=function(v){return v===null||typeof v!="function"&&typeof v!="object"}),oh}var ah,zm;function mx(){if(zm)return ah;zm=1;var y=oe.callBound,v=oe.requireShams()(),S,M,O,Z;if(v){S=y("Object.prototype.hasOwnProperty"),M=y("RegExp.prototype.exec"),O={};var l=function(){throw O};Z={toString:l,valueOf:l},typeof Symbol.toPrimitive=="symbol"&&(Z[Symbol.toPrimitive]=l)}var ae=y("Object.prototype.toString"),Y=Object.getOwnPropertyDescriptor,ye="[object RegExp]";return ah=v?function(Ee){if(!Ee||typeof Ee!="object")return!1;var le=Y(Ee,"lastIndex"),ge=le&&S(le,"value");if(!ge)return!1;try{M(Ee,Z)}catch(Fe){return Fe===O}}:function(Ee){return!Ee||typeof Ee!="object"&&typeof Ee!="function"?!1:ae(Ee)===ye},ah}var sh,Bm;function yx(){if(Bm)return sh;Bm=1;var y=oe.callBound,v=mx(),S=y("RegExp.prototype.exec"),M=oe.type;return sh=function(Z){if(!v(Z))throw new M("`regex` must be a RegExp");return function(ae){return S(Z,ae)!==null}},sh}var lh,Dm;function av(){if(Dm)return lh;Dm=1;var y=oe.type;return lh=function(S){if(S==null)throw new y(arguments.length>0&&arguments[1]||"Cannot call method on "+S);return S},lh}var vx=oe.getIntrinsic,gx=vx("%String%"),_x=oe.type,sv=function(v){if(typeof v=="symbol")throw new _x("Cannot convert a Symbol value to a string");return gx(v)},uh,Lm;function lv(){if(Lm)return uh;Lm=1;var y=av(),v=sv,S=oe.callBound,M=S("String.prototype.replace"),O=/^\s$/.test(""),Z=O?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=O?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return uh=function(){var Y=v(y(this));return M(M(Y,Z,""),l,"")},uh}var ch,Rm;function uv(){if(Rm)return ch;Rm=1;var y=lv(),v="",S="";return ch=function(){return String.prototype.trim&&v.trim()===v&&S.trim()===S&&("_"+S).trim()==="_"+S&&(S+"_").trim()===S+"_"?String.prototype.trim:y},ch}var ph,Fm;function xx(){if(Fm)return ph;Fm=1;var y=Ac,v=uv();return ph=function(){var M=v();return y(String.prototype,{trim:M},{trim:function(){return String.prototype.trim!==M}}),M},ph}var hh,Om;function bx(){if(Om)return hh;Om=1;var y=oe.callBindExports,v=Ac,S=av(),M=lv(),O=uv(),Z=xx(),l=y(O()),ae=function(ye){return S(ye),l(ye)};return v(ae,{getPolyfill:O,implementation:M,shim:Z}),hh=ae,hh}var fh,Vm;function wx(){if(Vm)return fh;Vm=1;var y=oe.getIntrinsic,v=y("%Number%"),S=y("%RegExp%"),M=oe.type,O=y("%parseInt%"),Z=oe.callBound,l=yx(),ae=Z("String.prototype.slice"),Y=l(/^0b[01]+$/i),ye=l(/^0o[0-7]+$/i),me=l(/^[-+]0x[0-9a-f]+$/i),Ee=["
","",""].join(""),le=new S("["+Ee+"]","g"),ge=l(le),Fe=bx();return fh=function tt(Ne){if(typeof Ne!="string")throw new M("Assertion failed: `argument` is not a String");if(Y(Ne))return v(O(ae(Ne,2),2));if(ye(Ne))return v(O(ae(Ne,2),8));if(ge(Ne)||me(Ne))return NaN;var Nt=Fe(Ne);return Nt!==Ne?tt(Nt):v(Ne)},fh}var Sx=oe.getIntrinsic,Nm=oe.type,Um=Sx("%Number%"),Tx=dx(),Ix=rv(),Ex=wx(),ea=function(v){var S=Tx(v)?v:Ix(v,Um);if(typeof S=="symbol")throw new Nm("Cannot convert a Symbol value to a number");if(typeof S=="bigint")throw new Nm("Conversion from 'BigInt' to 'number' is not allowed.");return typeof S=="string"?Ex(S):Um(S)},Ax=Math.floor,af=function(v){return typeof v=="bigint"?v:Ax(v)},qm=af,Cx=oe.type,qa=function(v){if(typeof v!="number"&&typeof v!="bigint")throw new Cx("argument must be a Number or a BigInt");var S=v<0?-qm(-v):qm(v);return S===0?0:S},dh,jm;function Px(){if(jm)return dh;jm=1;var y=Xs(),v=ea,S=qa,M=So,O=65536;return dh=function(l){var ae=v(l);if(!M(ae)||ae===0)return 0;var Y=S(ae),ye=y(Y,O);return ye>=32768?ye-O:ye},dh}var mh,$m;function kx(){if($m)return mh;$m=1;var y=Xs(),v=ea,S=qa,M=So,O=2147483648,Z=4294967296;return mh=function(ae){var Y=v(ae);if(!M(Y)||Y===0)return 0;var ye=S(Y),me=y(ye,Z),Ee=me>=O?me-Z:me;return Ee===0?0:Ee},mh}var yh,Zm;function Mx(){if(Zm)return yh;Zm=1;var y=Xs(),v=ea,S=qa,M=So;return yh=function(Z){var l=v(Z);if(!M(l)||l===0)return 0;var ae=S(l),Y=y(ae,256);return Y>=128?Y-256:Y},yh}var vh,Gm;function zx(){if(Gm)return vh;Gm=1;var y=Xs(),v=ea,S=qa,M=So,O=65536;return vh=function(l){var ae=v(l);if(!M(ae)||ae===0)return 0;var Y=S(ae),ye=y(Y,O);return ye===0?0:ye},vh}var gh,Wm;function Bx(){if(Wm)return gh;Wm=1;var y=Xs(),v=ea,S=qa,M=So,O=4294967296;return gh=function(l){var ae=v(l);if(!M(ae)||ae===0)return 0;var Y=S(ae),ye=y(Y,O);return ye===0?0:ye},gh}var _h,Xm;function Dx(){if(Xm)return _h;Xm=1;var y=So,v=Xs(),S=ea,M=qa;return _h=function(Z){var l=S(Z);if(!y(l)||l===0)return 0;var ae=M(l),Y=v(ae,256);return Y},_h}var xh,Hm;function Lx(){if(Hm)return xh;Hm=1;var y=oe.getIntrinsic,v=oe.type,S=y("%Math.max%"),M=y("%Math.min%");return xh=function(Z,l,ae){if(typeof Z!="number"||typeof l!="number"||typeof ae!="number"||!(l<=ae))throw new v("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return M(S(l,Z),ae)},xh}var bh,Km;function Rx(){if(Km)return bh;Km=1;var y=Lx(),v=ea,S=af,M=Zs;return bh=function(Z){var l=v(Z);if(M(l))return 0;var ae=y(l,0,255),Y=S(ae);return ae<Y+.5?Y:ae>Y+.5?Y+1:Y%2===0?Y:Y+1},bh}var wh,Ym;function cv(){return Ym||(Ym=1,wh=function(v){return v===0&&1/v===-1/0}),wh}var Sh,Jm;function Fx(){if(Jm)return Sh;Jm=1;var y=oe.getIntrinsic,v=y("%Math.abs%"),S=y("%Math.floor%"),M=y("%Math.pow%"),O=So,Z=Zs,l=cv(),ae=34028234663852886e22;return Sh=function(ye,me){if(Z(ye))return me?[0,0,192,127]:[127,192,0,0];var Ee;if(ye===0)return Ee=l(ye)?128:0,me?[0,0,0,Ee]:[Ee,0,0,0];if(v(ye)>ae||!O(ye))return Ee=ye<0?255:127,me?[0,0,128,Ee]:[Ee,128,0,0];var le=ye<0?1:0;ye=v(ye);for(var ge=0;ye>=2;)ge+=1,ye/=2;for(;ye<1;)ge-=1,ye*=2;var Fe=ye-1;Fe*=M(2,23)+.5,Fe=S(Fe),ge+=127,ge<<=23;var tt=le<<31|ge|Fe,Ne=tt&255;tt>>=8;var Nt=tt&255;tt>>=8;var Ye=tt&255;tt>>=8;var Ct=tt&255;return me?[Ne,Nt,Ye,Ct]:[Ct,Ye,Nt,Ne]},Sh}var Th,Qm;function Ox(){if(Qm)return Th;Qm=1;var y=1075,v=54;return Th=function(M){var O="";if(M===0)return O;for(var Z=y,l,ae=0;ae<y;ae+=1)if(l=M*2,l>=1?(M=l-1,O+="1",Z===y&&(Z=ae)):(M=l,O+="0"),l===1||ae-Z>v)return O;return O},Th}var Ih,ey;function Vx(){if(ey)return Ih;ey=1;var y=oe.getIntrinsic,v=y("%Math.floor%");return Ih=function(M){for(var O="",Z;M>0;)Z=M/2,M=v(Z),Z===M?O="0"+O:O="1"+O;return O},Ih}var Eh,ty;function Nx(){if(ty)return Eh;ty=1;var y=oe.getIntrinsic,v=y("%parseInt%"),S=y("%Math.abs%"),M=y("%Math.floor%"),O=oe.callBound,Z=O("String.prototype.indexOf"),l=O("String.prototype.slice"),ae=Ox(),Y=Vx(),ye=cv(),me=1023,Ee="11111111111",le="00000000000",ge=le+le+le+le+"0000000";return Eh=function(tt,Ne){var Nt=tt<0||ye(tt)?"1":"0",Ye,Ct;if(isNaN(tt))Ye=Ee,Ct="1"+ge;else if(!isFinite(tt))Ye=Ee,Ct="0"+ge;else if(tt===0)Ye=le,Ct="0"+ge;else{tt=S(tt);var zt=M(tt),At=Y(zt),rr=ae(tt-zt),Kt;if(At)Ye=At.length-1;else{var cr=Z(rr,"1");cr>-1&&(Kt=cr+1),Ye=-Kt}Ct=At+rr,Ye<0?(Ye<=-me&&(Kt=me-1),Ct=l(Ct,Kt)):Ct=l(Ct,1),Ye=l(le+Y(Ye+me),-11),Ct=l(Ct+ge+"0",0,52)}for(var pr=Nt+Ye+Ct,Hr=[],_r=0;_r<8;_r++){var _i=Ne?8-_r-1:_r;Hr[_i]=v(l(pr,_r*8,(_r+1)*8),2)}return Hr},Eh}var Ah,ry;function Ux(){if(ry)return Ah;ry=1;var y=oe.getIntrinsic,v=y("%Number%"),S=y("%BigInt%",!0);return Ah=function(O,Z,l){var ae=typeof O=="bigint"?S:v;O<0&&(O>>>=0);for(var Y=[],ye=0;ye<Z;ye++)Y[l?ye:Z-1-ye]=v(O&ae(255)),O>>=ae(8);return Y},Ah}var Ch,iy;function qx(){if(iy)return Ch;iy=1;var y=oe.type,v=Ky(),S=px(),M=hx(),O=Px(),Z=kx(),l=Mx(),ae=zx(),Y=Bx(),ye=Dx(),me=Rx(),Ee=Fx(),le=Nx(),ge=Ux(),Fe=ef,tt={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},Ne={__proto__:null,INT8:l,UINT8:ye,UINT8C:me,INT16:O,UINT16:ae,INT32:Z,UINT32:Y,BIGINT64:S,BIGUINT64:M};return Ch=function(Ye,Ct,zt){if(typeof Ye!="string"||!v(tt,Ye))throw new y("Assertion failed: `type` must be a TypedArray element type: "+Fe(tt));if(typeof Ct!="number"&&typeof Ct!="bigint")throw new y("Assertion failed: `value` must be a Number or a BigInt");if(typeof zt!="boolean")throw new y("Assertion failed: `isLittleEndian` must be a Boolean");if(Ye==="FLOAT32")return Ee(Ct,zt);if(Ye==="FLOAT64")return le(Ct,zt);var At=tt[Ye],rr=Ne[Ye],Kt=rr(Ct);return ge(Kt,At,zt)},Ch}var Ph,ny;function jx(){return ny||(ny=1,Ph=function(v,S){for(var M=0;M<v.length;M+=1)S(v[M],M,v)}),Ph}var $x=oe.getIntrinsic,Zx=oe.syntax,wo=oe.type,Gx=$x("%Uint8Array%",!0),Wx=Pc,Xx=Qy(),Hx=Ws,Kx=qx(),Yx=Gs,Jx=Yl,Qx=oe.hasown,oy=kc,e1=ev(),t1=jx(),r1=function(v,S,M,O,Z,l){var ae=Jx(v);if(!Yx(v)&&!ae)throw new wo("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!Wx(S)||S<0)throw new wo("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof M!="string"||!Qx(oy.size,"$"+M))throw new wo("Assertion failed: `type` must be a Typed Array Element Type");if(typeof O!="number"&&typeof O!="bigint")throw new wo("Assertion failed: `value` must be a Number or a BigInt");if(typeof Z!="boolean")throw new wo("Assertion failed: `isTypedArray` must be a boolean");if(l!=="SEQ-CST"&&l!=="UNORDERED"&&l!=="INIT")throw new wo('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new wo("Assertion failed: `isLittleEndian` must be a boolean, if present");if(Hx(v))throw new wo("Assertion failed: ArrayBuffer is detached");if(Xx(M)?typeof O!="bigint":typeof O!="number")throw new wo("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var Y=oy.size["$"+M],ye=arguments.length>6?arguments[6]:e1==="little",me=Kx(M,O,ye);if(ae)throw new Zx("SharedArrayBuffer is not supported by this implementation");var Ee=new Gx(v,S,Y);t1(me,function(le,ge){Ee[ge]=le})},i1=ea,n1=qa,o1=Zs,a1=So,s1=function(v){var S=i1(v);return o1(S)||S===0?0:a1(S)?n1(S):S},l1=oe.syntax,u1=oe.type,c1=Pc,p1=oe.whichTypedArray,ay=kc,sf=function(v){var S=p1(v);if(S===!1)throw new u1("Assertion failed: `O` must be a TypedArray");var M=ay.size["$"+ay.name["$"+S]];if(!c1(M)||M<0)throw new l1("Assertion failed: Unknown TypedArray type `"+S+"`");return M},h1=oe.syntax,f1=oe.type,d1=oe.whichTypedArray,m1=kc,y1=function(v){var S=d1(v);if(S===!1)throw new f1("Assertion failed: `O` must be a TypedArray");var M=m1.name["$"+S];if(typeof M!="string")throw new h1("Assertion failed: Unknown TypedArray type `"+S+"`");return M},Yh={exports:{}},v1=oe.getIntrinsic,kh,sy;function lf(){if(sy)return kh;sy=1;var y=oe.type,v=oe.hasown,S={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return kh=function(O){if(!O||typeof O!="object")return!1;for(var Z in O)if(v(O,Z)&&!S[Z])return!1;var l=v(O,"[[Value]]")||v(O,"[[Writable]]"),ae=v(O,"[[Get]]")||v(O,"[[Set]]");if(l&&ae)throw new y("Property Descriptors may not be both accessor and data descriptors");return!0},kh}var Mh,ly;function g1(){if(ly)return Mh;ly=1;var y=oe.hasPropertyDescriptors_1,v=oe.requireEsDefineProperty(),S=y.hasArrayLengthDefineBug(),M=S&&Jy,O=oe.callBound,Z=O("Object.prototype.propertyIsEnumerable");return Mh=function(ae,Y,ye,me,Ee,le){if(!v){if(!ae(le)||!le["[[Configurable]]"]||!le["[[Writable]]"]||Ee in me&&Z(me,Ee)!==!!le["[[Enumerable]]"])return!1;var ge=le["[[Value]]"];return me[Ee]=ge,Y(me[Ee],ge)}return S&&Ee==="length"&&"[[Value]]"in le&&M(me)&&me.length!==le["[[Value]]"]?(me.length=le["[[Value]]"],me.length===le["[[Value]]"]):(v(me,Ee,ye(le)),!0)},Mh}var zh,uy;function _1(){return uy||(uy=1,zh=function(v){if(typeof v>"u")return v;var S={};return"[[Value]]"in v&&(S.value=v["[[Value]]"]),"[[Writable]]"in v&&(S.writable=!!v["[[Writable]]"]),"[[Get]]"in v&&(S.get=v["[[Get]]"]),"[[Set]]"in v&&(S.set=v["[[Set]]"]),"[[Enumerable]]"in v&&(S.enumerable=!!v["[[Enumerable]]"]),"[[Configurable]]"in v&&(S.configurable=!!v["[[Configurable]]"]),S}),zh}var Bh,cy;function x1(){if(cy)return Bh;cy=1;var y=oe.type,v=lf(),S=_1();return Bh=function(O){if(typeof O<"u"&&!v(O))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return S(O)},Bh}var Dh,py;function b1(){if(py)return Dh;py=1;var y=oe.type,v=oe.hasown,S=lf();return Dh=function(O){if(typeof O>"u")return!1;if(!S(O))throw new y("Assertion failed: `Desc` must be a Property Descriptor");return!(!v(O,"[[Value]]")&&!v(O,"[[Writable]]"))},Dh}var Lh,hy;function w1(){return hy||(hy=1,Lh=function(v){return!!v}),Lh}var Rh,fy;function S1(){return fy||(fy=1,Rh=oe.isCallable),Rh}var Fh,dy;function T1(){if(dy)return Fh;dy=1;var y=oe.hasown,v=oe.type,S=Ua,M=w1(),O=S1();return Fh=function(l){if(S(l)!=="Object")throw new v("ToPropertyDescriptor requires an object");var ae={};if(y(l,"enumerable")&&(ae["[[Enumerable]]"]=M(l.enumerable)),y(l,"configurable")&&(ae["[[Configurable]]"]=M(l.configurable)),y(l,"value")&&(ae["[[Value]]"]=l.value),y(l,"writable")&&(ae["[[Writable]]"]=M(l.writable)),y(l,"get")){var Y=l.get;if(typeof Y<"u"&&!O(Y))throw new v("getter must be a function");ae["[[Get]]"]=Y}if(y(l,"set")){var ye=l.set;if(typeof ye<"u"&&!O(ye))throw new v("setter must be a function");ae["[[Set]]"]=ye}if((y(ae,"[[Get]]")||y(ae,"[[Set]]"))&&(y(ae,"[[Value]]")||y(ae,"[[Writable]]")))throw new v("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return ae},Fh}var Oh,my;function I1(){if(my)return Oh;my=1;var y=oe.type,v=lf(),S=g1(),M=x1(),O=b1(),Z=Cc,l=tv,ae=T1(),Y=Ua;return Oh=function(me,Ee,le){if(Y(me)!=="Object")throw new y("Assertion failed: Type(O) is not Object");if(!Z(Ee))throw new y("Assertion failed: IsPropertyKey(P) is not true");var ge=v(le)?le:ae(le);if(!v(ge))throw new y("Assertion failed: Desc is not a valid Property Descriptor");return S(O,l,M,me,Ee,ge)},Oh}var E1=v1,yy=E1("%Reflect.construct%",!0),Ic=I1();try{Ic({},"",{"[[Get]]":function(){}})}catch{Ic=null}if(Ic&&yy){var vy={},gy={};Ic(gy,"length",{"[[Get]]":function(){throw vy},"[[Enumerable]]":!0}),Yh.exports=function(v){try{yy(v,gy)}catch(S){return S===vy}}}else Yh.exports=function(v){return typeof v=="function"&&!!v.prototype};var pv=Yh.exports,A1=oe.getIntrinsic,_y=A1("%Symbol.species%",!0),Vh=oe.type,C1=pv,xy=Ua,P1=function(v,S){if(xy(v)!=="Object")throw new Vh("Assertion failed: Type(O) is not Object");var M=v.constructor;if(typeof M>"u")return S;if(xy(M)!=="Object")throw new Vh("O.constructor is not an Object");var O=_y?M[_y]:void 0;if(O==null)return S;if(C1(O))return O;throw new Vh("no constructor found")},by=oe.hasown,k1=oe.isTypedArray,M1=Pc,hv=function(v){return!!v&&typeof v=="object"&&by(v,"[[Object]]")&&by(v,"[[CachedBufferByteLength]]")&&(M1(v["[[CachedBufferByteLength]]"])&&v["[[CachedBufferByteLength]]"]>=0||v["[[CachedBufferByteLength]]"]==="DETACHED")&&k1(v["[[Object]]"])},fv=oe.forEach_1,z1=oe.callBindExports,B1=oe.availableTypedArrays(),Jh={},D1=oe.hasProto(),hc=oe.gopd,wy=Object.defineProperty;if(hc){var L1=function(y){return y.byteOffset};fv(B1,function(y){if(typeof oe.commonjsGlobal[y]=="function"||typeof oe.commonjsGlobal[y]=="object"){var v=oe.commonjsGlobal[y].prototype,S=hc(v,"byteOffset");if(!S&&D1){var M=v.__proto__;S=hc(M,"byteOffset")}if(S&&S.get)Jh[y]=z1(S.get);else if(wy){var O=new oe.commonjsGlobal[y](2);S=hc(O,"byteOffset"),S&&S.configurable&&wy(O,"length",{value:3}),O.length===2&&(Jh[y]=L1)}}})}var R1=function(v){var S;return fv(Jh,function(M){if(typeof S!="number")try{var O=M(v);typeof O=="number"&&(S=O)}catch{}}),S},F1=oe.isTypedArray,uf=function(v){return F1(v)?R1(v):!1},O1=oe.callBindExports,dv=oe.forEach_1,fc=oe.gopd,V1=oe.hasProto(),N1=oe.isTypedArray,U1=oe.possibleTypedArrayNames,Qh={__proto__:null},Sy=Object.defineProperty;if(fc){var q1=function(y){return y.length};dv(U1,function(y){var v=oe.commonjsGlobal[y];if(typeof v=="function"||typeof v=="object"){var S=v.prototype,M=fc(S,"length");if(!M&&V1){var O=S.__proto__;M=fc(O,"length")}if(M&&M.get)Qh["$"+y]=O1(M.get);else if(Sy){var Z=new oe.commonjsGlobal[y](2);M=fc(Z,"length"),M&&M.configurable&&Sy(Z,"length",{value:3}),Z.length===2&&(Qh["$"+y]=q1)}}})}var j1=function(v){var S;return dv(Qh,function(M){if(typeof S!="number")try{var O=M(v);typeof O=="number"&&(S=O)}catch{}}),S},mv=function(v){return N1(v)?j1(v):!1},Ty=oe.type,$1=Ws,Z1=sf,G1=hv,W1=Jl,X1=uf,H1=mv,cf=function(v){if(!G1(v))throw new Ty("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var S=v["[[Object]]"],M=v["[[CachedBufferByteLength]]"];if($1(W1(S))&&M!=="DETACHED")throw new Ty("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(M==="DETACHED")return!0;var O=X1(S),Z,l=H1(S);if(l==="AUTO")Z=M;else{var ae=Z1(S);Z=O+l*ae}return O>M||Z>M},K1=oe.type,yv=oe.callBound,Iy=yv("%ArrayBuffer.prototype.resizable%",!0),Ey=yv("%SharedArrayBuffer.prototype.growable%",!0),Y1=Gs,J1=Yl,Q1=function(v){var S=Y1(v),M=J1(v);if(!S&&!M)throw new K1("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return S&&Iy?!Iy(v):M&&Ey?!Ey(v):!0},dc=oe.type,eb=af,tb=Q1,rb=cf,ib=sf,nb=hv,ob=Jl,ab=uf,sb=mv,lb=function(v){if(!nb(v))throw new dc("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(rb(v))throw new dc("Assertion failed: `taRecord` is out of bounds");var S=v["[[Object]]"],M=sb(S);if(M!=="AUTO")return M;if(tb(ob(S)))throw new dc("Assertion failed: array buffer is not fixed length");var O=ab(S),Z=ib(S),l=v["[[CachedBufferByteLength]]"];if(l==="DETACHED")throw new dc("Assertion failed: typed array is detached");return eb((l-O)/Z)},Nh=oe.type,ub=Ws,cb=Gs,pb=Yl,hb=Hy,fb=function(v,S){var M=pb(v);if(!cb(v)&&!M)throw new Nh("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(S!=="SEQ-CST"&&S!=="UNORDERED")throw new Nh("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(ub(v))throw new Nh("Assertion failed: `arrayBuffer` must not be detached");return hb(v)},Ay=oe.type,db=fb,mb=Ws,yb=oe.isTypedArray,vb=Jl,gb=function(v,S){if(!yb(v))throw new Ay("Assertion failed: `obj` must be a Typed Array");if(S!=="SEQ-CST"&&S!=="UNORDERED")throw new Ay("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var M=vb(v),O=mb(M)?"DETACHED":db(M,S);return{"[[Object]]":v,"[[CachedBufferByteLength]]":O}},mc=oe.type,_b=cf,xb=gb,bb=Ua,wb=oe.isTypedArray,vv=function(v,S){if(S!=="SEQ-CST"&&S!=="UNORDERED")throw new mc("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(bb(v)!=="Object")throw new mc("Assertion failed: `O` must be an Object");if(!wb(v))throw new mc("Assertion failed: `O` must be a Typed Array");var M=xb(v,S);if(_b(M))throw new mc("`O` must be in-bounds and backed by a non-detached buffer");return M},Sb=oe.syntax,yc=oe.type,Tb=of,Ib=pv,Eb=cf,Ab=lb,Cb=vv,Pb=oe.availableTypedArrays(),kb=function(v,S){if(!Ib(v))throw new yc("Assertion failed: `constructor` must be a constructor");if(!Tb(S))throw new yc("Assertion failed: `argumentList` must be a List");if(Pb.length===0)throw new Sb("Assertion failed: Typed Arrays are not supported in this environment");var M;S.length===0?M=new v:S.length===1?M=new v(S[0]):S.length===2?M=new v(S[0],S[1]):M=new v(S[0],S[1],S[2]);var O=Cb(M,"SEQ-CST");if(S.length===1&&typeof S[0]=="number"){if(Eb(O))throw new yc("new Typed Array is out of bounds");var Z=Ab(O);if(Z<S[0])throw new yc("`argumentList[0]` must be <= `newTypedArray.length`")}return M},dn=oe.getIntrinsic,Mb={__proto__:null,$Int8Array:dn("%Int8Array%",!0),$Uint8Array:dn("%Uint8Array%",!0),$Uint8ClampedArray:dn("%Uint8ClampedArray%",!0),$Int16Array:dn("%Int16Array%",!0),$Uint16Array:dn("%Uint16Array%",!0),$Int32Array:dn("%Int32Array%",!0),$Uint32Array:dn("%Uint32Array%",!0),$BigInt64Array:dn("%BigInt64Array%",!0),$BigUint64Array:dn("%BigUint64Array%",!0),$Float32Array:dn("%Float32Array%",!0),$Float64Array:dn("%Float64Array%",!0)},zb=function(v){return Mb["$"+v]},Cy=oe.syntax,Py=oe.type,Bb=oe.whichTypedArray,Db=oe.availableTypedArrays(),Lb=of,Rb=P1,Fb=kb,Ob=zb,Vb=function(v,S){if(Db.length===0)throw new Cy("Assertion failed: Typed Arrays are not supported in this environment");var M=Bb(v);if(!M)throw new Py("Assertion failed: exemplar must be a TypedArray");if(!Lb(S))throw new Py("Assertion failed: `argumentList` must be a List");var O=Ob(M);if(typeof O!="function")throw new Cy("Assertion failed: `constructor` of `exemplar` ("+M+") must exist. Please report this!");var Z=Rb(v,O);return Fb(Z,S)},Nb=oe.type,Ub=l0,qb=J0,jb=Ws,Uh=ex,ky=rx,$b=ox,Zb=r1,My=s1,zy=sv,Gb=sf,By=y1,Wb=Vb,Xb=vv,qh=Jl,Dy=uf,gv=function(v,S){var M=this;Xb(M,"SEQ-CST");var O=M.length,Z=My(v),l;Z===-1/0?l=0:Z<0?l=Uh(O+Z,0):l=ky(Z,O);var ae=typeof S>"u"?O:My(S),Y;ae===-1/0?Y=0:ae<0?Y=Uh(O+ae,0):Y=ky(ae,O);var ye=Uh(Y-l,0),me=Wb(M,[ye]);if(ye>0){if(jb(qh(M)))throw new Nb("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Ee=By(M),le=By(me);if(Ee===le)for(var ge=qh(M),Fe=qh(me),tt=Gb(M),Ne=Dy(M),Nt=l*tt+Ne,Ye=Dy(me),Ct=Ye+ye*tt;Ye<Ct;){var zt=qb(ge,Nt,"UINT8",!0,"UNORDERED");Zb(Fe,Ye,"UINT8",zt,!0,"UNORDERED"),Nt+=1,Ye+=1}else for(var At=0;l<Y;){var rr=zy(l),Kt=Ub(M,rr);$b(me,zy(At),Kt,!0),l+=1,At+=1}}return me},Hb=gv,_v=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||Hb},Kb=oe.getIntrinsic,Yb=Kb("%Object.getPrototypeOf%",!0),Jb=oe.hasProto(),Qb=Yb||(Jb?function(y){return y.__proto__}:null),ew=Ac,tw=Qb,rw=_v,iw=function(){if(typeof Uint8Array=="function"){var v=rw(),S=tw(Uint8Array.prototype);ew(S,{slice:v},{slice:function(){return S.slice!==v}})}return v},nw=Ac,ow=oe.callBindExports,aw=gv,xv=_v,sw=iw,bv=ow(xv());nw(bv,{getPolyfill:xv,implementation:aw,shim:sw});var lw=bv,wv=oe.whichTypedArray,Sv=lw,Ly=oe.gopd;function Hs(y){return Object.prototype.toString.call(y)}function uw(y){return Hs(y)==="[object Date]"}function cw(y){return Hs(y)==="[object RegExp]"}function pw(y){return Hs(y)==="[object Error]"}function hw(y){return Hs(y)==="[object Boolean]"}function fw(y){return Hs(y)==="[object Number]"}function dw(y){return Hs(y)==="[object String]"}var Tv=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};function Mc(y,v){if(y.forEach)return y.forEach(v);for(var S=0;S<y.length;S++)v(y[S],S,y)}var zc=Object.keys||function(v){var S=[];for(var M in v)S.push(M);return S},mw=Object.prototype.propertyIsEnumerable,Ry=Object.getOwnPropertySymbols;function Bc(y){var v=zc(y);if(Ry)for(var S=Ry(y),M=0;M<S.length;M++)mw.call(y,S[M])&&v.push(S[M]);return v}var Dc=Object.prototype.hasOwnProperty||function(y,v){return v in y};function yw(y,v){return typeof Ly!="function"?!0:!Ly(y,v).writable}function Iv(y,v){if(typeof y=="object"&&y!==null){var S;if(Tv(y))S=[];else if(uw(y))S=new Date(y.getTime?y.getTime():y);else if(cw(y))S=new RegExp(y);else if(pw(y))S={message:y.message};else if(hw(y)||fw(y)||dw(y))S=Object(y);else{var M=wv(y);if(M)return Sv(y);if(Object.create&&Object.getPrototypeOf)S=Object.create(Object.getPrototypeOf(y));else if(y.constructor===Object)S={};else{var O=y.constructor&&y.constructor.prototype||y.__proto__||{},Z=function(){};Z.prototype=O,S=new Z}}var l=v.includeSymbols?Bc:zc;return Mc(l(y),function(ae){S[ae]=y[ae]}),S}return y}var pf={__proto__:null};function Ev(y,v){var S=[],M=[],O=!0,Z=arguments.length>2?arguments[2]:pf,l=Z.includeSymbols?Bc:zc,ae=!!Z.immutable;return function Y(ye){var me=ae?Iv(ye,Z):ye,Ee={},le=!0,ge={node:me,node_:ye,path:[].concat(S),parent:M[M.length-1],parents:M,key:S[S.length-1],isRoot:S.length===0,level:S.length,circular:null,update:function(Ne,Nt){ge.isRoot||(ge.parent.node[ge.key]=Ne),ge.node=Ne,Nt&&(le=!1)},delete:function(Ne){delete ge.parent.node[ge.key],Ne&&(le=!1)},remove:function(Ne){Tv(ge.parent.node)?ge.parent.node.splice(ge.key,1):delete ge.parent.node[ge.key],Ne&&(le=!1)},keys:null,before:function(Ne){Ee.before=Ne},after:function(Ne){Ee.after=Ne},pre:function(Ne){Ee.pre=Ne},post:function(Ne){Ee.post=Ne},stop:function(){O=!1},block:function(){le=!1}};if(!O)return ge;function Fe(){if(typeof ge.node=="object"&&ge.node!==null){(!ge.keys||ge.node_!==ge.node)&&(ge.keys=l(ge.node)),ge.isLeaf=ge.keys.length===0;for(var Ne=0;Ne<M.length;Ne++)if(M[Ne].node_===ye){ge.circular=M[Ne];break}}else ge.isLeaf=!0,ge.keys=null;ge.notLeaf=!ge.isLeaf,ge.notRoot=!ge.isRoot}Fe();var tt=v.call(ge,ge.node);return tt!==void 0&&ge.update&&ge.update(tt),Ee.before&&Ee.before.call(ge,ge.node),le&&(typeof ge.node=="object"&&ge.node!==null&&!ge.circular&&(M.push(ge),Fe(),Mc(ge.keys,function(Ne,Nt){S.push(Ne),Ee.pre&&Ee.pre.call(ge,ge.node[Ne],Ne);var Ye=Y(ge.node[Ne]);ae&&Dc.call(ge.node,Ne)&&!yw(ge.node,Ne)&&(ge.node[Ne]=Ye.node),Ye.isLast=Nt===ge.keys.length-1,Ye.isFirst=Nt===0,Ee.post&&Ee.post.call(ge,Ye),S.pop()}),M.pop()),Ee.after&&Ee.after.call(ge,ge.node)),ge}(y).node}function tn(y){this.options=arguments.length>1?arguments[1]:pf,this.value=y}tn.prototype.get=function(y){for(var v=this.value,S=0;v&&S<y.length;S++){var M=y[S];if(!Dc.call(v,M)||!this.options.includeSymbols&&typeof M=="symbol")return;v=v[M]}return v};tn.prototype.has=function(y){for(var v=this.value,S=0;v&&S<y.length;S++){var M=y[S];if(!Dc.call(v,M)||!this.options.includeSymbols&&typeof M=="symbol")return!1;v=v[M]}return!0};tn.prototype.set=function(y,v){for(var S=this.value,M=0;M<y.length-1;M++){var O=y[M];Dc.call(S,O)||(S[O]={}),S=S[O]}return S[y[M]]=v,v};tn.prototype.map=function(y){return Ev(this.value,y,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})};tn.prototype.forEach=function(y){return this.value=Ev(this.value,y,this.options),this.value};tn.prototype.reduce=function(y,v){var S=arguments.length===1,M=S?this.value:v;return this.forEach(function(O){(!this.isRoot||!S)&&(M=y.call(this,M,O))}),M};tn.prototype.paths=function(){var y=[];return this.forEach(function(){y.push(this.path)}),y};tn.prototype.nodes=function(){var y=[];return this.forEach(function(){y.push(this.node)}),y};tn.prototype.clone=function(){var y=[],v=[],S=this.options;return wv(this.value)?Sv(this.value):function M(O){for(var Z=0;Z<y.length;Z++)if(y[Z]===O)return v[Z];if(typeof O=="object"&&O!==null){var l=Iv(O,S);y.push(O),v.push(l);var ae=S.includeSymbols?Bc:zc;return Mc(ae(O),function(Y){l[Y]=M(O[Y])}),y.pop(),v.pop(),l}return O}(this.value)};function Av(y){var v=arguments.length>1?arguments[1]:pf;return new tn(y,v)}Mc(Bc(tn.prototype),function(y){Av[y]=function(v){var S=[].slice.call(arguments,1),M=new tn(v);return M[y].apply(M,S)}});var vw=Av,gw=gi;function gi(y){if(!(this instanceof gi))return new gi(y);this._bbox=y||[1/0,1/0,-1/0,-1/0],this._valid=!!y}gi.prototype.include=function(y){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],y[0]),this._bbox[1]=Math.min(this._bbox[1],y[1]),this._bbox[2]=Math.max(this._bbox[2],y[0]),this._bbox[3]=Math.max(this._bbox[3],y[1]),this};gi.prototype.equals=function(y){var v;return y instanceof gi?v=y.bbox():v=y,this._bbox[0]==v[0]&&this._bbox[1]==v[1]&&this._bbox[2]==v[2]&&this._bbox[3]==v[3]};gi.prototype.center=function(y){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null};gi.prototype.union=function(y){this._valid=!0;var v;return y instanceof gi?v=y.bbox():v=y,this._bbox[0]=Math.min(this._bbox[0],v[0]),this._bbox[1]=Math.min(this._bbox[1],v[1]),this._bbox[2]=Math.max(this._bbox[2],v[2]),this._bbox[3]=Math.max(this._bbox[3],v[3]),this};gi.prototype.bbox=function(){return this._valid?this._bbox:null};gi.prototype.contains=function(y){if(!y)return this._fastContains();if(!this._valid)return null;var v=y[0],S=y[1];return this._bbox[0]<=v&&this._bbox[1]<=S&&this._bbox[2]>=v&&this._bbox[3]>=S};gi.prototype.intersect=function(y){if(!this._valid)return null;var v;return y instanceof gi?v=y.bbox():v=y,!(this._bbox[0]>v[2]||this._bbox[2]<v[0]||this._bbox[3]<v[1]||this._bbox[1]>v[3])};gi.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var y="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",y)};gi.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var _w=__,xw=vw,bw=gw,Cv={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},ww=Object.keys(Cv);Ec.exports=function(y){return hf(y).bbox()};Ec.exports.polygon=function(y){return hf(y).polygon()};Ec.exports.bboxify=function(y){return xw(y).map(function(v){if(v){var S=ww.some(function(M){return v[M]?Cv[M].indexOf(v.type)!==-1:!1});S&&(v.bbox=hf(v).bbox(),this.update(v))}})};function hf(y){for(var v=bw(),S=_w(y),M=0;M<S.length;M++)v.include(S[M]);return v}var Sw=Ec.exports;const Tw=oe.getDefaultExportFromCjs(Sw),Iw={methods:{getIconDetails(y){const v={};switch(y){case"cities":v.name="city";break;case"towns":v.name="home";break;case"islands":v.name="boat";break;case"regions":v.name="map";break;case"acco":v.name="bed";break;case"acti":v.name="walk";break;case"attr":v.name="camera";break;case"even":v.name="events";break;case"cate":v.name="food";break;case"reta":v.name="shopping-bag";break;case"featured":v.name="star";break;case"twnv":v.name="";break;case"vics":v.name="icentre-information";break;case"outlander-castle":v.name="castle";break;case"outlander-church-abbey":v.name="church";break;case"outlander-city-town-village":v.name="city";break;case"outlander-heritage":v.name="history";break;case"outlander-landscape-park":v.name="landscape";break;case"outlander-palace-house":v.name="palace";break;case"distilleries":v.name="distillery";break;case"itinerary-stop":v.name="";break}return v}}},Ew={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:oe.VsIcon},mixins:[Iw],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let y="map-marker-filled";return this.id==="twnv"&&(y="places-map-pin"),y},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},Aw={key:0,class:"vs-map-marker-icon__count"},Cw=R.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1);function Pw(y,v,S,M,O,Z){const l=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:R.normalizeClass(["vs-map-marker-icon",Z.parentClasses])},[R.createVNode(l,{name:Z.mapMarkerType,class:R.normalizeClass(["vs-map-marker-icon__marker",Z.markerClasses]),size:"xl"},null,8,["name","class"]),S.number?(R.openBlock(),R.createElementBlock("span",Aw,[Cw,R.createTextVNode(" "+R.toDisplayString(S.number),1)])):(R.openBlock(),R.createBlock(l,{key:1,class:"vs-map-marker-icon__icon",name:y.getIconDetails(S.id).name,size:"xs"},null,8,["name"]))],2)}const Lc=oe._export_sfc(Ew,[["render",Pw]]);let Va=null;const kw={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Lc},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Va=Zi()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...Jo.mapState(Zi,{highlightedPlace(y){return y.getHoveredStop(this.mapId)},activePlace(y){return y.getActivePlace(this.mapId)?y.getActivePlace(this.mapId):""},activeSubcat(y){return y.selectedSubCategory}}),getMarkerIcon(){let y;return this.feature.properties.type!==""?y=this.feature.properties.type:this.activeSubcat!==null?y=this.activeSubcat:y="featured",y==="null"&&(y=""),y}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Va.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Va.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Va.setActiveMarkerPos(this.feature.geometry.coordinates),Va.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(y){Va.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},handleClickEvent(y){const v=document.getElementsByClassName("mapboxgl-canvas");y.target===v[0]&&Va.setActivePlace({mapId:this.mapId,activeFeature:null})}}};function Mw(y,v,S,M,O,Z){const l=R.resolveComponent("VsMapMarkerIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-marker",Z.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",variant:"transparent",onClick:v[0]||(v[0]=(...ae)=>Z.markerClick&&Z.markerClick(...ae)),onKeydown:v[1]||(v[1]=R.withKeys((...ae)=>Z.markerClick&&Z.markerClick(...ae),["enter"])),onMouseover:v[2]||(v[2]=ae=>Z.handleHover(S.feature)),onMouseleave:v[3]||(v[3]=ae=>Z.handleHover("")),onFocusin:v[4]||(v[4]=ae=>Z.handleHover(S.feature)),onFocusout:v[5]||(v[5]=ae=>Z.handleHover(""))},[R.createVNode(l,{id:Z.getMarkerIcon,"is-map-marker":!0,number:S.feature.properties.stopCount?S.feature.properties.stopCount:""},null,8,["id","number"])],34)}const Pv=oe._export_sfc(kw,[["render",Mw]]);let js=null;const zw={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:oe.VsWarning,VsLoading:oe.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0}},setup(){js=Zi()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...Jo.mapState(Zi,{activeMarkerPostion(y){return this.mapbox.map?y.activeMarkerPos:null},highlightedPlace(y){return this.mapbox.map?y.getHoveredStop(this.mapId):null},activePlace(y){return this.mapbox.map?y.getActivePlace(this.mapId):null}})},watch:{isVisible(y){y&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(y){y===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(y){y&&(y.length===0?this.removeHoveredPolygon():y.geometry.type!=="Point"&&this.addHoveredPolygon(y))},selectedItem(y){if(y&&y.geometry.type!=="Point"){let v=[];v=this.polygons.features.filter(S=>S.properties.id===y.properties.id),v.length>0&&this.addActivePolygon(y)}y||this.removeActivePolygon()},activeMarkerPostion(y){this.checkPointIsVisible(y)||this.centreMapOnPoint(y)},showInfoMessage(y){y?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(y){y&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){js.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),window.addEventListener("DOMContentLoaded",()=>{u_.init({div:this.mapId})})},methods:{addMap(){const y=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new Un.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:y,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const y=new Un.NavigationControl;this.mapbox.map.addControl(y,"top-right"),this.mapbox.map.addControl(new Un.FullscreenControl)},initialiseMapFeatures(){this.places.map(y=>{if(typeof y.geometry<"u"){const v=this.getCoordinateArray(y);return this.getMapFeatures(y,v)}return y.latitude&&y.longitude?this.getItineraryMapFeatures(y):!1})},getCoordinateArray(y){return y.geometry.type==="Polygon"?[y.geometry.coordinates[0]]:y.geometry.type==="MultiPolygon"?[y.geometry.coordinates]:[y.geometry.coordinates[0],y.geometry.coordinates[1]]},getMapFeatures(y,v){return this.geojsonData.features.push({type:"Feature",geometry:{type:y.geometry.type,coordinates:v},properties:{title:y.properties.title,imageSrc:y.image,type:typeof y.properties.category<"u"?y.properties.category.id:"",id:y.properties.id},id:y.properties.id})},getItineraryMapFeatures(y){const v=oe.v4();return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(y.longitude),parseFloat(y.latitude)]},properties:{title:y.title,imageSrc:y.imageSrc,type:"itinerary-stop",stopCount:y.stopCount,id:v},id:v})},initialiseMapMarkers(){let y=0;this.initialLoad&&(y=1e3),setTimeout(()=>{if(this.markers!==null){for(let v=this.markers.length-1;v>=0;v--)this.markers[v].remove();this.markers=[]}this.geojsonData.features.forEach(v=>{v.geometry.type==="Point"&&this.createMapMarker(v)})},y)},createMapMarker(y){const v=R.h(Pv,{feature:y,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:O=>{this.$emit("showDetail",O)},onSetCategory:O=>{this.$emit("setCategory",O)}}),S=document.createElement("div");this.$refs.mapboxOuter.appendChild(S),R.render(v,S),y&&this.showMarkerPopups&&this.addMapPopup(y);const M=new Un.Marker(S.children[0]).setLngLat(y.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(M),this.markers.push(M),S.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(y=>{y.geometry.type==="Polygon"?this.polygons.features.includes(y.properties.id)||this.polygons.features.push(y):y.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(y.properties.id)||this.multiPolygons.push(y))}),this.multiPolygons.forEach(y=>{const v=y.properties;y.geometry.coordinates[0].forEach(S=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:S},id:v.id,properties:{id:v.id,imageSrc:v.imageSrc,title:v.title,type:v.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",y=>{y.features.length>0&&(this.addMapPopup(y),this.removeHoveredPolygon(),this.addHoveredPolygon(y.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",y=>{this.removeMapPopup(y),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",y=>{this.removeActivePolygon(),this.addActivePolygon(y.features[0]),this.addMapPopup(y.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(y){this.activeStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),js.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$emit("showDetail",y),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let y="";this.hoveredStateId===this.activeStateId&&(y="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":y})}js.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(y){this.hoveredStateId=y.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(y),js.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},addMapPopup(y){let v="";y.features?v=y.features[0]:v=y;const S=this.getCoordinates(v),M=this.getPopupHtml(v);v.properties.id&&(this.removeMapPopup(y),this.popup=new Un.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(S).setHTML(M).addTo(this.mapbox.map))},removeMapPopup(y){this.popup&&(this.popup.remove(),this.popup=null),y._popup&&y._popup.remove()},getCoordinates(y){return y.geometry.type==="Polygon"?this.findFeatureCentre(y.geometry.coordinates):y.geometry.type==="MultiPolygon"?this.findFeatureCentre(y.geometry.coordinates[0]):y.geometry.coordinates},findFeatureCentre(y){const v=[],S=[];return y[0].forEach(M=>{v.push(M[1]),S.push(M[0])}),{lat:(Math.min(...v)+Math.max(...v))/2,lng:(Math.min(...S)+Math.max(...S))/2}},getPopupHtml(y){return y.properties.imageSrc&&y.properties.stopCount?`
|
|
501
|
+
<img class="vs-map__popup-image" src="${y.properties.imageSrc}" />
|
|
502
|
+
<div>
|
|
503
|
+
<h4 class="vs-map__popup-subtitle">Stop ${y.properties.stopCount}</h4>
|
|
504
|
+
<p class="vs-map__popup-title">${y.properties.title}</p>
|
|
505
|
+
</div>
|
|
506
|
+
`:`
|
|
507
|
+
<p class="vs-map__popup-title">${y.properties.title}</p>
|
|
508
|
+
`},setupMarkerListeners(y){document.body.addEventListener("keyup",S=>{(S.key==="Escape"||S.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&js.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",S=>{S.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(Tw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(Un.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((v,S)=>v.extend(S),new Un.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const v=new Un.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),S=new Un.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new Un.LngLatBounds(v,S)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Bw={class:"vs-map","data-test":"vs-map"},Dw={class:"vs-map__message-box"},Lw={class:"vs-map__message-text"},Rw={ref:"mapboxOuter",class:"vs-map__map-outer"},Fw=["id"];function Ow(y,v,S,M,O,Z){const l=R.resolveComponent("VsLoading"),ae=R.resolveComponent("VsWarning");return R.openBlock(),R.createElementBlock("div",Bw,[O.showMapMessage?(R.openBlock(),R.createElementBlock("div",{key:0,class:R.normalizeClass(["vs-map__message",O.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[R.createElementVNode("div",Dw,[O.isLoading?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map__loading"})):R.createCommentVNode("",!0),R.createElementVNode("p",Lw,[O.isLoading?R.renderSlot(y.$slots,"map-loading-text",{key:0}):S.showInfoMessage?R.renderSlot(y.$slots,"info-message",{key:1}):O.showZoomMessage==="too-close"?R.renderSlot(y.$slots,"zoom-too-close",{key:2}):O.showZoomMessage==="too-far"?R.renderSlot(y.$slots,"zoom-too-far",{key:3}):R.createCommentVNode("",!0)])])],2)):R.createCommentVNode("",!0),R.createElementVNode("div",Rw,[R.createElementVNode("div",{id:S.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Fw)],512),R.createVNode(ae,{class:"vs-map__no-js"},{default:R.withCtx(()=>[R.renderSlot(y.$slots,"no-js")]),_:3})])}const kv=oe._export_sfc(zw,[["render",Ow]]),Vw={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsButton:oe.VsButton,VsMapMarkerIcon:Lc},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},Nw={class:"vs-main-map-category","data-test":"vs-main-map-category"};function Uw(y,v,S,M,O,Z){const l=R.resolveComponent("VsMapMarkerIcon"),ae=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",Nw,[R.createVNode(ae,{class:R.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${S.type}`]),"data-test":"vs-main-map-category__button",variant:"transparent",icon:"internal-link","icon-position":"right",size:"sm",onClick:v[0]||(v[0]=Y=>Z.selectCategory(S.type)),onMouseover:v[1]||(v[1]=Y=>O.isHovered=!0),onMouseout:v[2]||(v[2]=Y=>O.isHovered=!1),onFocusin:v[3]||(v[3]=Y=>O.isHovered=!0),onFocusout:v[4]||(v[4]=Y=>O.isHovered=!1)},{default:R.withCtx(()=>[R.createElementVNode("div",null,[R.createVNode(l,{class:"vs-main-map-category__icon",id:S.type,"is-hovered":O.isHovered},null,8,["id","is-hovered"]),R.createTextVNode(" "+R.toDisplayString(S.categoryName),1)])]),_:1},8,["class"])])}const qw=oe._export_sfc(Vw,[["render",Uw]]);let vc=null;const jw={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:Cp.BFormGroup,BFormCheckboxGroup:Cp.BFormCheckboxGroup,BFormCheckbox:Cp.BFormCheckbox,VsMapMarkerIcon:Lc},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return vc?vc.activeSubcatFilters:null},...Jo.mapState(Zi,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){vc=Zi(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){vc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},$w={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function Zw(y,v,S,M,O,Z){const l=R.resolveComponent("VsMapMarkerIcon"),ae=R.resolveComponent("BFormCheckbox"),Y=R.resolveComponent("BFormCheckboxGroup"),ye=R.resolveComponent("BFormGroup");return R.openBlock(),R.createElementBlock("div",$w,[R.createVNode(ye,null,{default:R.withCtx(()=>[R.createVNode(Y,{id:"checkbox-group-1",modelValue:O.selected,"onUpdate:modelValue":v[0]||(v[0]=me=>O.selected=me),name:S.data.name},{default:R.withCtx(()=>[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(S.data,me=>(R.openBlock(),R.createBlock(ae,{key:me.id,value:me.id,onChange:Z.emitChange},{default:R.withCtx(()=>[R.createVNode(l,{class:"vs-main-map-subcategory__icon",id:S.selectedSubCategory},null,8,["id"]),R.createTextVNode(" "+R.toDisplayString(me.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const Gw=oe._export_sfc(jw,[["render",Zw]]);let jh=null;const Ww={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:oe.VsImg,VsIcon:oe.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...Jo.mapState(Zi,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){jh=Zi(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){jh.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){jh.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},Xw={class:"vs-map-with-sidebar-list-item__img-container"},Hw={class:"vs-map-with-sidebar-list-item__text"};function Kw(y,v,S,M,O,Z){const l=R.resolveComponent("VsImg"),ae=R.resolveComponent("VsIcon");return R.openBlock(),R.createElementBlock("button",{type:"button",class:R.normalizeClass(["vs-map-with-sidebar-list-item",Z.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:v[0]||(v[0]=Y=>Z.showItemDetail(O.formattedData)),onKeyup:v[1]||(v[1]=R.withKeys(Y=>Z.showItemDetail(O.formattedData),["enter"])),onMouseover:v[2]||(v[2]=Y=>Z.itemHover(O.formattedData)),onMouseleave:v[3]||(v[3]=Y=>Z.itemHover("")),onFocusin:v[4]||(v[4]=Y=>Z.itemHover(O.formattedData)),onFocusout:v[5]||(v[5]=Y=>Z.itemHover("")),ref:"btn"},[R.createElementVNode("div",Xw,[typeof O.formattedData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:O.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):R.createCommentVNode("",!0)]),R.createElementVNode("span",Hw,R.toDisplayString(O.formattedData.properties.title),1),R.createVNode(ae,{name:"internal-link",variant:"tertiary",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const Yw=oe._export_sfc(Ww,[["render",Kw]]),Jw={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:oe.VsImg,VsHeading:oe.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},Qw={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},e2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},t2={key:3,class:"mt-4"},r2=["innerHTML"];function i2(y,v,S,M,O,Z){const l=R.resolveComponent("VsImg"),ae=R.resolveComponent("VsHeading");return R.openBlock(),R.createElementBlock("div",Qw,[typeof S.contentData.properties.image<"u"?(R.openBlock(),R.createBlock(l,{key:0,src:S.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-5 mb-lg-3"},null,8,["src"])):R.createCommentVNode("",!0),Z.showTitle?(R.openBlock(),R.createBlock(ae,{key:1,level:S.headingLevel,"override-style-level":"4",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:R.withCtx(()=>[typeof S.contentData.properties.placeTitle<"u"?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createTextVNode(R.toDisplayString(S.contentData.properties.placeTitle),1)],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createTextVNode(R.toDisplayString(S.contentData.properties.title),1)],64))]),_:1},8,["level"])):R.createCommentVNode("",!0),typeof S.contentData.properties.address<"u"?(R.openBlock(),R.createElementBlock("p",e2,R.toDisplayString(S.contentData.properties.address.shortAddress),1)):R.createCommentVNode("",!0),S.contentData.properties.subtitle?(R.openBlock(),R.createElementBlock("p",t2,R.toDisplayString(S.contentData.properties.subtitle),1)):R.createCommentVNode("",!0),R.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-6",innerHTML:S.contentData.properties.description},null,8,r2)])}const n2=oe._export_sfc(Jw,[["render",i2]]),o2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:oe.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function a2(y,v,S,M,O,Z){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",{class:R.normalizeClass(["vs-map-with-sidebar-buttons",S.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[S.filterCount!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(l,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:Z.clearFiltersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(Z.clearFiltersText),1)]),_:1},8,["onClick"]),R.createVNode(l,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"filters",size:"sm",onClick:Z.filtersClick},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(S.filterCount)+" "+R.toDisplayString(Z.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[R.createVNode(l,{block:"",href:S.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(S.contentData.properties.link.label),1)]),_:1},8,["href"]),Z.websiteDataExists?(R.openBlock(),R.createBlock(l,{key:0,href:S.contentData.properties.website.link,block:"",target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(S.contentData.properties.website.label),1)]),_:1},8,["href"])):R.createCommentVNode("",!0)],64))],2)}const s2=oe._export_sfc(o2,[["render",a2]]),l2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:oe.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...Jo.mapState(Zi,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},u2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function c2(y,v,S,M,O,Z){const l=R.resolveComponent("VsButton");return R.openBlock(),R.createElementBlock("div",u2,[R.createVNode(l,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:Z.clearSelection,onKeyup:R.withKeys(Z.clearSelection,["enter"])},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(Z.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),R.createVNode(l,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:R.withKeys(Z.submitCheckboxes,["enter"]),onClick:Z.submitCheckboxes,"aria-disabled":O.isDisabled,disabled:O.isDisabled},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(Z.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const p2=oe._export_sfc(l2,[["render",c2]]);let $h=null;const h2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:oe.VsButton,VsMapWithSidebarCategory:qw,VsMapWithSidebarSubcategory:Gw,VsHeading:oe.VsHeading,VsMapWithSidebarListItem:Yw,VsMapWithSidebarDetail:n2,VsMapWithSidebarButtons:s2,VsMapWithSidebarControls:p2},inject:["filters","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(v=>{v.id===this.selectedCategory&&(y=v)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(v=>typeof v.properties<"u"&&this.selectedItem?v.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(v=>v.id===this.selectedSubcategory):[]},...Jo.mapState(Zi,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){$h=Zi()},methods:{closePanel(){this.$emit("close-panel"),this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){$h.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const v=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(v[0].properties.address.shortAddress=y[0].address.shortAddress),v},clearSubCatFilters(){$h.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},f2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},d2={key:0,class:"vs-map-with-sidebar-panel__back"},m2={key:1,class:"vs-map-with-sidebar-panel__back"},y2={class:"visually-hidden"},v2={class:"vs-map-with-sidebar-panel__close"},g2={class:"visually-hidden"},_2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},x2={class:"visually-hidden"},b2={class:"visually-hidden"},w2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},S2={class:"vs-map-with-sidebar-panel__list-container"},T2={key:3,class:"vs-map-with-sidebar-panel__overlay"},I2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},E2={class:"vs-map-with-sidebar-panel__overlay-text"};function A2(y,v,S,M,O,Z){const l=R.resolveComponent("VsButton"),ae=R.resolveComponent("VsHeading"),Y=R.resolveComponent("VsMapWithSidebarSubcategory"),ye=R.resolveComponent("VsMapWithSidebarControls"),me=R.resolveComponent("VsMapWithSidebarCategory"),Ee=R.resolveComponent("VsMapWithSidebarListItem"),le=R.resolveComponent("VsMapWithSidebarButtons"),ge=R.resolveComponent("VsMapWithSidebarDetail");return R.openBlock(),R.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:R.normalizeClass(["vs-map-with-sidebar-panel",Z.panelClasses])},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__header-section",Z.headerClasses])},[R.createElementVNode("div",f2,[S.currentStage>1||S.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",d2,[R.createVNode(l,{class:"vs-map-with-sidebar-panel_menu",icon:"bars-mobile-menu",size:"sm",onClick:Z.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),S.currentStage===1||S.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",m2,[R.createVNode(l,{"icon-only":"",icon:"internal-link","icon-orientation":"down",size:"md",variant:"secondary",onClick:Z.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.createElementVNode("span",y2,[R.renderSlot(y.$slots,"back-btn-text")])]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),R.createElementVNode("div",v2,[R.createVNode(l,{"icon-only":"",icon:"close",size:"md",variant:"secondary",onClick:Z.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:R.withCtx(()=>[R.createElementVNode("span",g2,[R.renderSlot(y.$slots,"close-side-panel-text")])]),_:3},8,["onClick"])])]),S.currentStage>0||S.selectedSubcategory?(R.openBlock(),R.createElementBlock("div",_2,[R.createVNode(l,{"icon-only":"",icon:"internal-link","icon-orientation":"down",size:"md",variant:"secondary",onClick:Z.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:R.withCtx(()=>[R.createElementVNode("span",x2,[R.renderSlot(y.$slots,"back-btn-text")])]),_:3},8,["onClick"])])):R.createCommentVNode("",!0),Z.currentHeading!==""?(R.openBlock(),R.createBlock(ae,{key:1,level:S.headingLevel,"override-style-level":"4",class:R.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-8 mt-lg-0",S.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:R.withCtx(()=>[R.createTextVNode(R.toDisplayString(Z.currentHeading),1)]),_:1},8,["level","class"])):R.createCommentVNode("",!0),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar-panel__reset",S.currentStage<2?"d-lg-none":""])},[R.createVNode(l,{"icon-only":"",icon:"close",size:"md",variant:"secondary",onClick:Z.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:R.withCtx(()=>[R.createElementVNode("span",b2,[R.renderSlot(y.$slots,"reset-side-panel-text")])]),_:3},8,["onClick"])],2)],2),S.currentStage===0?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[S.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createVNode(Y,{data:Z.selectedSubcategoryData[0].subCategory,selectedSubCategory:S.selectedSubcategory},null,8,["data","selectedSubCategory"]),R.createVNode(ye)],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(Z.filters,Fe=>(R.openBlock(),R.createBlock(me,{key:Fe.id,"category-name":Fe.label,type:Fe.id,"has-sub-cat":Z.subCatExists(Fe)},null,8,["category-name","type","has-sub-cat"]))),128)),S.panelMessage!==null?(R.openBlock(),R.createElementBlock("div",w2,[R.createElementVNode("p",null,R.toDisplayString(S.panelMessage),1)])):R.createCommentVNode("",!0)],64)):R.createCommentVNode("",!0),S.currentStage===1?(R.openBlock(),R.createElementBlock(R.Fragment,{key:1},[S.selectedSubcategory!==null?(R.openBlock(),R.createElementBlock(R.Fragment,{key:0},[R.createElementVNode("div",S2,[(R.openBlock(!0),R.createElementBlock(R.Fragment,null,R.renderList(S.subcategoryLocations,(Fe,tt)=>(R.openBlock(),R.createBlock(Ee,{key:Fe.id,"item-data":Fe,"from-endpoint":!0,focussed:tt===S.currentListItemFocus,onShowItemDetail:Ne=>y.showDetail(Fe)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),Z.showLoadMore?(R.openBlock(),R.createBlock(l,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:v[0]||(v[0]=Fe=>Z.loadMorePlaces()),onKeyup:v[1]||(v[1]=R.withKeys(Fe=>Z.loadMorePlaces(),["enter"]))},{default:R.withCtx(()=>[R.renderSlot(y.$slots,"load-more-text")]),_:3})):R.createCommentVNode("",!0)]),R.createVNode(le,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:Z.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(R.openBlock(!0),R.createElementBlock(R.Fragment,{key:1},R.renderList(Z.currentData,Fe=>(R.openBlock(),R.createElementBlock("div",{key:Fe.id},[typeof Fe.properties<"u"&&Fe.properties.category.id===S.selectedCategory?(R.openBlock(),R.createBlock(Ee,{key:0,"item-data":Fe,onShowItemDetail:tt=>y.showDetail(Fe)},null,8,["item-data","onShowItemDetail"])):R.createCommentVNode("",!0)]))),128))],64)):R.createCommentVNode("",!0),S.currentStage===2?(R.openBlock(),R.createElementBlock(R.Fragment,{key:2},[R.createVNode(ge,{"heading-level":Z.detailHeadingLevel,"content-data":Z.currentPlaceData[0]},null,8,["heading-level","content-data"]),R.createVNode(le,{"content-data":Z.currentPlaceData[0]},null,8,["content-data"])],64)):R.createCommentVNode("",!0),S.panelStatus!==null?(R.openBlock(),R.createElementBlock("div",T2,[y.$slots["panel-loading-message"]&&S.panelStatus!=="map-loading"?(R.openBlock(),R.createElementBlock("div",I2,[R.createElementVNode("p",E2,[R.renderSlot(y.$slots,"panel-loading-message")])])):R.createCommentVNode("",!0)])):R.createCommentVNode("",!0)],2)}const C2=oe._export_sfc(h2,[["render",A2]]);let gc=null;const P2={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:oe.VsContainer,VsRow:oe.VsRow,VsCol:oe.VsCol,VsMap:kv,VsButton:oe.VsButton,VsMapWithSidebarPanel:C2,VsButtonToggleGroup:oe.VsButtonToggleGroup,VsWarning:oe.VsWarning},provide(){return{filters:this.filters,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...Jo.mapState(Zi,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){gc=Zi(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){gc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(gc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let v="";y.forEach(S=>{const M=`&cat=${S}`;v+=M}),this.currentPanelEndpointFilters=v,this.getSubcatMarkerData(v),this.getSubcatPanelData(v,0)},getSubcatMarkerData(y){const v=this.filters.filter(S=>S.id===this.selectedSubCategory);if(v.length>0){let S=v[0].pinsEndpoint;typeof y<"u"&&(S+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):oe.axios.get(S).then(M=>{this.totalEndpointPins=M.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(M.data.features.forEach(O=>{const Z=O;Z.properties.apiData=!0,this.activePins.push(Z)}),this.mapStatus="")})}},getSubcatPanelData(y,v){let M=this.filters.filter(O=>O.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(M+=y),v!==0&&(M+=`${y}&page=${v}`),this.panelStatus="loading-data",oe.axios.get(M).then(O=>{typeof O.data.data.products<"u"?(this.setStage(1),v===0?(this.subCatList=O.data.data.products,this.focussedListItem=0):(this.focussedListItem=v*24,this.subCatList=this.subCatList.concat(O.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const v=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;oe.axios.get(v).then(S=>{const M=[];M.push(S.data.data),this.currentEndpointData=M,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(gc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const v=this.placesData.filter(S=>typeof S.properties<"u"?S.properties.category.id===y:!1);this.activePins=v}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"}}};function k2(y,v,S,M,O,Z){const l=R.resolveComponent("VsMapWithSidebarPanel"),ae=R.resolveComponent("VsButton"),Y=R.resolveComponent("VsMap"),ye=R.resolveComponent("VsButtonToggleGroup"),me=R.resolveComponent("VsWarning"),Ee=R.resolveComponent("VsCol"),le=R.resolveComponent("VsRow"),ge=R.resolveComponent("VsContainer");return R.openBlock(),R.createBlock(ge,{"data-test":"vs-map-with-sidebar"},{default:R.withCtx(()=>[R.createVNode(le,null,{default:R.withCtx(()=>[R.createVNode(Ee,null,{default:R.withCtx(()=>[R.createElementVNode("div",{class:"vs-map-with-sidebar",ref:S.mapId},[R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__side-panel",Z.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[R.createVNode(l,{"category-heading":S.categoryHeading,"selected-category":O.selectedCategory,"selected-subcategory":O.selectedSubCategory,"current-stage":O.currentStage,"selected-item":O.selectedItem,"heading-level":S.mainHeadingExists?"3":"2","subcategory-locations":O.subCatList,"current-endpoint-data":O.currentEndpointData,"panel-status":O.panelStatus,"panel-message":O.currentStage===0?S.panelMessage:null,"total-pins":O.totalEndpointPins,"current-list-item-focus":O.focussedListItem,onSetCategory:Z.setCategory,onSetSubcategory:Z.setSubCategory,onSubcategoriesFiltered:Z.filterSubCategories,onSetStage:Z.setStage,onClosePanel:Z.closePanel,onShowItemDetail:Z.showDetail,onFilterPlaces:Z.filterPlaces,onLoadMorePlaces:Z.loadMorePlaces},{closePanelText:R.withCtx(()=>[R.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":R.withCtx(()=>[R.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":R.withCtx(()=>[R.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":R.withCtx(()=>[R.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":R.withCtx(()=>[R.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),R.createElementVNode("div",{class:R.normalizeClass(["vs-map-with-sidebar__map",Z.mapDisplayClass])},[R.createVNode(ae,{class:"vs-map-with-sidebar__map-toggle",icon:"bars-mobile-menu",size:"sm",onClick:Z.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:R.withCtx(()=>[R.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),R.createVNode(Y,{"is-visible":!O.panelVisible,labels:{},filters:S.filters,places:O.activePins,"selected-item":O.selectedItem,"map-id":S.mapId,"show-polygons":O.showRegions,"show-info-message":O.mapStatus!=="",onShowDetail:Z.showDetail,onSetCategory:Z.setCategory,onMapReady:Z.setMapReady,onZoomReset:v[0]||(v[0]=Fe=>O.resetZoom=!1),"bounds-data":S.regionBounds,"reset-zoom":O.resetZoom,"show-marker-popups":!1},{"map-loading-text":R.withCtx(()=>[R.renderSlot(y.$slots,"map-loading-text")]),"info-message":R.withCtx(()=>[R.createTextVNode(R.toDisplayString(Z.infoMessage),1)]),"zoom-too-close":R.withCtx(()=>[R.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":R.withCtx(()=>[R.renderSlot(y.$slots,"zoom-too-far")]),"no-js":R.withCtx(()=>[R.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom"]),S.toggleData.length>0?(R.openBlock(),R.createBlock(ye,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":O.selectedToggle,options:S.toggleData,"buttons-label":S.buttonsLabel,onToggleChanged:Z.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):R.createCommentVNode("",!0)],2)],512),R.createVNode(me,{class:"vs-map-with-sidebar__no-js"},{default:R.withCtx(()=>[R.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const M2=oe._export_sfc(P2,[["render",k2]]);exports.VsMap=kv;exports.VsMapMarker=Pv;exports.VsMapMarkerIcon=Lc;exports.VsMapWithSidebar=M2;
|